search
HomeCMS TutorialWordPressRegarding the problem of invalid reply button in WordPress 5.5

The following column WordPress Tutorial will introduce to you the solution to the invalid reply button in WordPress 5.5. I hope it will be helpful to friends in need!

Regarding the problem of invalid reply button in WordPress 5.5

Some children found that the reply button failed after upgrading to WordPress 5.5. This happened in WordPress 5.1. Most of the problems occurred in themes that customized comment functions or used Ajax comments. middle.

The symptoms are: clicking the reply button refreshes the page, and the comment form cannot be nested.

The cause of the problem is that the WordPress developer modified the comment core file. After testing, it seems that the comment-reply.js file in the wp-includes\js directory was modified. After replacing it with the file of version 5.4.2, the problem disappeared.

The same problem appeared twice. I was a little too careless about thousands of theme users. There was no clear documentation and I just messed with the block editor....

Solution, You can try adding the following code to theme 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( &#39;<a rel="nofollow" class="comment-reply-login" href="%s">%s</a>&#39;,
esc_url( wp_login_url( get_permalink() ) ),
$args[&#39;login_text&#39;]
);
} else {
$onclick = sprintf( &#39;return addComment.moveForm( "%1$s-%2$s", "%2$s", "%3$s", "%4$s" )&#39;,
$args[&#39;add_below&#39;], $comment->comment_ID, $args[&#39;respond_id&#39;], $post->ID
);
 
$link = sprintf( "<span class=&#39;comment-reply-link&#39; data-href=&#39;%s&#39; onclick=&#39;%s&#39; aria-label=&#39;%s&#39;>%s</span>",
esc_url( add_query_arg( &#39;replytocom&#39;, $comment->comment_ID, get_permalink( $post->ID ) ) ) . "#" . $args[&#39;respond_id&#39;],
$onclick,
esc_attr( sprintf( $args[&#39;reply_to_text&#39;], $comment->comment_author ) ),
$args[&#39;reply_text&#39;]
);
}
return $link;
 
}

This method was previously used in WP5.1 and is also applicable to W5.5. You can appropriately modify the classes to adapt to your own theme structure.

The code that comes with the program is located in comment-template.php in the wp-includes directory, about line 1817

Code source: https://wp-kama.ru/function/get_comment_reply_link

In addition, there are many incompatibility issues between WordPress 5.5 and themes and plug-ins, which appear endlessly on the official website.

Because there is no security update for WordPress 5.5, and there is no Chinese version. Using the previous language files, there are a lot of foreign characters in the background. I have not upgraded myself at the moment. I estimate that the Chinese version will be far away this time. .

The focus of the WordPress 5.5 update is just to toss the block editor. It is a thankless effort to develop new block editor features despite the opposition of most people. If developers read the "Classic Editor" "Server" switch plug-in, 5 million downloads and installations, I don’t know what it will be like.

The official said that the classic editor will be completely removed after 2022. If there is no replacement by then, it will be a disaster for the majority of users and a great loss for WordPress. Some people will abandon WordPress and switch to other places. program.

The above is the detailed content of Regarding the problem of invalid reply button in WordPress 5.5. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:zmingcx. If there is any infringement, please contact admin@php.cn delete
Is WordPress good for creating a portfolio website?Is WordPress good for creating a portfolio website?Apr 26, 2025 am 12:05 AM

Yes,WordPressisexcellentforcreatingaportfoliowebsite.1)Itoffersnumerousportfolio-specificthemeslike'Astra'foreasycustomization.2)Pluginssuchas'Elementor'enableintuitivedesign,thoughtoomanycanslowthesite.3)SEOisenhancedwithtoolslike'YoastSEO',boosting

What are the advantages of using WordPress over coding a website from scratch?What are the advantages of using WordPress over coding a website from scratch?Apr 25, 2025 am 12:16 AM

WordPressisadvantageousovercodingawebsitefromscratchdueto:1)easeofuseandfasterdevelopment,2)flexibilityandscalability,3)strongcommunitysupport,4)built-inSEOandmarketingtools,5)cost-effectiveness,and6)regularsecurityupdates.Thesefeaturesallowforquicke

What makes WordPress a Content Management System?What makes WordPress a Content Management System?Apr 24, 2025 pm 05:25 PM

WordPressisaCMSduetoitseaseofuse,customization,usermanagement,SEO,andcommunitysupport.1)Itsimplifiescontentmanagementwithanintuitiveinterface.2)Offersextensivecustomizationthroughthemesandplugins.3)Providesrobustuserrolesandpermissions.4)EnhancesSEOa

How to add a comment box to WordPressHow to add a comment box to WordPressApr 20, 2025 pm 12:15 PM

Enable comments on your WordPress website to provide visitors with a platform to participate in discussions and share feedback. To do this, follow these steps: Enable Comments: In the dashboard, navigate to Settings > Discussions, and select the Allow Comments check box. Create a comment form: In the editor, click Add Block and search for the Comments block to add it to the content. Custom Comment Form: Customize comment blocks by setting titles, labels, placeholders, and button text. Save changes: Click Update to save the comment box and add it to the page or article.

How to copy sub-sites from wordpressHow to copy sub-sites from wordpressApr 20, 2025 pm 12:12 PM

How to copy WordPress subsites? Steps: Create a sub-site in the main site. Cloning the sub-site in the main site. Import the clone into the target location. Update the domain name (optional). Separate plugins and themes.

How to write a header of a wordpressHow to write a header of a wordpressApr 20, 2025 pm 12:09 PM

The steps to create a custom header in WordPress are as follows: Edit the theme file "header.php". Add your website name and description. Create a navigation menu. Add a search bar. Save changes and view your custom header.

How to display wordpress commentsHow to display wordpress commentsApr 20, 2025 pm 12:06 PM

Enable comments in WordPress website: 1. Log in to the admin panel, go to "Settings" - "Discussions", and check "Allow comments"; 2. Select a location to display comments; 3. Customize comments; 4. Manage comments, approve, reject or delete; 5. Use <?php comments_template(); ?> tags to display comments; 6. Enable nested comments; 7. Adjust comment shape; 8. Use plugins and verification codes to prevent spam comments; 9. Encourage users to use Gravatar avatar; 10. Create comments to refer to

How to upload source code for wordpressHow to upload source code for wordpressApr 20, 2025 pm 12:03 PM

You can install the FTP plug-in through WordPress, configure the FTP connection, and then upload the source code using the file manager. The steps include: installing the FTP plug-in, configuring the connection, browsing the upload location, uploading files, and checking that the upload is successful.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.