WordPress filter hook · part of WordPress core
get_comment_type
A WordPress core filter that 7 plugins also fire themselves, running on 70+ sites between them.
How to use get_comment_type
It's a filter: your callback receives the value, and must return the (changed) value.
Add this to your theme's functions.php or a small custom plugin:
add_filter( 'get_comment_type', function( $comment_type ) {
// Change $comment_type here.
return $comment_type;
}, 10, 1 );Argument names come from Reactor: Core's source. Other plugins may pass different values: check the call in the plugin you're targeting below.
This hook is fired by WordPress core too. Official reference on developer.wordpress.org →
7 plugins that fire get_comment_type
Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.
-
Reactor: Core30+ installs
apply_filters( 'get_comment_type', $comment->comment_type )json-rest-api/lib/class-wp-json-comments.php:156 -
PZZ API Client20+ installs
apply_filters( 'get_comment_type', $comment->comment_type )includes/lib/class-pzz-json-comments.php:89 -
WP-BigApp10+ installs
apply_filters( 'get_comment_type', $comment->comment_type )lib/json/class-wp-json-comments.php:230 -
prograpper10+ installs
apply_filters( 'get_comment_type', $comment->comment_type )wp-api/lib/class-wp-json-comments.php:156 -
WpApperFewer than 10 installs
apply_filters( 'get_comment_type', $comment->comment_type )lib/json/class-wp-json-comments.php:230 -
WP-RestifyFewer than 10 installs
apply_filters( 'get_comment_type', $comment->comment_type )include/class-wp-json-comments.php:156 -
WP eCommerce BetaoutFewer than 10 installs
apply_filters( 'get_comment_type', $comment->comment_type )lib/class-wp-json-wpecproduct.php:1451
Need a customisation built on this hook?
Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.