Description
Filter whether or not an enhancement (i.e. snippet
) or configuration (i.e. rule
) is enabled.
Usage
Filter the enabled/disable status for these tweaks
add_filter( 'gravityhopper/[TYPE]/[SLUG]', 'my_callback_function' );
Parameters
is_enabled : bool
Whether or not the tweak is enabled.
Examples
Hide license details for specific user
// Hide license details only for user with username `typewheel`
add_filter( 'gravityhopper/rule/hide_license_details', function( $is_enabled ) {
return wp_get_current_user()->data->user_login === 'admin';
} );