New answers tagged

3

Here's one idea, that might need further testing: /** * Cropped header image with the same description/caption as the original image */ add_filter( 'wp_create_file_in_uploads', function( $cropped, $attachment_id ) { add_filter( 'wp_insert_attachment_data', function( $data ) use ( $attachment_id) { if( doing_action( ...


0

An alternative to setting up the default image is to provide a button to "skip cropping" on the 2nd screen after selecting your svg image, which must be already cropped as the exact size you need. All you need to do is take that array defined above, where you define the height and width, then add this: 'flex-width' => true, ...



Top 50 recent answers are included