ap_register_reputation_event( string $event_slug, array $args )
Description #
Register reputation event.
Parameters #
- $event_slugstring (Required) Event slug.
- $argsarray (Required) Points to award for this reputation.
Source #
File: includes/reputation.php
function ap_register_reputation_event( $event_slug, $args ) { $args = wp_parse_args( $args, array( 'icon' => 'apicon-reputation', 'parent' => 'post', ) ); $event_slug = sanitize_title( $event_slug ); $args['label'] = esc_attr( $args['label'] ); $args['description'] = esc_html( $args['description'] ); $args['icon'] = esc_attr( $args['icon'] ); $custom_points = get_option( 'anspress_reputation_events' ); $args['points'] = isset( $custom_points[ $event_slug ] ) ? (int) $custom_points[ $event_slug ] : (int) $args['points']; anspress()->reputation_events[ $event_slug ] = $args; }
Expand full source code Collapse full source code View on GitHub: includes/reputation.php:142
Add your comment