List of Filters and Hooks in Init Review System

The Init Review System plugin provides several filters that allow developers to customize automatic insertion behavior, shortcode configuration, and schema structure. Below is the complete list of internal hooks defined by the plugin, along with detailed usage examples.

List of Filters and Hooks in Init Review System

1. init_plugin_suite_review_system_auto_insert_enabled_score

Enable or disable the automatic insertion of the score block at specific positions in the post content.

Parameters:

  • bool $enabled – Default is true
  • string $position – Position such as before, after
  • string $post_type – The current post type
// Disable auto-insert of score after post for 'product' post type
add_filter('init_plugin_suite_review_system_auto_insert_enabled_score', function($enabled, $position, $post_type) {
    if ($post_type === 'product' && $position === 'after') {
        return false;
    }
    return $enabled;
}, 10, 3);

2. init_plugin_suite_review_system_auto_insert_enabled_vote

Enable or disable the automatic insertion of the vote block before/after content or comment form.

Parameters: Same as above

// Prevent vote form from showing in comment section on 'page' post type
add_filter('init_plugin_suite_review_system_auto_insert_enabled_vote', function($enabled, $position, $post_type) {
    if ($post_type === 'page') return false;
    return $enabled;
}, 10, 3);

3. init_plugin_suite_review_system_default_score_shortcode

Customize the default shortcode for the score block when auto-insert is enabled.

Parameter: string $shortcode

// Add custom class when auto-inserting score
add_filter('init_plugin_suite_review_system_default_score_shortcode', function($shortcode) {
    return '[init_review_score icon="true" class="highlight-score"]';
});

4. init_plugin_suite_review_system_default_vote_shortcode

Customize the default shortcode for the vote block when auto-insert is enabled.

Parameter: string $shortcode

// Enable schema by default for the vote block
add_filter('init_plugin_suite_review_system_default_vote_shortcode', function($shortcode) {
    return '[init_review_system schema="true"]';
});

5. init_plugin_suite_review_system_schema_type

Adjust the schema.org type used in the vote block.

Parameters:

  • string $type – Default schema type
  • string $post_type – The current post type
// Change schema type to 'Movie' for movie posts
add_filter('init_plugin_suite_review_system_schema_type', function($type, $post_type) {
    return $post_type === 'movie' ? 'Movie' : $type;
}, 10, 2);

6. init_plugin_suite_review_system_schema_data

Customize the JSON-LD schema content for the vote block.

Parameters:

  • array $schema_data – The generated schema data
  • int $post_id – Post ID
  • string $schema_type – Schema type in use
// Add 'author' field to schema
add_filter('init_plugin_suite_review_system_schema_data', function($schema, $post_id, $type) {
    $schema['author'] = get_bloginfo('name');
    return $schema;
}, 10, 3);

Conclusion

The hook system of Init Review System is simple yet flexible enough to let you customize display logic, schema integration, and vote handling behavior as needed.

Comments


  • No comments yet.

Init Toolbox

Press Ctrl + \ on desktop, or swipe left anywhere on mobile.

Login