有些童鞋升级wordpress 5.5 后发现回复按钮失效,在WordPress 5.1时就出现过,问题大部分出现在自定义了评论函数或者使用Ajax评论的主题中。
症状是:点击回复按钮刷新页面,并且评论表单不能嵌套。
问题原因是WordPress开发人员,修改了评论核心文件。经测试貌似是修改了wp-includesjs目录的comment-reply.js文件,用5.4.2版本的文件替换后,问题消失。
同一个问题出现两次,有点太不顾成千上万的主题用户了,也没有明确的说明文件,只顾折腾块编辑器….
解决办法,可以尝试将下面的代码加到主题functions.php中:
add_filter( 'comment_reply_link', 'mytheme_replace_comment_reply_link', 10, 4 );
function mytheme_replace_comment_reply_link( $link, $args, $comment, $post ){
if ( get_option( 'comment_registration' ) && ! is_user_logged_in() ) {
$link = sprintf( '%s',
esc_url( wp_login_url( get_permalink() ) ),
$args['login_text']
);
} else {
$onclick = sprintf( 'return addComment.moveForm( "%1$s-%2$s", "%2$s", "%3$s", "%4$s" )',
$args['add_below'], $comment->comment_ID, $args['respond_id'], $post->ID
);
$link = sprintf( "%s",
esc_url( add_query_arg( 'replytocom', $comment->comment_ID, get_permalink( $post->ID ) ) ) . "#" . $args['respond_id'],
$onclick,
esc_attr( sprintf( $args['reply_to_text'], $comment->comment_author ) ),
$args['reply_text']
);
}
return $link;
}
该方法之前用于WP5.1,同样适用于W5.5,可以适当修改其中的class适应自己的主题结构。
程序自带的代码位于wp-includes目录comment-template.php大约1817行
代码来源:https://wp-kama.ru/function/get_comment_reply_link
另外,WordPress 5.5与主题和插件不兼容的问题很多,在官网上层出不穷。
因WordPress 5.5并没有安全类的更新,也没有中文版,用之前的语言文件,后台存在大量的异族文字,目前我自己并没有升级,估计中文版这次又是遥遥无期了。
WordPress 5.5更新重点还是折腾区块编辑器而已,顶着绝大部人的反对,费力不讨好地开发区块编辑器新功能,如果开发人员看了“Classic Editor(经典编辑器)”切换插件,5+百万的下载安装量,不知道会是个什么滋味。
官方之前说2022后,彻底移除经典编辑器,到时如果没有替代品,对广大用户是一个灾难,对WordPress也会是一个极大的损失,会有人抛弃WordPress转投其它程序。
以上就是关于WordPress 5.5 回复按钮失效问题的详细内容,更多请悬镜司其它相关文章!
Best and news about drug. Some are medicines that help people when doctors prescribe.
lisinopril 40mg
Everything information about medication. Everything information about medication.
Drugs information sheet. Get here.
buy cheap nexium without a prescription
Medscape Drugs & Diseases. Read here.
Some are medicines that help people when doctors prescribe. Read information now.
ivermectin 8000
Some trends of drugs. Comprehensive side effect and adverse reaction information.
п»їMedicament prescribing information. Actual trends of drug.
buy liquid ivermectin
Drugs information sheet. Commonly Used Drugs Charts.
drug information and news for professionals and consumers. Definitive journal of drugs and therapeutics.
ivermectin oral solution
Medscape Drugs & Diseases. Top 100 Searched Drugs.
Prescription Drug Information, Interactions & Side. Drugs information sheet.
stromectol pills
Best and news about drug. Some trends of drugs.
Get warning information here. Generic Name.
stromectol 3 mg price
Commonly Used Drugs Charts. п»їMedicament prescribing information.
Definitive journal of drugs and therapeutics. Read information now.
ivermectin oral solution
Get warning information here. Read information now.
The safety and effectiveness of lithium has not been established in pediatric patients less than 7 years of age with bipolar I disorder best price cialis The thing that impressed me most was the way he handled the bullpen, Гў
Everything what you want to know about pills. Medscape Drugs & Diseases.
https://stromectolst.com/# ivermectin cream
Actual trends of drug. Get warning information here.
Get information now. Drug information.
ivermectin 4 tablets price
Everything what you want to know about pills. Definitive journal of drugs and therapeutics.
Get warning information here. Get information now.
stromectol generic name
Definitive journal of drugs and therapeutics. Some are medicines that help people when doctors prescribe.