$key = $args[ $key ]; } } $this->manager = $manager; $this->id = $id; $this->sections = array(); // Users cannot customize the $sections array. return $this; } /** * Checks required user capabilities and whether the theme has the * feature support required by the panel. * * @since 4.0.0 * * @return bool False if theme doesn't support the panel or the user doesn't have the capability. */ public final function check_capabilities() { if ( $this->capability && ! call_user_func_array( 'current_user_can', (array) $this->capability ) ) { return false; } if ( $this->theme_supports && ! call_user_func_array( 'current_theme_supports', (array) $this->theme_supports ) ) { return false; } return true; } /** * Check capabilities and render the panel. * * @since 4.0.0 */ public final function maybe_render() { if ( ! $this->check_capabilities() ) { return; } /** * Fires before rendering a Customizer panel. * * @since 4.0.0 * * @param WP_Customize_Panel $this WP_Customize_Panel instance. */ do_action( 'customize_render_panel', $this ); /** * Fires before rendering a specific Customizer panel. * * The dynamic portion of the hook name, $this->id, refers to the ID * of the specific Customizer panel to be rendered. * * @since 4.0.0 */ do_action( "customize_render_panel_{$this->id}" ); $this->render(); } /** * Render the panel, and the sections that have been added to it. * * @since 4.0.0 * @access protected */ protected function render() { ?>