Title: WP_Customize_Panel::maybe_render
Published: September 4, 2014
Last modified: August 20, 2026

---

# WP_Customize_Panel::maybe_render()

## In this article

 * [Source](https://developer.wordpress.org/reference/classes/wp_customize_panel/maybe_render/?output_format=md#source)
 * [Hooks](https://developer.wordpress.org/reference/classes/wp_customize_panel/maybe_render/?output_format=md#hooks)
 * [Related](https://developer.wordpress.org/reference/classes/wp_customize_panel/maybe_render/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/classes/wp_customize_panel/maybe_render/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/classes/wp_customize_panel/maybe_render/?output_format=md#wp--skip-link--target)

Check capabilities and render the panel.

## 󠀁[Source](https://developer.wordpress.org/reference/classes/wp_customize_panel/maybe_render/?output_format=md#source)󠁿

    ```php
    final public function maybe_render() {
    	if ( ! $this->check_capabilities() ) {
    		return;
    	}

    	/**
    	 * Fires before rendering a Customizer panel.
    	 *
    	 * @since 4.0.0
    	 *
    	 * @param WP_Customize_Panel $panel 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();
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-customize-panel.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-includes/class-wp-customize-panel.php#L275)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/class-wp-customize-panel.php#L275-L300)

## 󠀁[Hooks](https://developer.wordpress.org/reference/classes/wp_customize_panel/maybe_render/?output_format=md#hooks)󠁿

 [do_action( ‘customize_render_panel’, WP_Customize_Panel $panel )](https://developer.wordpress.org/reference/hooks/customize_render_panel/)

Fires before rendering a Customizer panel.

 [do_action( “customize_render_panel_{$this->id}” )](https://developer.wordpress.org/reference/hooks/customize_render_panel_this-id/)

Fires before rendering a specific Customizer panel.

## 󠀁[Related](https://developer.wordpress.org/reference/classes/wp_customize_panel/maybe_render/?output_format=md#related)󠁿

| Uses | Description | 
| [WP_Customize_Panel::render()](https://developer.wordpress.org/reference/classes/wp_customize_panel/render/)`wp-includes/class-wp-customize-panel.php` |

Render the panel container, and then its contents (via `this-&gt;render_content()`) in a subclass.

  | 
| [WP_Customize_Panel::check_capabilities()](https://developer.wordpress.org/reference/classes/wp_customize_panel/check_capabilities/)`wp-includes/class-wp-customize-panel.php` |

Checks required user capabilities and whether the theme has the feature support required by the panel.

  | 
| [do_action()](https://developer.wordpress.org/reference/functions/do_action/)`wp-includes/plugin.php` |

Calls the callback functions that have been added to an action hook.

  |

[Show 1 more](https://developer.wordpress.org/reference/classes/wp_customize_panel/maybe_render/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/classes/wp_customize_panel/maybe_render/?output_format=md#)

| Used by | Description | 
| [WP_Customize_Panel::get_content()](https://developer.wordpress.org/reference/classes/wp_customize_panel/get_content/)`wp-includes/class-wp-customize-panel.php` |

Get the panel’s content template for insertion into the Customizer pane.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/classes/wp_customize_panel/maybe_render/?output_format=md#changelog)󠁿

| Version | Description | 
| [4.0.0](https://developer.wordpress.org/reference/since/4.0.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_customize_panel%2Fmaybe_render%2F)
before being able to contribute a note or feedback.