| | |
| | | <?php |
| | | namespace JVBase\managers; |
| | | |
| | | use Redis; |
| | | use WP_Object_Cache; |
| | | use WP_Post; |
| | | |
| | | if (!defined('ABSPATH')) { |
| | | exit; |
| | | } |
| | |
| | | return $value; |
| | | } |
| | | |
| | | public function get(int|string|array $id): mixed |
| | | public function get(int|string|array $id): bool |
| | | { |
| | | return false; |
| | | if (is_array($id)) { |
| | |
| | | /**************************************************** |
| | | * REDIS |
| | | ****************************************************/ |
| | | private static function redis(): ?\Redis |
| | | private static function redis(): ?Redis |
| | | { |
| | | global $wp_object_cache; |
| | | |
| | | return $wp_object_cache instanceof \WP_Object_Cache |
| | | return $wp_object_cache instanceof WP_Object_Cache |
| | | && isset($wp_object_cache->redis) |
| | | ? $wp_object_cache->redis |
| | | : null; |
| | |
| | | /**************************************************** |
| | | * HOOKS - Posts |
| | | ****************************************************/ |
| | | public static function onPostChange(int $postId, \WP_Post $post): void |
| | | public static function onPostChange(int $postId, WP_Post $post): void |
| | | { |
| | | if (wp_is_post_revision($postId) || wp_is_post_autosave($postId)) { |
| | | return; |