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