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
1157                $thumbnail_html = wp_get_attachment_image( $thumbnail_id, 'post-thumbnail' );
1158           if ( !empty( $thumbnail_html ) ) {
1159                $ajax_nonce = wp_create_nonce( 'set_post_thumbnail-' . $post->ID );
1160                $content = sprintf( $set_thumbnail_link, $upload_iframe_src, $thumbnail_html );
1161                $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>';
1162           }
1163           $content_width = $old_content_width;
1164      }
1165
1166      return apply_filters( 'admin_post_thumbnail_html', $content, $post->ID );
1167 }
1168
1169 /**
1170  * Check to see if the post is currently being edited by another user.
1171  *
1172  * @since 2.5.0
1173  *
1174  * @param int $post_id ID of the post to check for editing
1175  * @return bool|int False: not locked or locked by current user. Int: user ID of user with lock.