I've been working on a custom theme using the blankslate boilerplate & I'm happy with how it performs with a few minor details. This one concerns image cropping when a site uses the Offload Media plugin & has the remove files from server setting enabled. I've spoken with the OM folks a bit & they're helpful but at the end of the day if their plugin isn't causing any problems they're not there to troubleshoot my theme, which I understand.
My question is how can I modify my code to delay sending the file to the S3 bucket until the customizer has had a chance to crop & place the image?
My code is below & I appreciate any advice!
// Some picture
$wp_customize->add_setting( 'some_setting',
array(
'default' => '',
'sanitize_callback' => 'esc_attr',
)
);
$wp_customize->add_section('some_section', array(
'title' => __('Some Picture', 'textdomain'),
'priority' => 10,
'sanitize_callback' => 'esc_attr',
));
$wp_customize->add_control( new WP_Customize_Cropped_Image_Control( $wp_customize, 'some_setting', array(
'label' => __( 'Some Picture', 'textdomain' ),
'section' => 'title_tagline',
'height' => 250,
'width' => 250,
'flex-width' => false,
'flex-height' => false,
'settings' => 'some_setting',
'transport' => 'refresh'
) ) );
WP_Customize_Cropped_Image_Control
toWP_Customize_Media_Control
, add in the mime type, & define the thumbnail to call. Many thanks to OM's own Ian for providing guidance!