// and its setup routine calls remove_all_filters('wp_title'). Register our title override
// on the 'wp' hook so it is added after the theme has finished removing filters.
add_action( 'wp', [ __CLASS__, 'register_title_override' ], 1 );
// Meta / OG / Twitter output.
add_action( 'wp_head', [ __CLASS__, 'output_head_tags' ], 1 );
// Optional Yoast suppression.
add_action( 'wp_loaded', [ __CLASS__, 'maybe_disable_yoast' ], 20 );
}
/**
* Register title override after the theme has finished setup.
*
* The Newspaper theme calls remove_all_filters('wp_title') and hardcodes
*
in its header template, so regular
* title filters do not work. We use output buffering to replace the final
* ... tag with our generated title.
*
* @return void
*/
public static function register_title_override() {
error_log( 'LosB SEO: register_title_override called' );
ob_start( [ __CLASS__, 'replace_title_tag' ] );
}
/**
* Register the SEO meta box for posts and pages.
*/
public static function register_meta_box() {
add_meta_box(
'losb_seo_meta_box',
__( 'AI SEO Hub - SEO', 'losbastardos-ai-seo-hub' ),
[ __CLASS__, 'render_meta_box' ],
[ 'post', 'page' ],
'normal',
'high'
);
}
/**
* Render the SEO meta box.
*
* @param \WP_Post $post The current post object.
*/
public static function render_meta_box( $post ) {
wp_nonce_field( 'losb_seo_meta_save', 'losb_seo_meta_nonce' );
$title = get_post_meta( $post->ID, self::TITLE_KEY, true );
$description = get_post_meta( $post->ID, self::DESCRIPTION_KEY, true );
$keyword = get_post_meta( $post->ID, self::KEYWORD_KEY, true );
?>
Zelený, banderovský skorumpovanecNelegitímny I. cocaínsky prišiel zatancovať do … | Denník N - Nezávislý denník