Wednesday, July 3, 2024
HomeWordPress Developmentfeedback - comment_approved customized worth

feedback – comment_approved customized worth


I wish to modify feedback with a further ‘comment_approved’ worth. This worth will probably be used elsewhere in a plugin that makes use of wp_list_comments.

Wanting on the wp_set_comment_status perform, I see this code (at about line 2371 in remark.php):

perform wp_set_comment_status( $comment_id, $comment_status, $wp_error = false ) {
    international $wpdb;

    change ( $comment_status ) {
        case 'maintain':
        case '0':
            $standing="0";
            break;
        case 'approve':
        case '1':
            $standing="1";
            add_action( 'wp_set_comment_status', 'wp_new_comment_notify_postauthor' );
            break;
        case 'spam':
            $standing="spam";
            break;
        case 'trash':
            $standing="trash";
            break;
        default:
            return false;
    }

I do not see a filter I can use to permit for an additional worth (say “nodisplay” or “42”) that may permit wp_set_comment_status to retailer my customized worth.

Is there a method to retailer a customized worth within the comment_approved subject of the feedback desk?

The intent is to permit a plugin ajax name to set a remark to a standing of ’42’ or ‘nodisplay’. The plugin will even search for that worth and take away that remark from the wp_list_comments course of. (So a filter can also be wanted to intercept the output of wp_list_comments to take away that ’42’ remark from the displayed listing.)

I notice this query has an identical intent, however it’s from 2013, so maybe there’s a means now in 2022?

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments