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 | |
/** | |
* Copyright (c) 2025 Sybre Waaijer, CyberWire B.V. | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights | |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
* copies of the Software, and to permit persons to whom the Software is |
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 | |
// Do not include the opening PHP tag if PHP is already opened. | |
\add_filter( | |
'the_seo_framework_query_supports_seo', | |
/** | |
* Disables SEO support for page ID 12. | |
* |
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 | |
// Do not open PHP if PHP is already opened. | |
add_filter( | |
'the_seo_framework_enable_noindex_no_posts', | |
function ( $noindex ) { | |
if ( is_category() ) { | |
// To allow indexing, so set noindex to 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 | |
// Do not include the PHP opening tag if PHP is already open. | |
// Per email Wojciech. | |
add_filter( 'the_seo_framework_description_excerpt', 'my_tsf_acf_custom_excerpt', 10, 3 ); | |
/** | |
* Use ACF HTML fields as meta description for specific CPTs. | |
* | |
* @param string $excerpt The auto‐generated excerpt. |
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
/** | |
* Sorts an array of version objects based on their semantic version numbers, | |
* including pre-release versions. | |
* | |
* This function parses each version string using a regular expression to | |
* extract its numeric, pre-release, and build components and then compares | |
* them to order the array. | |
* | |
* It supports complex versions such as (in order) "1.4.9", "1.5.0-alpha", | |
* "1.5.0-alpha2", and "1.5.0", ensuring that pre-release versions are sorted |
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 | |
// Do not include the PHP opening tag if PHP is already open | |
// Per email exchange with Renan. | |
add_filter( | |
'the_seo_framework_articles_data', | |
function ( $data ) { | |
if ( in_array( get_post_type(), [ 'post', 'web-story', 'gira' ], 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 | |
// Do not include the PHP opening tag if PHP is already open | |
// Per https://wordpress.org/support/topic/term_title-in-custom-taxonomies-archive-titles/ | |
add_filter( | |
'the_seo_framework_generated_archive_title_items', | |
/** | |
* Filters the generated archive title items. | |
* |
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 | |
// Do not include the PHP opening tag if PHP is already opened. | |
add_filter( | |
'the_seo_framework_meta_generator_pools', | |
function ( $generator_pools ) { | |
if ( 'listings' === tsf()->query()->get_post_type_real_id() ) | |
return array_diff( $generator_pools, [ 'Schema' ] ); |
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 | |
// Don't include the PHP opening tag if PHP is already open. | |
add_filter( 'the_seo_framework_get_excerpt', 'my_tsf_acf_excerpt', 10, 2 ); | |
/** | |
* @param string $excerpt The obtained excerpt. | |
* @param array|null $args The query arguments. Contains 'id', 'tax', 'pta', and 'uid'. | |
* Is null when the query is auto-determined. | |
* @return string The overwritten 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 | |
// Do not include the PHP opening tag if PHP is already opened. | |
add_filter( | |
'the_seo_framework_title_from_generation', | |
function ( $title, $args ) { | |
$is_product = false; |
NewerOlder