PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 3.2.3
JetFormBuilder — Dynamic Blocks Form Builder v3.2.3
3.6.3.1 3.6.3 3.6.2.2 3.6.2.1 3.6.2 3.6.1.1 3.6.1 3.6.0.1 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 1.4.2 1.4.3 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.1.0 2.1.1 2.1.10 2.1.11 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 3.0.0 3.0.0.1 3.0.0.2 3.0.0.3 3.0.1 3.0.1.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.0.1 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0 3.2.1 3.2.2 3.2.3 3.3.0 3.3.1 3.3.2 3.3.3 3.3.3.1 3.3.4 3.3.4.1 3.3.4.2 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.5.1 3.4.5.2 3.4.6 3.4.7 3.4.7.1 3.5.0 3.5.1 3.5.1.1 3.5.1.2 3.5.2 3.5.2.1 3.5.3 3.5.4 3.5.5 3.5.6 3.5.6.1 3.5.6.2 3.5.6.3 3.6.0
jetformbuilder / includes / admin / pages / stable-pages-manager.php
jetformbuilder / includes / admin / pages Last commit date
actions 2 years ago settings 2 years ago action-pages-manager.php 2 years ago addons-page.php 2 years ago base-page.php 2 years ago pages-manager.php 2 years ago single-pages-manager.php 2 years ago stable-pages-manager.php 2 years ago
stable-pages-manager.php
105 lines
1 <?php
2
3
4 namespace Jet_Form_Builder\Admin\Pages;
5
6 use Jet_Form_Builder\Admin\Pages\Settings\Settings_Page;
7 use Jet_Form_Builder\Classes\Http\Utm_Url;
8 use JFB_Components\Repository\Repository_Pattern_Trait;
9 use Jet_Form_Builder\Exceptions\Repository_Exception;
10
11 // If this file is called directly, abort.
12 if ( ! defined( 'WPINC' ) ) {
13 die;
14 }
15
16 class Stable_Pages_Manager {
17
18 use Repository_Pattern_Trait;
19
20 public function __construct() {
21 add_action( 'admin_menu', array( $this, 'add_pages' ) );
22 add_action( 'admin_menu', array( $this, 'add_static_pages' ) );
23 add_action( 'admin_head', array( $this, 'modify_item_styles' ) );
24 }
25
26 /**
27 * Register admin pages
28 */
29 public function rep_instances(): array {
30 return apply_filters(
31 'jet-form-builder/admin/pages',
32 array(
33 new Settings_Page(),
34 new Addons_Page(),
35 )
36 );
37 }
38
39 /**
40 * @param Base_Page $item
41 *
42 * @throws Repository_Exception
43 */
44 public function rep_before_install_item( $item ) {
45 if ( ! $item->is_active() ) {
46 $this->_rep_abort_this();
47 }
48 }
49
50 protected function get_parent_slug(): string {
51 return 'edit.php?post_type=' . jet_form_builder()->post_type->slug();
52 }
53
54 /**
55 * Register appointments
56 */
57 public function add_pages() {
58 $parent = $this->get_parent_slug();
59
60 /** @var Base_Page $page */
61 foreach ( $this->rep_get_items() as $page ) {
62 add_submenu_page(
63 $parent,
64 $page->title(),
65 $page->title(),
66 'manage_options',
67 $page->slug(),
68 array( $page, 'render' )
69 );
70 }
71 }
72
73 public function add_static_pages() {
74 $parent = $this->get_parent_slug();
75 $pages = array();
76
77 if ( ! jet_form_builder()->addons_manager->is_active() ) {
78 $utm = new Utm_Url( 'wp-dashboard/jetformbuilder-menu' );
79 $utm->set_campaign( 'go-pro-button' );
80
81 $pages[] = array(
82 'title' => __( 'Go PRO', 'jet-form-builder' ),
83 'capability' => 'manage_options',
84 'slug' => $utm->add_query( JET_FORM_BUILDER_SITE . '/pricing/' ),
85 );
86 }
87
88 foreach ( $pages as $page ) {
89 add_submenu_page(
90 $parent,
91 $page['title'],
92 $page['title'],
93 $page['capability'],
94 $page['slug']
95 );
96 }
97 }
98
99 public function modify_item_styles() {
100 echo '<style type="text/css">
101 #adminmenu #menu-posts-jet-form-builder a[href*="https://jetformbuilder.com"] { color: #F5C546; }
102 </style>';
103 }
104 }
105