Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: admin_post_thumbnail_html

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
1234                $thumbnail_html = wp_get_attachment_image( $thumbnail_id, 'post-thumbnail' );
1235           if ( !empty( $thumbnail_html ) ) {
1236                $ajax_nonce = wp_create_nonce( "set_post_thumbnail-$post_ID" );
1237                $content = sprintf($set_thumbnail_link, $thumbnail_html);
1238                $content .= '<p class="hide-if-no-js"><a href="#" id="remove-post-thumbnail" onclick="WPRemoveThumbnail(\'' . $ajax_nonce . '\');return false;">' . esc_html__( 'Remove featured image' ) . '</a></p>';
1239           }
1240           $content_width = $old_content_width;
1241      }
1242
1243      return apply_filters( 'admin_post_thumbnail_html', $content );
1244 }
1245
1246 /**
1247  * Check to see if the post is currently being edited by another user.
1248  *
1249  * @since 2.5.0
1250  *
1251  * @param int $post_id ID of the post to check for editing
1252  * @return bool|int False: not locked or locked by current user. Int: user ID of user with lock.