| Server IP : 68.178.247.200 / Your IP : 216.73.217.108 Web Server : Apache System : Linux p3plzcpnl489463.prod.phx3.secureserver.net 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64 User : x9dppmxs4rgd ( 8559391) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/self/cwd/wp-content/plugins/wordpress-seo/src/conditionals/ |
Upload File : |
<?php
namespace Yoast\WP\SEO\Conditionals;
use Yoast\WP\SEO\Helpers\Current_Page_Helper;
/**
* Conditional that is only met when in frontend or page is a post overview or post add/edit form.
*/
class Primary_Category_Conditional implements Conditional {
/**
* The current page helper.
*
* @var Current_Page_Helper
*/
private $current_page;
/**
* Primary_Category_Conditional constructor.
*
* @param Current_Page_Helper $current_page The current page helper.
*/
public function __construct( Current_Page_Helper $current_page ) {
$this->current_page = $current_page;
}
/**
* Returns `true` when on the frontend,
* or when on the post overview, post edit or new post admin page.
*
* @return bool `true` when on the frontend, or when on the post overview,
* post edit or new post admin page.
*/
public function is_met() {
if ( ! \is_admin() ) {
return true;
}
return \in_array( $this->current_page->get_current_admin_page(), [ 'edit.php', 'post.php', 'post-new.php' ], true );
}
}