wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes
wp_admin_bar_shortlink_menu › WordPress Function
Depuis3.1.0
Dépréciéen/a
› wp_admin_bar_shortlink_menu ( $wp_admin_bar )
| Paramètres: |
|
| Défini(e) dans: |
|
| Codex: |
Provides a shortlink.
Fonctions en relation: wp_admin_bar_site_menu, wp_admin_bar_customize_menu, wp_admin_bar_edit_menu, wp_admin_bar_search_menu, wp_admin_bar_wp_menu
Source
function wp_admin_bar_shortlink_menu( $wp_admin_bar ) {
$short = wp_get_shortlink( 0, 'query' );
$id = 'get-shortlink';
if ( empty( $short ) ) {
return;
}
$html = '<input class="shortlink-input" type="text" readonly="readonly" value="' . esc_attr( $short ) . '" aria-label="' . __( 'Shortlink' ) . '" />';
$wp_admin_bar->add_node(
array(
'id' => $id,
'title' => __( 'Shortlink' ),
'href' => $short,
'meta' => array( 'html' => $html ),
)
);
}