wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes
wp_admin_bar_edit_site_menu › WordPress Function
Depuis5.9.0
Dépréciéen/a
› wp_admin_bar_edit_site_menu ( $wp_admin_bar )
Paramètres: |
|
Défini(e) dans: |
|
Codex: | |
Changelog: |
|
Adds the "Edit site" link to the Toolbar.
Fonctions en relation: wp_admin_bar_site_menu, wp_admin_bar_edit_menu, wp_admin_bar_my_sites_menu, wp_admin_bar_updates_menu, wp_admin_bar_new_content_menu
Source
function wp_admin_bar_edit_site_menu( $wp_admin_bar ) { global $_wp_current_template_id; // Don't show if a block theme is not activated. if ( ! wp_is_block_theme() ) { return; } // Don't show for users who can't edit theme options or when in the admin. if ( ! current_user_can( 'edit_theme_options' ) || is_admin() ) { return; } $wp_admin_bar->add_node( array( 'id' => 'site-editor', 'title' => __( 'Edit site' ), 'href' => add_query_arg( array( 'postType' => 'wp_template', 'postId' => $_wp_current_template_id, ), admin_url( 'site-editor.php' ) ), ) ); }