Design System is here - Read the release post

Learn GeneratePress

Developers

Admin and capabilities filters

Filters and actions for the WordPress admin — dashboard screens, user capabilities, the Customizer, and loading/updates.

Jump to

Actions (admin screens)

generate_dashboard_after_header

GP Free

The generate_dashboard_after_header hook appears directly after the header in the Appearance > GeneratePress dashboard page.

Parameters: none. Default: —.

add_action( 'generate_dashboard_after_header', function() {
    ?>
    <div class="my-notice">Insert your content here.</div>
    <?php
} );

Guide: Developers

generate_dashboard_inside_container

GP Free

The generate_dashboard_inside_container hook appears inside the main container in the Appearance > GeneratePress dashboard page.

Parameters: none. Default: —.

add_action( 'generate_dashboard_inside_container', function() {
    ?>
    <div class="my-notice">Insert your content here.</div>
    <?php
} );

Guide: Developers

Back to top

Capabilities

generate_dashboard_page_capability

GP Free

The generate_dashboard_page_capability filter allows you to set the required user role for viewing the Appearance > GeneratePress page in the Dashboard.

Parameters: $value (string). Default: edit_theme_options.

add_filter( 'generate_dashboard_page_capability', function( $value ) {
    return $value;
} );

Guide: Developers

generate_metabox_capability

GP Free

The generate_metabox_capability filter allows you to decide what capability your admin users need to see GeneratePress meta boxes.

Parameters: $value (string). Default: activate_plugins.

add_filter( 'generate_metabox_capability', function( $value ) {
    return $value;
} );

Guide: Developers

Back to top

Customizer and editor

generate_disable_customizer_shortcuts

GP Premium — Site Library module.

The generate_disable_customizer_shortcuts allows you to disable the customizer shortcuts.

Parameters: $value. Default: false.

add_filter( 'generate_disable_customizer_shortcuts', '__return_true' );

Guide: Developers

generate_show_block_editor_styles

GP Free

The generate_show_block_editor_styles allows you to remove all front-end styles, including colors, typography, in the block editor to make it easier to edit in certain cases and color schemes.

Parameters: $value. Default: true.

add_filter( 'generate_show_block_editor_styles', '__return_false' );

Guide: Developers

Back to top

Loading and updates

generate_load_child_theme_stylesheet

GP Free

GeneratePress loads the child theme stylesheet by default if a child theme is active.

Parameters: $value. Default: true.

add_filter( 'generate_load_child_theme_stylesheet', '__return_false' );

Guide: Getting Started

generate_premium_beta_tester

GP Premium — Gp Premium.Php:181: ‘Beta’ => Apply_Filters( ‘Genera module.

The generate_premium_beta_tester filter allows you to become a beta tester.

Parameters: $value. Default: false.

add_filter( 'generate_premium_beta_tester', function( $value ) {
    return $value;
} );

Guide: Getting Started

generate_premium_url_args

GP Free

This filter allows you to add certain arguments to the premium URLs in the free theme Dashboard.

Parameters: $value. Default: shown right, computed at render time:

array(
				'ref' => null,
				'campaign' => null,
			)
add_filter( 'generate_premium_url_args', 'tu_affiliate_id' );
function tu_affiliate_id( $args )
{
	$args = array(
		'ref' => 1,
		'campaign' => 'test'
	);
	return $args;
}

Guide: Getting Started

Back to top