+ /**
+ * Add a customize panel.
+ *
+ * @since 4.0.0
+ * @access public
+ *
+ * @param WP_Customize_Panel|string $id Customize Panel object, or Panel ID.
+ * @param array $args Optional. Panel arguments. Default empty array.
+ */
+ public function add_panel( $id, $args = array() ) {
+ if ( is_a( $id, 'WP_Customize_Panel' ) ) {
+ $panel = $id;
+ }
+ else {
+ $panel = new WP_Customize_Panel( $this, $id, $args );
+ }
+
+ $this->panels[ $panel->id ] = $panel;
+ }
+
+ /**
+ * Retrieve a customize panel.
+ *
+ * @since 4.0.0
+ * @access public
+ *
+ * @param string $id Panel ID to get.
+ * @return WP_Customize_Panel Requested panel instance.
+ */
+ public function get_panel( $id ) {
+ if ( isset( $this->panels[ $id ] ) ) {
+ return $this->panels[ $id ];
+ }
+ }
+
+ /**
+ * Remove a customize panel.
+ *
+ * @since 4.0.0
+ * @access public
+ *
+ * @param string $id Panel ID to remove.
+ */
+ public function remove_panel( $id ) {
+ unset( $this->panels[ $id ] );
+ }
+