php function round_images() { $images = get_posts( array( 'post_type' => 'attachment', 'post_status' => 'inherit' ) ); foreach ( $images as $image ) { $image_id = $image->ID; $image_url = wp_get_attachment_image_src( $image_id, 'full' ); $image_url = str_replace( '.jpg', '-rounded.jpg', $image_url ); wp_update_attachment_metadata( $image_id, array( 'sizes' => array( 'full' => array( 'width' => 1200, 'height' => 1200, 'crop' => true ) ) ) ); $image_url = wp_get_attachment_image_src( $image_id, 'full' ); update_option( 'siteurl', str_replace( 'http://', 'https://', $image_url ) ); } } add_action( 'init', 'round_images' );