Skip to content
Docs
Get RestroPress

Filter

rpress_allow_template_part_{$slug}_{$name}

Updated
On this page

Filters whether a RestroPress template part is loaded.

Runs in rpress_get_template_part() before templates are looked up. Return false and the function returns an empty string without loading anything. The name is built from the slug and name; when no name is given the name part is empty, producing a hook ending in an underscore.

Parameters#

ParameterTypeDescription
$load_templateboolDefault true.

Return value#

bool. False to skip loading the template part.

Example#

function my_skip_dietary_part( $load_template ) {
	return false;
}
add_filter( 'rpress_allow_template_part_list/fooditems_', 'my_skip_dietary_part' );

Notes#

With no name argument the hook name ends with a trailing underscore.

Source#

Applied in:

  • includes/template-functions.php (line 611), in rpress_get_template_part()

See also#

Was this page helpful?