-
-
Notifications
You must be signed in to change notification settings - Fork 24
en Hooks
Hooks allow to the user to extend the functional extent of a WordPress-Plugins. The following Hooks are deposited in Statify and can be addressed or controlled via code:
Type: Boolean
Implementation: Statify 1.2.6
Customized control of page counting, e.g. for page type, user rights, browser type. In this way, all or certain blog pages can be excluded from counting.
The hook takes one (optional) parameter containing the result of previous filters (if any).
The first custom filter always receives null
.
There are three possible return values:
-
true
- Statify does not consider the currently called blog page -
false
- Statify does consider the current request without evaluating any built-in filters -
null
- can be interpreted as "no decision", Statify will continue evaluating the built-in filter chain
Code example:
add_filter(
'statify__skip_tracking',
function( $previous_result ) {
if ( 1 === 1 ) {
return true;
}
return false;
}
);
Type: Boolean
Implementation: Statify 1.3.1
Display control of the Dashboard statistics for non-administrators. The access to the Dashboard-Widget with WordPress statistics can be granted per user or user group.
The return value true
allows access to the statistics. The editing of the plugin settings in the widget remains exclusively reserved for users with the user role edit_dashboard.
Code example:
add_filter( 'statify__user_can_see_stats', '__return_true' );
Specific for Editors:
add_filter( 'statify__user_can_see_stats', current_user_can('edit_others_pages' ) );
More about Roles and there Capabilities can be found in the Codex.