WordPress V5.7.0 官方简体中文正式版

WordPress全球使用最广泛的知名开源网站博客程序。WordPress是一种使用PHP语言开发的博客平台,用户可以在支持PHP和MySQL 数据库的服务器上架设自己的网志。也可以把WordPress 当作一个内容管理系统CMS来使用,WordPress 还是一个免费的开源项目,在GNU通用公共许可证下授权发布。5.3扩充并改善了从WordPress 5.0开始带来的区块编辑器,为您带来全新的区块、更直觉的交互和改良的无障碍访问。新功能提升了编辑器的设计自由度,为您带来更多布局选项和样式变化,让设计师能够全面控制网站的外观。这次发布也为您带来了二〇二〇主题,给用户带来更多的设计弹性,并与区块编辑器完美整合。现在要建立美观的网页及高级页面布局,是再也简单不过的事了。

区块编辑器的改进
这次更新的重点在于超过150个新功能和可用性改进,包括针对来自智能手机或高画质相机的未经优化的、高分辨率的图片的大尺寸图片上传支持。与更大的默认图像尺寸一同带来前所未有的图片的视觉效果。

无障碍的改进包括了管理界面整合区块编辑器样式。这些改进过的样式修正了许多无障碍访问的问题:表单字段和按钮的颜色对比度、编辑器和管理界面的外观一致性、新的底部通知、标准化的WordPress配色方案和全新的Motion交互,能让区块移动时更加流畅及自然。对于使用键盘操作仪表盘的人们来说,区块编辑器现在有了浏览模式,能够让您不需tab过每一个区块控件即能前往下一个区块。

扩展设计弹性

WordPress 为您带来更多用于创建令人赞赏的设计的强大工具。

新的群组区块让您轻松将页面分割为多彩的章节
栏目区块现在支持固定栏宽
全新预定义布局让排列内容为高级设计变得十分简单
标题区块现在可以设置字体颜色
更多样式选项让您能够为任何支持此选项的区块设置样式

二〇二〇全新登场
在区块编辑器通过一整年的考验后,我们荣幸地推出以弹性为设计核心的二〇二〇主题。通过内容栏、群组和媒体区块的组合,便能在网站上展示您的服务或产品。您还能在这个主题中将内容居于中栏,或将内容设置为不同的宽度及对齐方式,籍此带来充满动感且引人入胜的布局。

这个名为二〇二〇的主题,其清晰度和可读性也是本次发布的重点。该主题包含Rasmus Andersson设计的Inter字体,该字体是默认主题首次提供可变字体版本,能够通过将全部字重和样式都包含在两个字体文件之中来减低载入时间。

自动图像旋转

您的图像现在会在上传时依据内嵌的方向数据被自动旋转。此功能在9年前即被提出,在许多尽心尽力的参与者努力下才得实现。

站点健康检查

5.3版带来的改进让侦测网站问题变得更加简单。健康状态页面中的详细建议能明确指出网站中需要排解疑难的区域。

管理电邮验证

现在网站会在管理员登录时,定期要求确认管理员邮件地址是否正确。这样能够降低网站管理员在变更邮件地址后,被锁在网站之外的风险。

日期时间组件修正

开发者现在能够更稳定地与日期和时区一同工作。日期和时间功能的全新API函数能够用以实现时区获取和PHP互操作,还有其他bug修正。

PHP 7.4兼容性

WordPress 5.3的目标是完整支持PHP 7.4。本次发布包含多项修改来移除已废弃的功能并确保兼容性。WordPress继续建议所有用户运行最新最佳的PHP版本。

WordPress是开源软件,可以用来创建一个漂亮的网站,博客或应用程序,美丽的设计,强大的功能,以及建立任何你想要的自由。

WordPress 5简体中文版现已开放下载,主要对编辑器做出了许多改进。我们全新的区块编辑器是为您在全站提供流畅的编辑体验的第一步。不管您是在建立您的第一个站点、翻新您的博客还是编写代码为业,您都将有更多的灵活性来决定如何展示您的站点内容。

WordPress 5.5 增加图像延迟加载,只在火狐浏览器中有效,Chromium内核的浏览器经测试无效。

WordPress 5.5集成的 XML 站点地图,基本不符合国内的搜索要求。

WordPress 5.5区块编辑器可以实时预览区块样式。

WordPress 5.5插件可以选择自动更新和禁止自动更新。

WordPress 5.5 新增加了一些函数方便开发人员使用。

下载地址

关注微信公众号:窝窝教程

WordPress v5.7 官方简体中文正式版 [2021/03/15]
https://cn.wordpress.org/download/releases

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

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


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', create_function('$a', "return null;"));
//禁止后台显示插件升级提示
add_filter('pre_site_transient_update_plugins', create_function('$a', "return null;"));
//禁止后台显示主题升级提示
add_filter('pre_site_transient_update_themes', create_function('$a', "return null;"));
//关闭WordPress的XML-RPC功能(建议清空网站根目录下下xmlrpc.php内容)
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;
}
//替换前端公共库jQuery到国内,加快后台访问
function my_modify_jquery() {
if (!is_admin()) {
wp_deregister_script('jquery');
wp_deregister_script('jquery-form');
wp_register_script('jquery', ('https://cdn.bootcss.com/jquery/2.2.4/jquery.min.js'), false, null, true); 
wp_register_script('jquery-form', ('https://cdn.bootcss.com/jquery.form/4.2.2/jquery.form.min.js'), array(jquery), null, true);
 }
}
//禁止WordPress新版本头部加载s.w.org境外域名
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 );
//解决后台加载ajax.googleapis无法访问
function hc_cdn_callback($buffer) {
return str_replace('ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/themes/smoothness/jquery-ui.css', 'cdn.bootcss.com/jqueryui/1.12.1/jquery-ui.min.css', $buffer);
}
function hc_buffer_start() {
ob_start("hc_cdn_callback");
}
function izt_buffer_end() {
ob_end_flush();
}
add_action('init', 'hc_buffer_start');
add_action('shutdown', 'hc_buffer_end');
//减少后台admin-ajax.php加载时间的方法
add_action( 'init', 'my_deregister_heartbeat', 1 );
function my_deregister_heartbeat() {
global $pagenow;
if ( 'post.php' != $pagenow && 'post-new.php' != $pagenow )
wp_deregister_script('heartbeat');
}
//替换评论用户头像链接为国内镜像加速访问
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/'
], 'sdn.geekzu.org/avatar/', $avatar);
});
 //删除头部冗余代码
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' ); 
//删除WordPress新版本站点健康状态面板和菜单项
add_action( 'admin_menu', 'remove_site_health_menu' ); 
function remove_site_health_menu(){
remove_submenu_page( 'tools.php','site-health.php' ); 
}
//切换经典文章编辑器(v5.x开始默认古腾堡编辑器)
add_filter('use_block_editor_for_post', '__return_false');
//禁止WordPress新版本文章编辑器前端加载样式文件
remove_action( 'wp_enqueue_scripts', 'wp_common_block_scripts_and_styles' );
//自动给所有文章的外部链接添加nofollow属性(有助于SEO方面)
add_filter('the_content','the_content_nofollow',999);
function the_content_nofollow($content){
preg_match_all('/href="(.*?)" rel="external nofollow" /',$content,$matches);
if($matches){
foreach($matches[1] as $val){
if( strpos($val,home_url())===false ) $content=str_replace("href=\"$val\"", "href=\"$val\" rel=\"external nofollow\" ",$content);
}
}
return $content;
}
/*发布文章主动推送到百度,加快收录保护原创【WordPress通用方式】*/
if(!function_exists('Baidu_Submit')){
function Baidu_Submit($post_ID) {
$WEB_TOKEN = ''; //这里请换成你的网站的百度主动推送的token值
$WEB_DOMAIN = get_option('home');
//已成功推送的文章不再推送
if(get_post_meta($post_ID,'Baidusubmit',true) == 1) return;
$url = get_permalink($post_ID);
$api = 'http://data.zz.baidu.com/urls?site='.$WEB_DOMAIN.'&token='.$WEB_TOKEN;
$request = new WP_Http;
$result = $request->request( $api , array( 'method' => 'POST', 'body' => $url , 'headers' => 'Content-Type: text/plain') );
$result = json_decode($result['body'],true);
//如果推送成功则在文章新增自定义栏目Baidusubmit,值为1
if (array_key_exists('success',$result)) {
add_post_meta($post_ID, 'Baidusubmit', 1, true);
}
}
add_action('publish_post', 'Baidu_Submit', 0);
}
//文章插入图片自动移除 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\.bmp]))[\'|"].*?[\/]?>/', $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;
}
/* 删除文章时删除图片附件 */
function delete_post_and_attachments($post_ID) {
global $wpdb;
// 删除图片附件
$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');
© 版权声明
THE END
喜欢就支持以下吧
点赞321赞赏
分享
评论 共12条
    • 软壳客
    • Fredericka0
      I am truly thankful to the owner of this web page who has shared this fantastic post at at this time. Take a look at my web-site :: call girls in kolkata
      1月前回复
    • 软壳客
    • Gabrielle0
      Its like you read my mind! You appear to know so much about this, like you wrote the book call girls in kolkata it or something. I think that you can do with a few pics to drive the message home a little bit, but instead of that, this is fantastic blog. A great read. I'll definitely be back.
      1月前回复
    • 软壳客
    • Mikayla0
      whoah this blog is magnificent i like studying your posts. Keep up the great work! You know, a lot of individuals are hunting around for this info, you could aid them greatly. Feel free to visit my blog :: kolkata escorts
      1月前回复
    • 软壳客
    • Jay0
      Undeniably believe that which you said. Your favorite reason seemed to be on the internet the simplest thing to be aware of. I say to you, I certainly get irked while people think about worries that they plainly don't know about. You managed to hit the nail upon the top and also defined out the whole thing without having side-effects , people can take a signal. Will likely be back to get more. Thanks Also visit my webpage call girls in kolkata
      1月前回复
    • 软壳客
    • Angelia0
      Greetings! This is my 1st comment here so I just wanted to give a quick shout out and tell you I really enjoy reading through your blog posts. Can you recommend any other blogs/websites/forums that deal with the same subjects? Many thanks! Here is my page :: kolkata call girls
      1月前回复
    • 软壳客
    • Elizbeth0
      Can I just say what a comfort to find somebody who genuinely knows what they're talking about online. You actually know how to bring an issue to light and make it important. More people should look at this and understand this side of your story. I was surprised that you're not more popular since you most certainly have the gift. Here is my page: kolkata escorts
      1月前回复
    • 软壳客
    • Johnny0
      My brother recommended I might like this blog. He was totally right. This post actually made my day. You can not imagine simply how much time I had spent for this information! Thanks! Here is my web site call girls in kolkata
      1月前回复
    • 软壳客
    • Lanora0
      Pretty great post. I just stumbled upon your blog and wanted to mention that I have really loved browsing your blog posts. call girls in mumbai any case I'll be subscribing on your feed and I hope you write once more soon!
      1月前回复
    • 软壳客
    • Emely0
      Just want to say your article is as amazing. The clarity in your put up is just excellent and that i can suppose you are a professional in this subject. Well along with your permission allow me to grasp your feed to stay updated with coming near near post. Thanks one million and please carry on the rewarding work. Also visit my web-site: kolkata escorts
      1月前回复
    • 软壳客
    • Ebony0
      Good day! I know this is kinda off topic but I was wondering if you knew where I could get a captcha plugin for my comment form? I'm using the same blog platform as yours and I'm having trouble finding one? Thanks a lot! my web page :: massage in kolkata - Darby -
      1月前回复
    • 软壳客
    • Rolando0
      Awesome site you have here but I was curious about if you knew of any community forums that cover the same topics discussed here? I'd really love to be a part of online community where I can get advice from other experienced individuals that share the same interest. If you have any suggestions, please let me know. Bless you! my page kolkata escorts
      1月前回复
    • 软壳客
    • Jonelle0
      Its such as you read my mind! You seem to grasp so much about this, like you wrote the e book in it or something. I think that you just could do with some percent to pressure the message house a little bit, but instead of that, that is fantastic blog. A great read. I'll certainly be back. Also visit my blog post: kolkata escorts
      1月前回复