From d667ad916e7691c89078c72bf724f77e56e4d2c2 Mon Sep 17 00:00:00 2001 From: Pavel Dohnal Date: Tue, 28 Jan 2020 16:26:04 +0100 Subject: [PATCH] Add wp functions [MAILPOET-2639] --- lib/WP/Functions.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lib/WP/Functions.php b/lib/WP/Functions.php index b8740bc896..3e4be5759a 100644 --- a/lib/WP/Functions.php +++ b/lib/WP/Functions.php @@ -574,6 +574,22 @@ class Functions { return plugins_api($action, $args); } + /** + * @param int|string|array $post Optional. Post ID, title, slug, or array of such. Default empty. + * @return bool Whether the query is for an existing single post. + */ + public function isSingle($post = '') { + return is_single($post); + } + + /** + * @param int|string|array $page Optional. Page ID, title, slug, or array of such. Default empty. + * @return bool Whether the query is for an existing single page. + */ + public function isPage($page = '') { + return is_page($page); + } + /** * @param string $package * @param array $args