Changeset 38118 for trunk/src/wp-admin/includes/ajax-actions.php
- Timestamp:
- 07/20/2016 04:23:36 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/ajax-actions.php
r38091 r38118 2165 2165 2166 2166 /** 2167 * Ajax handler for retrieving HTML for the featured image. 2168 * 2169 * @since 4.6.0 2170 */ 2171 function wp_ajax_get_post_thumbnail_html() { 2172 $post_ID = intval( $_POST['post_id'] ); 2173 2174 check_ajax_referer( "update-post_$post_ID" ); 2175 2176 if ( ! current_user_can( 'edit_post', $post_ID ) ) { 2177 wp_die( -1 ); 2178 } 2179 2180 $thumbnail_id = intval( $_POST['thumbnail_id'] ); 2181 2182 // For backward compatibility, -1 refers to no featured image. 2183 if ( -1 === $thumbnail_id ) { 2184 $thumbnail_id = null; 2185 } 2186 2187 $return = _wp_post_thumbnail_html( $thumbnail_id, $post_ID ); 2188 wp_send_json_success( $return ); 2189 } 2190 2191 /** 2167 2192 * Ajax handler for setting the featured image for an attachment. 2168 2193 *
Note: See TracChangeset
for help on using the changeset viewer.