PATH:
var
/
www
/
clients
/
client1
/
web1
/
web
/
wp-content
/
plugins
/
wordpress-seo
/
src
/
conditionals
<?php namespace Yoast\WP\SEO\Conditionals; use Yoast\WP\SEO\Conditionals\Admin\Post_Conditional; use Yoast\WP\SEO\Helpers\Current_Page_Helper; use Yoast\WP\SEO\Helpers\Product_Helper; /** * Conditional that is met when the AI editor integration should be active. */ class AI_Editor_Conditional implements Conditional { /** * Holds the Post_Conditional. * * @var Post_Conditional */ private $post_conditional; /** * Holds the Current_Page_Helper. * * @var Current_Page_Helper */ private $current_page_helper; /** * Holds the Product_Helper. * * @var Product_Helper */ private $product_helper; /** * Constructs Ai_Editor_Conditional. * * @param Post_Conditional $post_conditional The Post_Conditional. * @param Current_Page_Helper $current_page_helper The Current_Page_Helper. * @param Product_Helper $product_helper The Product_Helper. */ public function __construct( Post_Conditional $post_conditional, Current_Page_Helper $current_page_helper, Product_Helper $product_helper ) { $this->post_conditional = $post_conditional; $this->current_page_helper = $current_page_helper; $this->product_helper = $product_helper; } /** * Returns `true` when the AI editor integration should be active. * * @return bool `true` when the AI editor integration should be active. */ public function is_met() { if ( $this->is_attachment() ) { return false; } if ( $this->is_ai_generator_premium() ) { return false; } return $this->post_conditional->is_met() || $this->is_term() || $this->is_elementor_editor(); } /** * Returns `true` when the page is a term page. * * @return bool `true` when the page is a term page. */ private function is_term() { return $this->current_page_helper->get_current_admin_page() === 'term.php'; } /** * Returns `true` when the page is the Elementor editor. * * @return bool `true` when the page is the Elementor editor. */ private function is_elementor_editor() { if ( $this->current_page_helper->get_current_admin_page() !== 'post.php' ) { return false; } // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Reason: We are not processing form information. if ( isset( $_GET['action'] ) && \is_string( $_GET['action'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Reason: We are not processing form information, We are only strictly comparing. if ( \wp_unslash( $_GET['action'] ) === 'elementor' ) { return true; } } return false; } /** * Is an attchment post type. * * @return bool */ public function is_attachment() { return $this->current_page_helper->get_current_post_type() === 'attachment'; } /** * Is premium version containes AI generator. We exclude product post type because it is not supported in premium version before 25.6. * * @return bool */ public function is_ai_generator_premium() { if ( ! $this->product_helper->is_premium() ) { return false; } $premium_version = $this->product_helper->get_premium_version(); return \version_compare( $premium_version, '25.6-RC0', '<' ) && $this->current_page_helper->get_current_post_type() !== 'product'; } }
[-] wincher-token-conditional.php
[edit]
[-] wp-robots-conditional.php
[edit]
[-] conditional-interface.php
[edit]
[-] not-admin-ajax-conditional.php
[edit]
[-] check-required-version-conditional.php
[edit]
[-] semrush-enabled-conditional.php
[edit]
[-] feature-flag-conditional.php
[edit]
[-] text-formality-conditional.php
[edit]
[-] user-profile-conditional.php
[edit]
[-] non-multisite-conditional.php
[edit]
[-] front-end-conditional.php
[edit]
[-] settings-conditional.php
[edit]
[-] user-can-manage-wpseo-options-conditional.php
[edit]
[-] primary-category-conditional.php
[edit]
[-] wp-tests-conditional.php
[edit]
[-] user-can-edit-users-conditional.php
[edit]
[-] wincher-conditional.php
[edit]
[-] user-can-publish-posts-and-pages-conditional.php
[edit]
[-] updated-importer-framework-conditional.php
[edit]
[-] premium-active-conditional.php
[edit]
[+]
admin
[-] yoast-admin-and-dashboard-conditional.php
[edit]
[-] get-request-conditional.php
[edit]
[-] import-tool-selected-conditional.php
[edit]
[-] premium-inactive-conditional.php
[edit]
[-] headless-rest-endpoints-enabled-conditional.php
[edit]
[-] attachment-redirections-enabled-conditional.php
[edit]
[-] development-conditional.php
[edit]
[-] woocommerce-conditional.php
[edit]
[-] wp-cron-enabled-conditional.php
[edit]
[-] web-stories-conditional.php
[edit]
[-] jetpack-conditional.php
[edit]
[-] deactivating-yoast-seo-conditional.php
[edit]
[-] user-edit-conditional.php
[edit]
[+]
third-party
[-] ai-conditional.php
[edit]
[-] schema-disabled-conditional.php
[edit]
[-] robots-txt-conditional.php
[edit]
[+]
traits
[-] ai-editor-conditional.php
[edit]
[-] no-tool-selected-conditional.php
[edit]
[-] admin-conditional.php
[edit]
[+]
..
[-] migrations-conditional.php
[edit]
[-] yoast-tools-page-conditional.php
[edit]
[-] xmlrpc-conditional.php
[edit]
[-] wincher-automatically-track-conditional.php
[edit]
[-] new-settings-ui-conditional.php
[edit]
[-] open-graph-conditional.php
[edit]
[-] should-index-links-conditional.php
[edit]
[-] addon-installation-conditional.php
[edit]
[-] no-conditionals-trait.php
[edit]
[-] news-conditional.php
[edit]
[-] wincher-enabled-conditional.php
[edit]
[-] task-list-enabled-conditional.php
[edit]