jetpack_comment_form_enabled_for
Filters the setting that determines if Jetpagk comments should be enabled for the current post type.
Description
Parameters (1)
- 0. $true (bool)
- Should comments be enabled?
Usage
- To run the hook, copy the example below.
- $true = apply_filters( 'jetpack_comment_form_enabled_for', $true );
- if ( !empty( $true ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the jetpack_comment_form_enabled_for callback
- function filter_jetpack_comment_form_enabled_for( $true ) {
- // make filter magic happen here...
- return $true;
- };
- // add the filter
- add_filter( 'jetpack_comment_form_enabled_for', 'filter_jetpack_comment_form_enabled_for', 10, 1 );
- To remove a hook callback, use the example below.
- // remove the filter
- remove_filter( 'jetpack_comment_form_enabled_for', 'filter_jetpack_comment_form_enabled_for', 10, 1 );
Defined (2)
The filter is defined in the following location(s).
- /modules/comments/comments.php
- if ( ! apply_filters( 'jetpack_comment_form_enabled_for_' . get_post_type(), true ) ) {
- if ( ! apply_filters( 'jetpack_comment_form_enabled_for_' . get_post_type(), true ) ) {