打开 wp-adminincludespost.php 文件,搜索 if ( $create_in_db ) { 找到以下代码 597行
$post_id = wp_insert_post( array( \'post_title\' => __( \'Auto Draft\' ), \'post_type\' => $post_type, \'post_status\' => \'auto-draft\' ) ); $post = get_post( $post_id );
修改为:
global $current_user,$wpdb; $post = $wpdb->get_row( "SELECT * FROM $wpdb->posts WHERE post_status = \'auto-draft\' AND post_type = \'$post_type\' AND post_author = $current_user->ID ORDER BY ID ASC LIMIT 1" ); if (!($post) ) { $post_id = wp_insert_post( array( \'post_title\' => __( \'Auto Draft\' ), \'post_type\' => $post_type, \'post_status\' => \'auto-draft\' ) ); $post = get_post( $post_id ); }
如下:
以上就是禁用WordPress自动保存、自动草稿、文章修订功能的方法,希望对大家有所帮助
标签:WordPress
相关阅读 >>
wordpress提示require_once() failed opening required的解决方法
wordpress与drupal的nginx配置rewrite重写规则示例
wordpress添加html5的表单验证required方法小结
wordpress如何设置文章置顶以及区分置顶文章与普通文章
更多相关阅读请进入《wordpress》频道 >>