1 | <?php |
||
10 | class AMP_Template_Customizer { |
||
11 | /** |
||
12 | * AMP template editor panel ID. |
||
13 | * |
||
14 | * @since 0.4 |
||
15 | * @var string |
||
16 | */ |
||
17 | const PANEL_ID = 'amp_panel'; |
||
18 | |||
19 | /** |
||
20 | * Customizer instance. |
||
21 | * |
||
22 | * @since 0.4 |
||
23 | * @access protected |
||
24 | * @var WP_Customize_Manager $wp_customize |
||
25 | */ |
||
26 | protected $wp_customize; |
||
27 | |||
28 | /** |
||
29 | * Initialize the template Customizer feature class. |
||
30 | * |
||
31 | * @static |
||
32 | * @since 0.4 |
||
33 | * @access public |
||
34 | * |
||
35 | * @param WP_Customize_Manager $wp_customize Customizer instance. |
||
36 | */ |
||
37 | public static function init( $wp_customize ) { |
||
60 | |||
61 | /** |
||
62 | * Filters the core components to unhook the nav_menus and widgets panels. |
||
63 | * |
||
64 | * @since 0.4 |
||
65 | * @access private |
||
66 | * |
||
67 | * @return array Array of core Customizer components to keep active. |
||
68 | */ |
||
69 | public static function _unregister_core_panels( $panels ) { |
||
75 | |||
76 | /** |
||
77 | * Removes all non-AMP sections and panels. |
||
78 | * |
||
79 | * Provides a clean, standalone instance-like experience by removing all non-AMP registered panels and sections. |
||
80 | * |
||
81 | * @since 0.4 |
||
82 | * @access private |
||
83 | */ |
||
84 | private function _unregister_core_ui() { |
||
96 | |||
97 | public function remove_all_panels( $components ) { |
||
101 | |||
102 | public function init_preview() { |
||
108 | |||
109 | /** |
||
110 | * Sets up the AMP Customizer preview. |
||
111 | */ |
||
112 | public function register_ui() { |
||
124 | |||
125 | /** |
||
126 | * Registers settings for customizing AMP templates. |
||
127 | * |
||
128 | * @since 0.4 |
||
129 | * @access public |
||
130 | */ |
||
131 | public function register_settings() { |
||
134 | |||
135 | public function add_customizer_scripts() { |
||
139 | |||
140 | /** |
||
141 | * Enqueues scripts and fires the 'wp_footer' action so we can output customizer scripts. |
||
142 | * |
||
143 | * This breaks AMP validation in the customizer but is necessary for the live preview. |
||
144 | * |
||
145 | * @since 0.4 |
||
146 | * @access public |
||
147 | */ |
||
148 | public function add_preview_scripts() { |
||
162 | |||
163 | public function force_mobile_preview( $devices ) { |
||
171 | |||
172 | public static function is_amp_customizer() { |
||
175 | } |
||
176 |