seo.php
Stores portable search and sharing metadata with draft and revision support, resolves public fallbacks, and integrates recognized SEO plugins through their filters.
Responsibility#
Stores portable search and sharing metadata with draft and revision support, resolves public fallbacks, and integrates recognized SEO plugins through their filters.
This is an implementation reference for the released 0.9.13 module. Internal PHP helpers are not a compatibility promise for third-party callers. Prefer the documented REST, Abilities, theme, and filter contracts.
Related modules#
Module constants#
const CANTATA_EDIT_SEO = '_cantata_edit_seo';
const CANTATA_EDIT_DRAFT_SEO = '_cantata_edit_draft_seo';
These values describe this release. Defined configuration constants and generated identifiers can have different ownership; do not edit stored values directly without following the corresponding workflow.
WordPress hooks#
| Operation | Hook |
|---|---|
add_action |
init |
add_action |
transition_post_status |
add_filter |
wpseo_title |
add_filter |
rank_math/frontend/title |
add_filter |
aioseo_title |
add_filter |
wpseo_opengraph_title |
add_filter |
wpseo_twitter_title |
add_filter |
rank_math/opengraph/facebook/og_title |
add_filter |
rank_math/opengraph/twitter/twitter_title |
add_filter |
wpseo_metadesc |
add_filter |
rank_math/frontend/description |
add_filter |
aioseo_description |
add_filter |
wpseo_opengraph_desc |
add_filter |
wpseo_twitter_description |
add_filter |
rank_math/opengraph/facebook/og_description |
add_filter |
rank_math/opengraph/twitter/twitter_description |
add_filter |
wpseo_opengraph_image |
add_filter |
wpseo_twitter_image |
add_filter |
rank_math/opengraph/facebook/image |
add_filter |
rank_math/opengraph/twitter/image |
add_filter |
wpseo_opengraph_image_width |
add_filter |
rank_math/opengraph/facebook/og_image_width |
add_filter |
wpseo_opengraph_image_height |
add_filter |
rank_math/opengraph/facebook/og_image_height |
add_filter |
wpseo_opengraph_image_type |
add_filter |
rank_math/opengraph/facebook/og_image_type |
add_filter |
rank_math/opengraph/facebook/og_image_alt |
add_filter |
rank_math/opengraph/twitter/twitter_image_alt |
add_filter |
aioseo_facebook_tags |
add_filter |
aioseo_twitter_tags |
add_filter |
pre_get_document_title |
add_filter |
wp_robots |
add_filter |
rank_math/frontend/robots |
add_filter |
wpseo_robots |
add_filter |
aioseo_robots_meta |
add_action |
wp_head |
apply_filters |
cantata_edit_schema_graph |
add_action and add_filter subscribe to a hook; do_action and apply_filters expose a hook. A subscription is not itself a new extension API. Dynamic hook names are not included in this literal inventory.
Function and method reference#
cantata_edit_sanitize_seo#
function cantata_edit_sanitize_seo( $value ): array
The deliberately small, portable schema accepted from the editor.
Source location: includes/seo.php:22.
cantata_edit_seo_live#
function cantata_edit_seo_live( int $post_id ): array
Internal implementation helper in this module. Its name and signature identify the operation and accepted PHP values; it is not a standalone authenticated endpoint.
Implementation connections: cantata_edit_sanitize_seo.
Source location: includes/seo.php:38.
cantata_edit_seo_values#
function cantata_edit_seo_values( int $post_id, bool $editing = false ): array
While editing, a saved SEO draft wins; visitors always receive the published values.
Implementation connections: cantata_edit_sanitize_seo, cantata_edit_seo_live.
Source location: includes/seo.php:43.
cantata_edit_seo_is_custom#
function cantata_edit_seo_is_custom( array $seo ): bool
Internal implementation helper in this module. Its name and signature identify the operation and accepted PHP values; it is not a standalone authenticated endpoint.
Source location: includes/seo.php:51.
cantata_edit_save_seo#
function cantata_edit_save_seo( int $post_id, $value, bool $publish ): void
Save an unpublished metadata draft, or promote it alongside the page.
Implementation connections: cantata_edit_sanitize_seo, cantata_edit_seo_is_custom, cantata_edit_seo_live.
Source location: includes/seo.php:56.
cantata_edit_seo_plugin#
function cantata_edit_seo_plugin(): string
Internal implementation helper in this module. Its name and signature identify the operation and accepted PHP values; it is not a standalone authenticated endpoint.
Source location: includes/seo.php:77.
cantata_edit_seo_context#
function cantata_edit_seo_context(): ?array
Internal implementation helper in this module. Its name and signature identify the operation and accepted PHP values; it is not a standalone authenticated endpoint.
Implementation connections: cantata_edit_is_built, cantata_edit_seo_values.
Source location: includes/seo.php:84.
cantata_edit_filter_seo_title#
function cantata_edit_filter_seo_title( $title )
Internal implementation helper in this module. Its name and signature identify the operation and accepted PHP values; it is not a standalone authenticated endpoint.
Implementation connections: cantata_edit_seo_context.
Source location: includes/seo.php:110.
cantata_edit_filter_seo_description#
function cantata_edit_filter_seo_description( $description )
Internal implementation helper in this module. Its name and signature identify the operation and accepted PHP values; it is not a standalone authenticated endpoint.
Implementation connections: cantata_edit_seo_context.
Source location: includes/seo.php:122.
cantata_edit_filter_seo_image#
function cantata_edit_filter_seo_image( $image )
Internal implementation helper in this module. Its name and signature identify the operation and accepted PHP values; it is not a standalone authenticated endpoint.
Implementation connections: cantata_edit_seo_context.
Source location: includes/seo.php:131.
cantata_edit_filter_seo_image_width#
function cantata_edit_filter_seo_image_width( $width )
Internal implementation helper in this module. Its name and signature identify the operation and accepted PHP values; it is not a standalone authenticated endpoint.
Implementation connections: cantata_edit_seo_context.
Source location: includes/seo.php:138.
cantata_edit_filter_seo_image_height#
function cantata_edit_filter_seo_image_height( $height )
Internal implementation helper in this module. Its name and signature identify the operation and accepted PHP values; it is not a standalone authenticated endpoint.
Implementation connections: cantata_edit_seo_context.
Source location: includes/seo.php:144.
cantata_edit_filter_seo_image_type#
function cantata_edit_filter_seo_image_type( $type )
Internal implementation helper in this module. Its name and signature identify the operation and accepted PHP values; it is not a standalone authenticated endpoint.
Implementation connections: cantata_edit_seo_context.
Source location: includes/seo.php:150.
cantata_edit_filter_seo_image_alt#
function cantata_edit_filter_seo_image_alt( $alt )
Internal implementation helper in this module. Its name and signature identify the operation and accepted PHP values; it is not a standalone authenticated endpoint.
Implementation connections: cantata_edit_seo_context, cantata_edit_seo_plugin.
Source location: includes/seo.php:156.