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