wpseo_site_representation_ability_fields
Filter: wpseo_site_representation_ability_fields Allows adding site representation settings that the site representation abilities can write.
Each field is keyed by its option name and maps to the JSON schema of its value. The option has to be a Yoast SEO option, as the value is saved through the options helper, so it is sanitized like it is when saved from the settings page.
Validation beyond the schema goes in an optional 'validate_callback' key next to the schema. It receives the value and the option name, and returns a warning to skip saving the field or null to save it. The warning is relayed to the user, so it should explain why the value was not saved. A field whose 'validate_callback' is not callable is dropped, so it is never saved unvalidated. The fields of Yoast SEO come with their own 'validate_callback', which must be kept.
Organization social profiles are validated by the validator they are registered with through the wpseo_organization_social_profile_fields instead.
Использование
add_filter( 'wpseo_site_representation_ability_fields', 'wp_kama_wpseo_site_representation_ability_fields_filter' ); /** * Function for `wpseo_site_representation_ability_fields` filter-hook. * * @param array> $fields The JSON schema of each * field, keyed by option name. * * @return array
- $default_fields(array<string,)
- array<string, mixed>> $fields The JSON schema of each field, keyed by option name.
Где вызывается хук
wpseo_site_representation_ability_fieldsyoast/src/abilities/infrastructure/site-representation-field-map.php 115$fields = \apply_filters( 'wpseo_site_representation_ability_fields', $default_fields );Где используется хук в Yoast SEO
Использование не найдено.