Skip to content

Technical reference — Hooks and Filters

Primary Source exposes the following hooks for developers. List derived from the source code.

Hook Type Purpose
primary_source_ai_post_types filter Add custom post types to the AI scan
primary_source_sslverify filter Controls SSL verification in external requests
robots_txt filter Integrates the AI sitemap and directives into robots.txt
the_content filter Enriches content with semantic metadata
wpml_active_languages filter WPML compatibility (active languages)
wpml_object_id filter WPML compatibility (translated object IDs)
wpml_switch_language action WPML compatibility (language switch)

Extension

To include your CPTs in the AI scan:

add_filter('primary_source_ai_post_types', function ($types) {
    $types[] = 'my_cpt';
    return $types;
});

Back to overview | API