打开 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 静态化设置 windows主机伪静态去除index.php方法
将博客园(cnblogs.com)数据导入到wordpress的代码
wordpress主题支持自定义菜单及修改css样式实现方法
更多相关阅读请进入《wordpress》频道 >>