WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )
apply_filters( "hook_name", "what_to_filter" )
.Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
Line | Code |
---|---|
528 | && 'add' != $current_screen->action |
529 | && ( $post_type_object = get_post_type_object( $post->post_type ) ) |
530 | && current_user_can( 'read_post', $post->ID ) |
531 | && ( $post_type_object->public ) |
532 | && ( $post_type_object->show_in_admin_bar ) ) |
533 | { |
534 | if ( 'draft' == $post->post_status ) { |
535 | $preview_link = set_url_scheme( get_permalink( $post->ID ) ); |
536 | /** This filter is documented in wp-admin/includes/meta-boxes.php */ |
537 | $preview_link = apply_filters( 'preview_post_link', add_query_arg( 'preview', 'true', $preview_link ), $post ); |
538 | $wp_admin_bar->add_menu( array( |
539 | 'id' => 'preview', |
540 | 'title' => $post_type_object->labels->view_item, |
541 | 'href' => esc_url( $preview_link ), |
542 | 'meta' => array( 'target' => 'wp-preview-' . $post->ID ), |
543 | ) ); |
544 | } else { |
545 | $wp_admin_bar->add_menu( array( |
546 | 'id' => 'view', |