我一直在使用blankslate样板文件和;我对它的表现很满意,只提供了一些小细节。这涉及到站点使用卸载媒体插件时的图像裁剪;已启用“从服务器删除文件”设置。我和OM的人谈过一点&;他们很有帮助,但最终如果他们的插件没有引起任何问题,他们就不会来解决我的主题问题,我理解这一点。
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?
我的代码在下面(&M);我很感激你的建议!
// 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\'
) ) );
SO网友:Jeff W
是的,如果我遵守策略,那就最好了——正如我在评论中提到的那样,很明显的修复方法是将提供的代码更新到以下&;然后调用设置图像大小,即使我必须先定义图像大小,也解决了问题:
// 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_Media_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\',
\'mime_type\' => \'image\',
\'transport\' => \'refresh\'
) ) );