Docs / More

For developers

Content Polisher is built to be extended. Pro itself uses these hooks.

Rules

content_polisher_rules — add a rule. Implement ContentPolisher\Rules\RuleInterface, or extend AbstractTextRule to work on plain text with markup already masked.

add_filter( 'content_polisher_rules', function ( array $rules ) {
	$rules[] = new My_Plugin\Rules\NoExclamationsRule();
	return $rules;
} );

Content sources

content_polisher_content_sources — check more text than the post content, such as custom fields. Implement ContentPolisher\Sources\ContentSourceInterface, or SiteContentSourceInterface for text that belongs to no post. Each piece of text is fixed, recorded and undone on its own.

content_polisher_site_capability — capability needed to fix site-wide text (default manage_options).

Proofreading engines

content_polisher_proofreader — provide a ContentPolisher\Proofreader\ProofreaderInterface. Its suggestions appear as review-only issues.

Features

content_polisher_available_features, content_polisher_feature_enabled — features provided by add-ons (ContentPolisher\Features\FeatureManager).

content_polisher_loaded (action) — Content Polisher is booted; add-ons register their hooks here.

Admin screens

content_polisher_categories, content_polisher_dashboard_config, content_polisher_settings_sections, content_polisher_dashboard_toolbar, content_polisher_history_actions, content_polisher_enqueue_assets.

What may be edited

content_polisher_editable_blocks, content_polisher_protected_blocks, content_polisher_protected_shortcodes, content_polisher_exclude_page_builders, content_polisher_page_builder_meta.

Scope and access

  • content_polisher_capability — capability to use the plugin (default edit_others_posts).
  • content_polisher_post_types, content_polisher_post_statuses — what is scanned.
  • content_polisher_post_language — override the language of a post.
  • content_polisher_scan_limit — cap the number of posts per scan.
  • content_polisher_upgrade_url — where upgrade links point.

Found a hook missing for your use case? Tell us.