Claude 3 Opus已上线!OpenAI官网同版镜像站,支持GТР-4语音对讲,传文件,联网,DALL·E3,图片识别

WordPress中文版是全球广泛使用的免费开源网站博客程序.WordPress最新版是一种采用PHP语言开发的博客平台,用户可以在支持PHP和MySQL数据库的服务器上架设自己的网站,也可以把WordPress当作博客到大型网站的内容管理系统(CMS).WordPress程序是免费的开源项目,在GNU通用公共许可证下授权发布.

WordPress中文版v6.1.1 正式版以及优化教程

WordPress新版必备优化代码:

<!--添加优化代码到主题目录functions.php文件-->
/*彻底关闭自动更新(核心程序/主题/插件/翻译自动更新*/
add_filter('automatic_updater_disabled', '__return_true');
/*关闭更新检查定时作业*/
remove_action('init', 'wp_schedule_update_checks');
/*移除已有的版本检查定时作业*/
wp_clear_scheduled_hook('wp_version_check');
/*移除已有的插件更新定时作业*/
wp_clear_scheduled_hook('wp_update_plugins');
/*移除已有的主题更新定时作业*/
wp_clear_scheduled_hook('wp_update_themes');
/*移除已有的自动更新定时作业*/
wp_clear_scheduled_hook('wp_maybe_auto_update');
/*移除后台内核更新检查*/
remove_action( 'admin_init', '_maybe_update_core' );
/*移除后台插件更新检查*/
remove_action( 'load-plugins.php', 'wp_update_plugins' );
remove_action( 'load-update.php', 'wp_update_plugins' );
remove_action( 'load-update-core.php', 'wp_update_plugins' );
remove_action( 'admin_init', '_maybe_update_plugins' );
/*移除后台主题更新检查*/
remove_action( 'load-themes.php', 'wp_update_themes' );
remove_action( 'load-update.php', 'wp_update_themes' );
remove_action( 'load-update-core.php', 'wp_update_themes' );
remove_action( 'admin_init', '_maybe_update_themes' );
/*关闭程序更新提示*/
add_filter( 'pre_site_transient_update_core', function($a){ return null; });
/*关闭插件更新提示*/
add_filter('pre_site_transient_update_plugins', function($a){return null;});
/*关闭主题更新提示*/
add_filter('pre_site_transient_update_themes', function($a){return null;});
//关闭WordPress的XML-RPC功能
add_filter('xmlrpc_enabled', '__return_false');
/* 关闭XML-RPC的pingback端口 */
add_filter( 'xmlrpc_methods', 'remove_xmlrpc_pingback_ping' );
function remove_xmlrpc_pingback_ping( $methods ) {
unset( $methods['pingback.ping'] );
return $methods;
}
//禁用 pingbacks, enclosures, trackbacks
remove_action( 'do_pings', 'do_all_pings', 10 );
//去掉 _encloseme 和 do_ping 操作
remove_action( 'publish_post','_publish_post_hook',5 );
/* 禁止加载s.w.org获取表情和头像 */
remove_action('wp_head', 'print_emoji_detection_script', 7 );
remove_action('admin_print_scripts','print_emoji_detection_script');
remove_action('wp_print_styles', 'print_emoji_styles');
remove_action('admin_print_styles', 'print_emoji_styles');
function remove_dns_prefetch( $hints, $relation_type ) {
if ( 'dns-prefetch' === $relation_type ) {
return array_diff( wp_dependencies_unique_hosts(), $hints );
}
return $hints;
}
add_filter( 'wp_resource_hints', 'remove_dns_prefetch', 10, 2 );
/* 完全禁止REST API、移除wp-json链接 */
function lerm_disable_rest_api( $access ) {
	return new WP_Error(
		'Stop!',
		'Soooooryyyy',
		array(
			'status' => 403,
		)
	);
}
add_filter( 'rest_authentication_errors', 'lerm_disable_rest_api' );
remove_action( 'wp_head', 'rest_output_link_wp_head', 10 );
/* 禁止查询网站静态资源连接版本字符 */
function _remove_script_version ( $src ){
  $parts = explode( '?', $src );
  return $parts[0];
}
add_filter( 'script_loader_src', '_remove_script_version', 15, 1 );
add_filter( 'style_loader_src', '_remove_script_version', 15, 1 );
/* 移除前端网页源代码内的头部冗余代码 */
remove_action( 'wp_head', 'feed_links_extra', 3 ); 
remove_action( 'wp_head', 'rsd_link' ); 
remove_action( 'wp_head', 'wlwmanifest_link' ); 
remove_action( 'wp_head', 'index_rel_link' ); 
remove_action( 'wp_head', 'start_post_rel_link', 10, 0 ); 
remove_action( 'wp_head', 'wp_generator' ); 
/* 禁止新版文章编辑器加载前端样式 */
function wpassist_remove_block_library_css(){
    wp_dequeue_style( 'wp-block-library' );
} 
remove_action( 'wp_enqueue_scripts', 'wp_common_block_scripts_and_styles' );
add_action( 'wp_enqueue_scripts', 'wpassist_remove_block_library_css' );
/* 移除新版本站点健康状态面板和菜单项 */
add_action( 'admin_menu', 'remove_site_health_menu' ); 
function remove_site_health_menu(){
remove_submenu_page( 'tools.php','site-health.php' ); 
}
/* 禁用5.5版后自带的XML站点地图 */
add_filter( 'wp_sitemaps_enabled', '__return_false' );
/* 移除前后台顶部工具栏指定菜单 */
function admin_bar_item ( WP_Admin_Bar $admin_bar ) {
	$admin_bar->remove_menu('wp-logo'); //移动wp的logo
	$admin_bar->remove_menu('site-name'); //移动站点名称
	$admin_bar->remove_menu('updates'); //移动更新提示
	$admin_bar->remove_menu('comments'); //移动评论提示
	/*$admin_bar->remove_menu('new-content');	//移除新建按钮  */ 
}
add_action( 'admin_bar_menu', 'admin_bar_item', 500 );
//移除后台仪表盘站点健康状态面板
add_action('wp_dashboard_setup', 'remove_site_health_dashboard_widget');
function remove_site_health_dashboard_widget()
{
    remove_meta_box('dashboard_site_health', 'dashboard', 'normal');
}
//移除后台仪表盘菜单:站点健康状态
add_action( 'admin_menu', 'remove_site_health_menu' );	
function remove_site_health_menu(){
	remove_submenu_page( 'tools.php','site-health.php' ); 
}
//移除后台仪表盘菜单:活动、新闻
function bzg_remove_dashboard_widgets() {
	global $wp_meta_boxes;
	#移除 "活动" 
	unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_activity']);
	#移除 "WordPress 新闻" 
	unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']);
}
add_action('wp_dashboard_setup', 'bzg_remove_dashboard_widgets' );
//移除后台仪表盘菜单:帮助
function bzg_remove_help() {
	get_current_screen()->remove_help_tabs();
}
add_action('admin_head', 'bzg_remove_help');

//移除后台页面title标题的wordpress后缀
add_filter('admin_title', 'delAdminTitle', 10, 2);
function delAdminTitle($admin_title, $title){
    return $title.' ‹ '.get_bloginfo('name');
}
//移除登陆页面title标题的wordpress后缀
add_filter('login_title', 'remove_login_title', 10, 2);
function remove_login_title($login_title, $title){
	return $title.' ‹ '.get_bloginfo('name');
}
/* 彻底禁止4.4+版之后响应式图片功能及缩略图裁剪功能*/
// 禁止生成图像尺寸
function zm_customize_image_sizes( $sizes ){
	unset( $sizes[ 'thumbnail' ]);
	unset( $sizes[ 'medium' ]);
	unset( $sizes[ 'medium_large' ] );
	unset( $sizes[ 'large' ]);
	unset( $sizes[ 'full' ] );
	unset( $sizes['1536x1536'] );
	unset( $sizes['2048x2048'] );
	return $sizes;
}
 
add_filter( 'intermediate_image_sizes_advanced', 'zm_customize_image_sizes' );
 
// 禁止缩放图片尺寸
add_filter('big_image_size_threshold', '__return_false');
 
// 禁止生成其它图像尺寸
function shapeSpace_disable_other_image_sizes() {	
	// 禁止通过set_post_thumbnail_size()函数生成的图片尺寸
	remove_image_size('post-thumbnail'); 
	// 禁止添加其它图像尺寸
	remove_image_size('another-size');
}
add_action('init', 'shapeSpace_disable_other_image_sizes');
//切换经典文章编辑器(v5.x开始默认古腾堡编辑器)
add_filter('use_block_editor_for_post', '__return_false');
//替换评论用户头像链接为国内镜像加速访问
add_filter('get_avatar', function ($avatar) {
return str_replace([
'www.gravatar.com/avatar/',
'0.gravatar.com/avatar/',
'1.gravatar.com/avatar/',
'2.gravatar.com/avatar/',
'secure.gravatar.com/avatar/',
'cn.gravatar.com/avatar/'
], 'cravatar.cn/', $avatar);
});

//取消内容转义
remove_filter('the_content', 'wptexturize');
//取消摘要转义
remove_filter('the_excerpt', 'wptexturize');
//取消评论转义
remove_filter('comment_text', 'wptexturize');
//禁止转义引号字符
remove_filter('the_content', 'wptexturize');    // 禁止英文引号转义为中文引号

//文章插入图片自动移除 img 的 width、height、class 属性;
add_filter( 'post_thumbnail_html', 'fanly_remove_images_attribute', 10 );
add_filter( 'image_send_to_editor', 'fanly_remove_images_attribute', 10 );
function fanly_remove_images_attribute( $html ) {
 //$html = preg_replace( '/(width|height)="\d*"\s/', "", $html );
 $html = preg_replace( '/width="(\d*)"\s+height="(\d*)"\s+class="[^"]*"/', "", $html );
 $html = preg_replace( '/  /', "", $html );
 return $html;
}

//自适应图片删除width和height
function ludou_remove_width_height_attribute($content){
  preg_match_all('/<[img|IMG].*?src=[\'|"](.*?(?:[\.gif|\.jpg|\.png\.webp]))[\'|"].*?[\/]?>/', $content, $images);
  if(!empty($images)) {
    foreach($images[0] as $index => $value){
      $new_img = preg_replace('/(width|height)="\d*"\s/', "", $images[0][$index]);
      $content = str_replace($images[0][$index], $new_img, $content);
    }
  }
  return $content;
}

//判断是否是移动设备浏览
if(wp_is_mobile()) {
   #删除文章内容中img的width和height属性
   add_filter('the_content', 'ludou_remove_width_height_attribute', 99);
}

/* 删除文章时删除图片附件 */
function delete_post_and_attachments($post_ID) {
global $wpdb;
#删除特色图片
$thumbnails = $wpdb->get_results( "SELECT * FROM $wpdb->postmeta WHERE meta_key = '_thumbnail_id' AND post_id = $post_ID" );
foreach ( $thumbnails as $thumbnail ) {
wp_delete_attachment( $thumbnail->meta_value, true );
}
#删除图片附件
$attachments = $wpdb->get_results( "SELECT * FROM $wpdb->posts WHERE post_parent = $post_ID AND post_type = 'attachment'" );
foreach ( $attachments as $attachment ) {
wp_delete_attachment( $attachment->ID, true );
}
$wpdb->query( "DELETE FROM $wpdb->postmeta WHERE meta_key = '_thumbnail_id' AND post_id = $post_ID" );
}
add_action('before_delete_post', 'delete_post_and_attachments');

新版变化

News & Announcements – WordPress.org
https://wordpress.org/news/

系统要求

WordPress 5.x以上版本最低运行需求:
PHP5.6或更高版,建议PHP7.2稳定版
MySQL5.6或更高版,建议用5.6稳定版

下载地址

WordPress 6.1.1 简体中文正式版 (2022/11/16)

https://cn.wordpress.org/download/releases

https://cn.wordpress.org/wordpress-6.1.1-zh_CN.zip

https://cn.wordpress.org/wordpress-6.1.1-zh_CN.tar.gz


百度网盘超级会员/各大平台VIP,限时特价,诚信商家!

123云盘 - 空间2T,上传下载不限速,分享免登陆下载!

评论:169 条 | 管理回复:5

  1. Microsoft Edge 122.0.0.0 Microsoft Edge 122.0.0.0 Windows 10 x64 Edition Windows 10 x64 Edition

    能不能 发一个 wysiwyg web builder ?这个简单入门的网站制作工具,谢谢!

    匿名 2024-3-14 15:12:16回复
  2. Microsoft Edge 114.0.1264.71 Microsoft Edge 114.0.1264.71 Windows 10 x64 Edition Windows 10 x64 Edition

    Thanms ffor finaloly wrifing about > WordPress中文版v6.1.1 正式版以及优化教程 - 423Dowwn ffree xxx

    Dana 2023-8-5 20:55:20回复
  3. Google Chrome 107.0.0.0 Google Chrome 107.0.0.0 Windows 10 x64 Edition Windows 10 x64 Edition

    dux 7.9 可以来了

    moban 2022-11-17 10:26:47回复
  4. Sogou Explorer Sogou Explorer Windows 10 x64 Edition Windows 10 x64 Edition

    dux 7.9以上版本,能整个吗? z大

    netsurf 2022-11-16 20:09:54回复
  5. Google Chrome 104.0.0.0 Google Chrome 104.0.0.0 Windows 10 x64 Edition Windows 10 x64 Edition

    世界第一1语言php要挂了

    edge 2022-9-1 8:19:44回复
  6. Google Chrome 69.0.3497.100 Google Chrome 69.0.3497.100 Windows 10 x64 Edition Windows 10 x64 Edition

    85du.cn,怎么感觉加载越来越慢了呢

    顶替者 2022-6-14 15:01:11回复
    • Google Chrome 95.0.4638.69 Google Chrome 95.0.4638.69 Windows 10 x64 Edition Windows 10 x64 Edition

      速度不慢 挺快的

      匿名 2022-8-31 14:54:33回复
  7. Google Chrome 86.0.4240.198 Google Chrome 86.0.4240.198 Windows 7 Windows 7

    因在wp-content/themes/xiu8.4/functions.php文件的7行有错误,您对PHP代码的修改已被回滚。请修复并重试。

    syntax error, unexpected '<', expecting end of file,提示有这个。。。

    闫俊杰 2022-3-19 17:09:18回复
  8. Microsoft Edge 99.0.1150.39 Microsoft Edge 99.0.1150.39 Windows 10 x64 Edition Windows 10 x64 Edition

    上次用wordpress还是六年前

    kobe 2022-3-18 16:26:16回复
  9. Google Chrome 97.0.4692.71 Google Chrome 97.0.4692.71 Windows 10 x64 Edition Windows 10 x64 Edition

    更新了报错,结果又回滚到4.8版本了

    winandtest 2022-2-9 13:16:09回复
  10. Google Chrome 95.0.4638.69 Google Chrome 95.0.4638.69 Windows 10 x64 Edition Windows 10 x64 Edition

    zd是不是更新了wp啊?电脑上打开首页变手机版了 只有点文章才是电脑版

    asd 2021-11-12 1:13:30回复
  11. Microsoft Edge 93.0.961.44 Microsoft Edge 93.0.961.44 Windows 10 x64 Edition Windows 10 x64 Edition

    dux7.4不跟进更新一下吗?

    123 2021-9-13 23:32:41回复
  12. Google Chrome 89.0.4389.90 Google Chrome 89.0.4389.90 Windows 10 x64 Edition Windows 10 x64 Edition

    此站点遇到了致命错误,请查看您站点管理员电子邮箱中收到的邮件来获得指引。
    这是啥情况。。

    piaofu 2021-9-11 18:10:16回复
  13. Google Chrome 86.0.4240.198 Google Chrome 86.0.4240.198 Windows 10 x64 Edition Windows 10 x64 Edition

    前面的破解版还能在发一下吗

    匿名 2021-7-22 11:37:02回复
  14. Microsoft Edge 90.0.818.42 Microsoft Edge 90.0.818.42 Windows 10 x64 Edition Windows 10 x64 Edition

    }
    //移除后台仪表盘菜单:站点健康状态
    add_action( 'admin_menu', 'remove_site_health_menu' );
    function remove_site_health_menu(){
    remove_submenu_page( 'tools.php','site-health.php' );
    }

    这段貌似有错误,不懂修改。

    路人甲 2021-5-15 21:36:33回复
  15. Google Chrome 86.0.4240.198 Google Chrome 86.0.4240.198 Windows 10 x64 Edition Windows 10 x64 Edition

    跪求大佬更新dux主题 今日发布的最新版本 7.0 破解版 谢谢

    maoxinhang 2021-1-27 12:52:52回复
  16. WebView 4.0 WebView 4.0 Android 7.1.1 Android 7.1.1

    这个软件确实很好用

    WordPress 2020-12-10 16:24:49回复
  17. Firefox 68.0 Firefox 68.0 Android 10 Android 10

    听说wordpress的代码写得不好

    匿名 2020-12-3 20:49:04回复
  18. Microsoft Edge 87.0.664.41 Microsoft Edge 87.0.664.41 Windows 10 x64 Edition Windows 10 x64 Edition

    这个 good~!

    jiaokai123 2020-12-1 14:10:04回复
  19. Google Chrome 69.0.3497.100 Google Chrome 69.0.3497.100 Windows 10 x64 Edition Windows 10 x64 Edition

    接上:
    1、用在WP4.9里就只报一个小的警告,根据提示修改了对应php文件就好了。
    2、文件里还有很一些破解作者的信息和推广,搜索一下关键字可以轻松去掉文字方面的,还有一些在首页轮播图片上,被PS了。不知道是不是zd大大忘记去了。(因为看你主题介绍说的是“纯净版”)

    Echo11 2020-10-12 20:07:53回复

评论反馈