Submit
Path:
~
/
home
/
getwphos
/
public_html
/
brueggemann
/
wp-content
/
plugins
/
wordpress-seo
/
src
/
conditionals
/
File Content:
ai-editor-conditional.php
<?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'; } }
Edit
Rename
Chmod
Delete
FILE
FOLDER
Name
Size
Permission
Action
admin
---
0755
third-party
---
0755
traits
---
0755
addon-installation-conditional.php
438 bytes
0644
admin-conditional.php
331 bytes
0644
ai-conditional.php
658 bytes
0644
ai-editor-conditional.php
3288 bytes
0644
attachment-redirections-enabled-conditional.php
901 bytes
0644
check-required-version-conditional.php
376 bytes
0644
conditional-interface.php
298 bytes
0644
deactivating-yoast-seo-conditional.php
706 bytes
0644
development-conditional.php
385 bytes
0644
dynamic-product-permalinks-conditional.php
469 bytes
0644
feature-flag-conditional.php
911 bytes
0644
front-end-conditional.php
330 bytes
0644
get-request-conditional.php
466 bytes
0644
headless-rest-endpoints-enabled-conditional.php
815 bytes
0644
import-tool-selected-conditional.php
552 bytes
0644
jetpack-conditional.php
415 bytes
0644
migrations-conditional.php
815 bytes
0644
new-settings-ui-conditional.php
355 bytes
0644
news-conditional.php
360 bytes
0644
no-conditionals-trait.php
381 bytes
0644
no-tool-selected-conditional.php
509 bytes
0644
non-multisite-conditional.php
372 bytes
0644
not-admin-ajax-conditional.php
366 bytes
0644
open-graph-conditional.php
728 bytes
0644
premium-active-conditional.php
358 bytes
0644
premium-inactive-conditional.php
393 bytes
0644
primary-category-conditional.php
1708 bytes
0644
robots-txt-conditional.php
1738 bytes
0644
schema-disabled-conditional.php
719 bytes
0644
semrush-enabled-conditional.php
739 bytes
0644
settings-conditional.php
992 bytes
0644
should-index-links-conditional.php
1046 bytes
0644
task-list-enabled-conditional.php
739 bytes
0644
text-formality-conditional.php
433 bytes
0644
updated-importer-framework-conditional.php
415 bytes
0644
user-can-edit-users-conditional.php
476 bytes
0644
user-can-manage-wpseo-options-conditional.php
506 bytes
0644
user-can-publish-posts-and-pages-conditional.php
542 bytes
0644
user-edit-conditional.php
489 bytes
0644
user-profile-conditional.php
545 bytes
0644
web-stories-conditional.php
440 bytes
0644
wincher-automatically-track-conditional.php
759 bytes
0644
wincher-conditional.php
160 bytes
0644
wincher-enabled-conditional.php
739 bytes
0644
wincher-token-conditional.php
680 bytes
0644
woo-seo-inactive-conditional.php
422 bytes
0644
woocommerce-conditional.php
412 bytes
0644
woocommerce-version-conditional.php
649 bytes
0644
wp-cron-enabled-conditional.php
351 bytes
0644
wp-robots-conditional.php
341 bytes
0644
wp-tests-conditional.php
383 bytes
0644
xmlrpc-conditional.php
439 bytes
0644
yoast-admin-and-dashboard-conditional.php
1656 bytes
0644
yoast-tools-page-conditional.php
638 bytes
0644
N4ST4R_ID | Naxtarrr