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