PluginProbe
PublishPress Permissions: Access Control, Content Permissions, User Access / trunk
PublishPress Permissions: Access Control, Content Permissions, User Access vtrunk
4.8.4 4.8.3 4.8.2 3.3.6 3.3.7 3.3.8 3.3.9 3.4 3.4.1 3.4.2 3.4.3 3.5 3.5.1 3.5.2 3.5.4 3.5.6 3.5.7 3.6 3.6.2 3.6.3 3.6.4 3.6.5 3.6.6 3.6.7 3.6.8 All 202 releases
press-permit-core / functions.php

functions.php in PublishPress Permissions: Access Control, Content Permissions, User Access trunk, at functions.php

47 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 function presspermit() {
3 require_once(__DIR__ . '/classes/PublishPress/Permissions.php');
4 return \PublishPress\Permissions::instance();
5 }
6
7 function presspermitPluginPage()
8 {
9 static $pp_plugin_page = null;
10
11 if (is_null($pp_plugin_page)) {
12 $pp_plugin_page = (is_admin() && \PressShack\LibWP::REQUEST_key_match('page', 'presspermit-'))
13 ? \PressShack\LibWP::REQUEST_key('page')
14 : false;
15 }
16
17 return $pp_plugin_page;
18 }
19
20 function presspermit_is_preview() {
21 global $wp_query;
22
23 if (isset($wp_query)) {
24 $is_preview = is_preview();
25 } else {
26 $is_preview = !\PressShack\LibWP::empty_REQUEST('preview');
27 }
28
29 if (!$is_preview) {
30 if (defined('ELEMENTOR_VERSION')) {
31 $is_preview = !\PressShack\LibWP::empty_REQUEST('elementor-preview');
32 } elseif (defined('ET_CORE')) {
33 $is_preview = !\PressShack\LibWP::empty_REQUEST('et_fb');
34 }
35 }
36
37 return apply_filters('presspermit_is_preview', $is_preview);
38 }
39
40 function publishpress_is_post_teaser($post_id = 0) {
41 return class_exists('PublishPress\Permissions\Teaser') && \PublishPress\Permissions\Teaser::isTeasedPost($post_id);
42 }
43
44 function publishpress_is_archive_teaser() {
45 return class_exists('PublishPress\Permissions\Teaser') && \PublishPress\Permissions\Teaser::isArchiveTeaser();
46 }
47