install_plugins_favorites_form()
- Since
- 3.5.0
- Source
wp-admin/includes/plugin-install.php:366
Shows a username form for the favorites page.
Uses · 6
- get_user_option()Retrieves user option that can be either per Site or per Network.
- get_current_user_id()Gets the current user's ID.
- _e()Displays translated text.
- esc_attr()Escaping for HTML attributes.
- esc_attr_e()Displays translated text that has been escaped for safe use in an attribute.
- wp_create_nonce()Creates a cryptographic token tied to a specific action, user, user session, and window of time.
Source
function install_plugins_favorites_form() { $user = get_user_option( 'wporg_favorites' ); $action = 'save_wporg_username_' . get_current_user_id(); ?> <p><?php _e( 'If you have marked plugins as favorites on WordPress.org, you can browse them here.' ); ?></p> <form method="get"> <input type="hidden" name="tab" value="favorites" /> <p> <label for="user"><?php _e( 'Your WordPress.org username:' ); ?></label> <input type="search" id="user" name="user" value="<?php echo esc_attr( $user ); ?>" /> <input type="submit" class="button" value="<?php esc_attr_e( 'Get Favorites' ); ?>" /> <input type="hidden" id="wporg-username-nonce" name="_wpnonce" value="<?php echo esc_attr( wp_create_nonce( $action ) ); ?>" /> </p> </form> <?php}History
Introduced in 3.5.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 6.8.8 tag, from
src/wp-admin/includes/plugin-install.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it. - Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.