Skip to content
Docs
Get RestroPress

Filter

rpress_template_pack_entitled

Updated
On this page

Filters whether a Pro template pack is entitled to run.

Applied in the pack selector for each registered pack that is flagged as pro. The default is false, which renders the pack locked and not selectable. A Pro plugin returns true when its licence allows the pack.

Available since RestroPress 3.4.

Parameters#

ParameterTypeDescription
$entitledboolWhether the pack is entitled, false by default.
$packarrayThe registered pack definition, including id, label and pro.

Return value#

bool. True if the pack may be used.

Example#

function my_template_pack_entitled( $entitled, $pack ) {
	if ( 'my_pack' === $pack['id'] ) {
		return (bool) get_option( 'my_pack_license_valid' );
	}
	return $entitled;
}
add_filter( 'rpress_template_pack_entitled', 'my_template_pack_entitled', 10, 2 );

Source#

Applied in:

  • includes/class-rpress-template-packs.php (line 473), in rpress_pack_selector_callback()

See also#

Was this page helpful?