wordpress/wp-content/plugins/simple-image-sizes/classes/admin/Post.php
/**
	 * Rebuild the image size of a content featured image
	 */
Rebuild the image size of a content featured image
Rebuild the image size of a content featured image
public static function a_featured_rebuild() {
		$nonce = isset( $_POST['nonce'] ) ? $_POST['nonce'] : '';
		$id = isset( $_POST['id'] ) ? (int) $_POST['id'] : null;
		if ( ! wp_verify_nonce( $nonce, 'sis-regenerate-featured-' . $id ) || ! \current_user_can( 'manage_options' ) ) {
			wp_send_json( [ 'error' => __( 'Trying to cheat ?', 'simple-image-sizes' ) ] );
		}
		$attachment_id = get_post_thumbnail_id( $id );
		if ( ! has_post_thumbnail( $id ) || is_null( $attachment_id ) ) {
			wp_send_json( [ 'error' => __( 'There is no media attached to this content.', 'simple-image-sizes' ) ] );
		}
		wp_send_json( Main::thumbnail_rebuild( $attachment_id ) );
	}
public static function a_featured_rebuild ( ) { $ nonce = isset ( $ _POST [ 'nonce' ] ) ? $ _POST [ 'nonce' ] : '' ; $ id = isset ( $ _POST [ 'id' ] ) ? ( int ) $ _POST [ 'id' ] : null ; if ( ! wp_verify_nonce ( $ nonce , 'sis-regenerate-featured-' . $ id ) || ! \ current_user_can ( 'manage_options' ) ) { wp_send_json ( [ 'error' => __ ( 'Trying to cheat ?' , 'simple-image-sizes' ) ] ) ; } $ attachment_id = get_post_thumbnail_id ( $ id ) ; if ( ! has_post_thumbnail ( $ id ) || is_null ( $ attachment_id ) ) { wp_send_json ( [ 'error' => __ ( 'There is no media attached to this content.' , 'simple-image-sizes' ) ] ) ; } wp_send_json ( Main :: thumbnail_rebuild ( $ attachment_id ) ) ; }
Rebuild the image size of a content featured image
Rebuild the image size of a content featured image
// Get the nonce. // Get the thumbnails. // Check the nonce. // Get the id.