PluginProbe
Content Control – The Ultimate Content Restriction Plugin! Restrict Content, Create Conditional Blocks & More / 2.0.0
Content Control – The Ultimate Content Restriction Plugin! Restrict Content, Create Conditional Blocks & More v2.0.0
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 / classes / Controllers / Frontend.php

Frontend.php in Content Control – The Ultimate Content Restriction Plugin! Restrict Content, Create Conditional Blocks & More 2.0.0, at classes/Controllers/Frontend.php

50 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Frontend general setup.
4 *
5 * @copyright (c) 2023, Code Atlantic LLC.
6 * @package ContentControl
7 */
8
9 namespace ContentControl\Controllers;
10
11 use ContentControl\Base\Controller;
12
13 use ContentControl\Controllers\Frontend\Blocks;
14 use ContentControl\Controllers\Frontend\Restrictions;
15 use ContentControl\Controllers\Frontend\Widgets;
16
17 defined( 'ABSPATH' ) || exit;
18
19 /**
20 * Class Frontend
21 */
22 class Frontend extends Controller {
23
24 /**
25 * Initialize Hooks & Filters
26 */
27 public function init() {
28 $this->container->register_controllers([
29 'Frontend\Blocks' => new Blocks( $this->container ),
30 'Frontend\Restrictions' => new Restrictions( $this->container ),
31 'Frontend\Widgets' => new Widgets( $this->container ),
32 ]);
33
34 $this->hooks();
35 }
36
37 /**
38 * Register general frontend hooks.
39 *
40 * @return void
41 */
42 public function hooks() {
43 add_filter( 'content_control/restricted_post_content', '\ContentControl\append_post_excerpts', 9, 2 );
44 add_filter( 'content_control/restricted_post_content', '\ContentControl\the_content_filters', 10 );
45
46 add_filter( 'content_control/restricted_post_excerpt', '\ContentControl\append_post_excerpts', 9, 2 );
47 add_filter( 'content_control/restricted_post_excerpt', '\ContentControl\the_excerpt_filters', 10 );
48 }
49 }
50