Saturday, November 23, 2024
HomeWordPress Developmentfeedback - Simply invalidate type in comment_post hook

feedback – Simply invalidate type in comment_post hook


$GLOBALS['test'] = 'a';

perform comment_post_check($comment_ID, $comment_approved, $commentdata) 
{    
    $GLOBALS['test'] = 'b';        
}

add_action('comment_post', 'comment_post_check', 10, 3);

However my in my single.php, echo $GLOBALS['test']; at all times returns a even after remark put up.

I assume that this due to a POST redirect and doubtless have to retailer in periods solely ?
Is there no simpler approach to set a new WP_Error and get that proven as an error by the default WordPress prefer it does in Duplicate remark detected; it appears to be like as if you’ve already stated that! ?

I assumed I might set some pre-defined WP error variables and it will viola present the error UI magically.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments