PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 1.2.6
JetFormBuilder — Dynamic Blocks Form Builder v1.2.6
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 / base-page.php
jetformbuilder / includes / admin / pages Last commit date
addons-page.php 4 years ago base-page.php 4 years ago page-config.php 4 years ago pages-manager.php 4 years ago settings-page.php 4 years ago
base-page.php
90 lines
1 <?php
2
3 namespace Jet_Form_Builder\Admin\Pages;
4
5 use Jet_Form_Builder\Plugin;
6
7 /**
8 * Base dashboard page
9 */
10 abstract class Base_Page {
11
12 /**
13 * Page slug
14 */
15 abstract public function slug(): string;
16
17 /**
18 * Page title
19 */
20 abstract public function title(): string;
21
22 /**
23 * Page render function
24 */
25 public function render() {
26 printf( '<div id="%s"></div>', 'jet-form-builder_page_' . $this->slug() );
27 }
28
29 /**
30 * Return page config array
31 */
32 abstract public function page_config(): array;
33
34 /**
35 * Page specific assets
36 */
37 public function assets() {
38 wp_enqueue_script(
39 $this->slug(),
40 Plugin::instance()->plugin_url( 'assets/js/admin.js' ),
41 array(),
42 Plugin::instance()->get_version(),
43 true
44 );
45 }
46
47
48 /**
49 * Enqueue script
50 *
51 * @param $handle string
52 * @param $file_path string
53 */
54 public function enqueue_script( string $handle, string $file_path ) {
55 wp_enqueue_script(
56 $handle,
57 Plugin::instance()->plugin_url( "assets/js/$file_path" ),
58 array( 'wp-api-fetch' ),
59 Plugin::instance()->get_version(),
60 true
61 );
62 }
63
64 /**
65 * Enqueue style
66 *
67 * @param string $handle
68 * @param string $file_path
69 */
70 public function enqueue_style( string $handle, string $file_path ) {
71 wp_enqueue_style(
72 $handle,
73 Plugin::instance()->plugin_url( "assets/css/$file_path" ),
74 array(),
75 Plugin::instance()->get_version()
76 );
77 }
78
79
80 /**
81 * Returns current page url
82 */
83 public function get_url(): string {
84 return add_query_arg(
85 array( 'page' => $this->slug() ),
86 esc_url( admin_url( 'admin.php' ) )
87 );
88 }
89
90 }