PluginProbe
Content Control – The Ultimate Content Restriction Plugin! Restrict Content, Create Conditional Blocks & More / 2.6.1
Content Control – The Ultimate Content Restriction Plugin! Restrict Content, Create Conditional Blocks & More v2.6.1
trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.10 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.1.8 2.0.0 2.0.1 2.0.10 2.0.11 2.0.12 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 All 47 releases
content-control / inc / functions / install.php

install.php in Content Control – The Ultimate Content Restriction Plugin! Restrict Content, Create Conditional Blocks & More 2.6.1, at inc/functions/install.php

95 lines 2.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Compatibility functions.
4 *
5 * @package ContentControl
6 */
7
8 namespace ContentControl;
9
10 /**
11 * Returns an array of the default permissions.
12 *
13 * @return array<string,string> Default permissions.
14 */
15 function get_default_permissions() {
16 return [
17 // Block Controls.
18 'view_block_controls' => 'edit_posts',
19 'edit_block_controls' => 'edit_posts',
20 // Restrictions.
21 'edit_restrictions' => 'manage_options',
22 // Settings.
23 'manage_settings' => 'manage_options',
24 ];
25 }
26
27 /**
28 * Get the default media queries.
29 *
30 * @return array<string,array{override:bool,breakpoint:int}> Array of media queries.
31 */
32 function get_default_media_queries() {
33 return [
34 'mobile' => [
35 'override' => false,
36 'breakpoint' => 640,
37 ],
38 'tablet' => [
39 'override' => false,
40 'breakpoint' => 920,
41 ],
42 'desktop' => [
43 'override' => false,
44 'breakpoint' => 1440,
45 ],
46 ];
47 }
48
49 /**
50 * Returns an array of the default settings.
51 *
52 * @return array<string,mixed> Default settings.
53 */
54 function get_default_settings() {
55 return [
56 'defaultDenialMessage' => '',
57 'excludeAdmins' => true,
58 'excludedBlocks' => [],
59 'urlOverrides' => [],
60 'permissions' => [],
61 'mediaQueries' => get_default_media_queries(),
62 ];
63 }
64
65 /**
66 * Get default restriction settings.
67 *
68 * @return array<string,mixed> Default restriction settings.
69 */
70 function get_default_restriction_settings() {
71 return [
72 'userStatus' => 'logged_in',
73 'roleMatch' => 'any',
74 'userRoles' => [],
75 'protectionMethod' => 'redirect',
76 'redirectType' => 'login',
77 'redirectUrl' => '',
78 'replacementType' => 'message',
79 'replacementPage' => 0,
80 'archiveHandling' => 'filter_post_content',
81 'archiveReplacementPage' => 0,
82 'archiveRedirectType' => 'login',
83 'archiveRedirectUrl' => '',
84 'additionalQueryHandling' => 'filter_post_content',
85 'showExcerpts' => false,
86 'overrideMessage' => false,
87 'customMessage' => '',
88 'showInSearch' => false,
89 'conditions' => [
90 'logicalOperator' => 'and',
91 'items' => [],
92 ],
93 ];
94 }
95