Answers:
将此添加到您的functions.php或功能插件中。
add_action( 'admin_footer-post-new.php', 'media_manager_default' );
add_action( 'admin_footer-post.php', 'media_manager_default' );
function media_manager_default() {
?>
<script type="text/javascript">
jQuery(document).ready(function($){
wp.media.controller.Library.prototype.defaults.contentUserSetting=false;
});
</script>
<?php
}
如果有人仍在寻找解决方案,那么该解决方案对我来说适用于所有帖子类型和特色图片中的所有上传图片:
function upload_media_manager_by_default() {
if ( did_action( 'wp_enqueue_media' ) ) {
?>
<script type="text/javascript">
jQuery( document ).ready( function ( $ ) {
wp.media.controller.Library.prototype.defaults.contentUserSetting = false;
wp.media.controller.FeaturedImage.prototype.defaults.contentUserSetting = false;
});
</script>
<?php
}
}
add_action( 'admin_footer', 'upload_media_manager_by_default' );