Server IP : 104.21.14.103 / Your IP : 3.15.226.147 Web Server : LiteSpeed System : Linux business53.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : giankuin ( 1871) 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/root/home/giankuin/thietke365.net/wp-content/plugins/mailpoet/lib/Util/ |
Upload File : |
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing namespace MailPoet\Util; if (!defined('ABSPATH')) exit; if (!class_exists('\WP_REST_Posts_Controller')) { require_once ABSPATH . '/wp-includes/rest-api/endpoints/class-wp-rest-controller.php'; require_once ABSPATH . '/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php'; } class APIPermissionHelper extends \WP_REST_Posts_Controller { public function __construct() { // constructor is needed to override parent constructor } public function checkReadPermission(\WP_Post $post): bool { return parent::check_read_permission($post); } /** * Checks if a given post type can be viewed or managed. * Refrain from checking `show_in_rest` contrary to what parent::check_is_post_type_allowed does * * @param \WP_Post_Type|string $post_type Post type name or object. * @return bool Whether the post type is allowed in REST. * @see parent::check_is_post_type_allowed */ // phpcs:disable PSR1.Methods.CamelCapsMethodName protected function check_is_post_type_allowed($post_type) { if (!is_object($post_type)) { $post_type = get_post_type_object($post_type); } return !empty($post_type) && $post_type->public; } }