This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Hide the dropdown everywhere. | |
| add_filter( 'seopress_primary_term_inline_selector', '__return_false' ); | |
| // Hide it in the Categories box only. | |
| add_filter( 'seopress_primary_term_inline_selector', 'sp_hide_primary_category_dropdown', 10, 3 ); | |
| function sp_hide_primary_category_dropdown( $enabled, $taxonomy, $post_type ) { | |
| if ( 'category' === $taxonomy ) { | |
| return false; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Meta keys read in addition to post_content (default: the ACF fields of the post). | |
| function sp_significant_kw_custom_fields( $keys, $post ) { | |
| $keys[] = 'my_builder_text'; | |
| return $keys; | |
| } | |
| add_filter( 'seopress_pro_significant_kw_custom_fields', 'sp_significant_kw_custom_fields', 10, 2 ); | |
| // ACF field types considered page text (default: text, textarea, wysiwyg). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Caption (saved as post excerpt), already sanitized with sanitize_text_field(). | |
| function sp_update_caption( $caption, $post_id ) { | |
| return $caption; | |
| } | |
| add_filter( 'seopress_update_caption', 'sp_update_caption', 10, 2 ); | |
| // Description (saved as post content), already sanitized with wp_kses_post(). | |
| function sp_update_description( $description, $post_id ) { | |
| return $description; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function sp_update_alt( $alt_text, $post_id ) { | |
| return trim( $alt_text, ". \t\n" ); | |
| } | |
| add_filter( 'seopress_update_alt', 'sp_update_alt', 10, 2 ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Remove a post type from llms.txt. | |
| * | |
| * By default: public post types except attachment, seopress_404, seopress_schemas, seopress_bot. | |
| * | |
| * @param string[] $types Post type names. | |
| * | |
| * @return string[] | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Replace {provider} in the hook name, e.g. seopress_ai_openai_image_meta. | |
| function sp_ai_image_meta_prompt( $prompt, $post_id ) { | |
| // $prompt lists the requested fields (alt_text, caption, description). | |
| return $prompt . "\nMention the brand name when relevant."; | |
| } | |
| add_filter( 'seopress_ai_openai_image_meta', 'sp_ai_image_meta_prompt', 10, 2 ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Replace {provider} in the hook name, e.g. seopress_ai_openai_custom_instructions. | |
| function sp_ai_custom_instructions( $instructions, $post_id ) { | |
| // $instructions: the site-wide custom instructions from the settings. | |
| // $post_id: 0 for taxonomy terms. | |
| return $instructions . ' Always write in a friendly tone.'; | |
| } | |
| add_filter( 'seopress_ai_openai_custom_instructions', 'sp_ai_custom_instructions', 10, 2 ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Decide whether blocks and shortcodes are rendered before extraction. | |
| function sp_significant_kw_render_content( $should_render, $post ) { | |
| return $should_render; | |
| } | |
| add_filter( 'seopress_pro_significant_kw_render_content', 'sp_significant_kw_render_content', 10, 2 ); | |
| // Provide the text yourself, e.g. for a builder that renders outside WordPress. | |
| function sp_significant_kw_content( $content, $post, $raw ) { | |
| $builder_text = get_post_meta( $post->ID, 'my_builder_text', true ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Append a line to the generated llms.txt file. | |
| * | |
| * @param string $content The final llms.txt content. | |
| * | |
| * @return string | |
| */ | |
| function sp_llms_txt_file( $content ) { | |
| return $content . "\n> Contact: https://example.com/contact/\n"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Filter the MerchantReturnPolicy schema built from the WooCommerce return policy settings. | |
| * | |
| * @param array $policy The policy schema (@type, applicableCountry, returnPolicyCategory...). | |
| * @param array $options The seopress_pro_option_name option. | |
| * | |
| * @return array | |
| */ | |
| function sp_merchant_return_policy( $policy, $options ) { |
NewerOlder