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 |
---|---|
490 | && 'add' != $current_screen->action |
491 | && ( $post_type_object = get_post_type_object( $post->post_type ) ) |
492 | && current_user_can( 'read_post', $post->ID ) |
493 | && ( $post_type_object->public ) |
494 | && ( $post_type_object->show_in_admin_bar ) ) |
495 | { |
496 | if( 'draft' == $post->post_status ) { |
497 | $preview_link = set_url_scheme( get_permalink( $post->ID ) ); |
498 | /** This filter is documented in wp-admin/includes/meta-boxes.php */ |
499 | $preview_link = apply_filters( 'preview_post_link', add_query_arg( 'preview', 'true', $preview_link ), $post ); |
500 | $wp_admin_bar->add_menu( array( |
501 | 'id' => 'preview', |
502 | 'title' => $post_type_object->labels->view_item, |
503 | 'href' => esc_url( $preview_link ), |
504 | 'meta' => array( 'target' => 'wp-preview-' . $post->ID ), |
505 | ) ); |
506 | } else { |
507 | $wp_admin_bar->add_menu( array( |
508 | 'id' => 'view', |