Server IP : 162.0.217.223 / Your IP : 216.73.216.150 Web Server : LiteSpeed System : Linux premium269.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : mypckeys ( 1539) PHP Version : 8.1.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/mypckeys/yeslicense.org/wp-content/plugins/yaymail/src/Integrations/ |
Upload File : |
<?php namespace YayMail\Integrations; use YayMail\PostTypes\TemplatePostType; use YayMail\Utils\SingletonTrait; /** * RankMath * * @method static RankMath get_instance() */ class RankMath { use SingletonTrait; protected function __construct() { if ( ! class_exists( 'RankMath' ) ) { return; } add_filter( 'rank_math/sitemap/exclude_post_type', function( $check, $post_type ) { if ( $post_type === TemplatePostType::POST_TYPE ) { return true; } return $check; }, 10, 2 ); // Trick to delete all the duplicate value in the previous version of the plugin add_action( 'init', [ $this, 'init' ], PHP_INT_MAX ); } public function init() { $titles_settings = get_option( 'rank-math-options-titles', [] ); if ( empty( $titles_settings ) ) { return; } $title_meta_key = 'pt_' . TemplatePostType::POST_TYPE . '_robots'; if ( empty( $titles_settings[ $title_meta_key ] ) ) { $titles_settings[ $title_meta_key ] = []; } $titles_settings[ $title_meta_key ] = array_unique( $titles_settings[ $title_meta_key ] ); update_option( 'rank-math-options-titles', $titles_settings ); } }