ap_delete_reputation_event_by_slug( string $slug )
Description #
Delete a reputation event by slug.
Parameters #
- $slugstring (Required) Event slug.
Source #
File: includes/reputation.php
function ap_delete_reputation_event_by_slug( $slug ) { global $wpdb; $event = ap_get_reputation_event_by_slug( $slug ); if ( ! $event ) { return new WP_Error( 'rep_event_not_exits' ); } $rows = $wpdb->delete( // phpcs:ignore WordPress.DB $wpdb->ap_reputation_events, array( 'slug' => $slug ), array( '%s' ) ); if ( $rows ) { /** * Hook called right after deleting a reputation event. * * @param object $event Reputation event object. * @since 4.3.0 */ do_action( 'ap_deleted_reputation_event', $event ); // Delete cache. wp_cache_delete( 'all', 'ap_get_all_reputation_events' ); return true; } return new WP_Error( 'failed_to_delete_rep_event' ); }
Expand full source code Collapse full source code View on GitHub: includes/reputation.php:424
Add your comment