PluginProbe ʕ •ᴥ•ʔ
Kubio AI Page Builder / 2.8.0
Kubio AI Page Builder v2.8.0
2.8.2 2.8.1 trunk 1.0.0 1.0.1 1.1.0 1.2.0 1.2.1 1.2.2 1.2.3 1.3.0 1.3.1 1.3.2 1.4.0 1.4.1 1.4.2 1.4.3 1.5.0 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.7.0 1.7.1 1.7.2 1.7.3 1.8.0 1.8.1 1.8.2 1.9.0 2.0.0 2.1.1 2.1.2 2.1.3 2.2.0 2.2.3 2.2.4 2.2.5 2.3.0 2.3.1 2.3.3 2.3.4 2.4.0 2.4.1 2.4.2 2.4.3 2.4.5 2.5.0 2.5.1 2.5.2 2.5.3 2.6.0 2.6.1 2.6.2 2.6.3 2.6.5 2.6.6 2.6.7 2.7.0 2.7.1 2.7.2 2.7.3 2.8.0
kubio / lib / src / Core / EditInKubioCustomizerPanel.php
kubio / lib / src / Core Last commit date
Background 1 year ago Blocks 1 year ago GlobalElements 1 year ago Layout 1 year ago License 1 year ago Separators 11 months ago StyleManager 1 month ago Styles 1 year ago Activation.php 1 year ago Backup.php 1 year ago CustomizerImporter.php 11 months ago Deactivation.php 1 year ago EditInKubioCustomizerPanel.php 1 year ago Element.php 1 year ago ElementBase.php 4 years ago Importer.php 1 month ago InnerBlocks.php 1 year ago KubioFrontPageRevertNotice.php 9 months ago LodashBasic.php 1 year ago Registry.php 1 year ago ThirdPartyPluginAssetLoaderInEditor.php 3 months ago Utils.php 1 month ago
EditInKubioCustomizerPanel.php
101 lines
1 <?php
2
3 namespace Kubio\Core;
4
5 class EditInKubioCustomizerPanel extends \WP_Customize_Panel {
6
7
8 public function __construct( $manager, $id, $args = array() ) {
9
10 $manager->add_section(
11 "{$id}-section",
12 array( 'panel' => $id )
13 );
14
15 $manager->add_control(
16 "{$id}-control",
17 array(
18 'section' => "{$id}-section",
19 'settings' => array(),
20 'type' => 'button',
21 'capability' => 'manage_options',
22 )
23 );
24
25 add_action( 'customize_controls_print_footer_scripts', array( $this, 'printScripts' ) );
26 parent::__construct( $manager, $id, $args );
27 }
28
29 public function printScripts() {
30 ?>
31 <style>
32 .kubio-customizer-panel {
33 margin: 15px;
34 border: none !important;
35 }
36
37 .kubio-customizer-panel .accordion-section-title {
38 cursor: default;
39 border: 1px solid #ddd !important;
40 box-shadow: none !important;
41 padding: 12px 15px 15px;
42 }
43
44 .kubio-customizer-panel .accordion-section-title:after {
45 display: none;
46 }
47
48 .kubio-customizer-panel p {
49 font-weight: normal;
50 font-size: 13px;
51 margin: 0 0 10px 0;
52 }
53
54 .kubio-customizer-panel .button.button-primary svg {
55 fill: currentColor;
56 width: 1em;
57 height: 1em;
58 margin-right: 0.5em;
59 }
60
61 .kubio-customizer-panel .button.button-primary {
62 align-items: center;
63 width: 100%;
64 display: flex;
65 justify-content: center;
66 padding: 5px 10px;
67 }
68 </style>
69 <?php
70 }
71
72 protected function render() {
73
74 $message = __( 'After installing the Kubio builder, all page contents editing will be done using the WordPress block editor instead of the Customizer.', 'kubio' );
75
76 if ( kubio_theme_has_block_templates_support() ) {
77 $message = __( 'After installing the Kubio builder, all site editing will be done using the WordPress block editor instead of the Customizer.', 'kubio' );
78 }
79
80 ?>
81 <li class="accordion-section kubio-customizer-panel">
82 <div class="accordion-section-title">
83 <p><?php echo esc_html( $message ); ?></p>
84 <p><?php esc_html_e( ' Please use the button below to open the Kubio editor.', 'kubio' ); ?></p>
85 <button class="button button-primary kubio-open-editor-panel-button">
86 <?php echo wp_kses_post( KUBIO_LOGO_SVG ); ?>
87 <span><?php esc_html_e( 'Open Kubio Editor', 'kubio' ); ?></span>
88 </button>
89 <script>
90 (function () {
91 document.querySelector('.kubio-open-editor-panel-button').addEventListener('click', function () {
92 window.location = '<?php echo esc_url( add_query_arg( 'page', 'kubio', admin_url( 'admin.php' ) ) ); ?>';
93 })
94 })();
95 </script>
96 </div>
97 </li>
98 <?php
99 }
100 }
101