AP_Activate::set_reputation_events_icon()

Description #

Set the reputation events icon.

Changelog #

VersionDescription
4.4.0Introduced.

Source #

File: activate.php

421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
public function set_reputation_events_icon() {
    $events = array(
        'register'           => 'apicon-question',
        'ask'                => 'apicon-question',
        'answer'             => 'apicon-answer',
        'comment'            => 'apicon-comments',
        'select_answer'      => 'apicon-check',
        'best_answer'        => 'apicon-check',
        'received_vote_up'   => 'apicon-thumb-up',
        'received_vote_down' => 'apicon-thumb-down',
        'given_vote_up'      => 'apicon-thumb-up',
        'given_vote_down'    => 'apicon-thumb-down',
    );
 
    // Modify reputation events icon.
    global $wpdb;
    foreach ( $events as $slug => $icon ) {
        $wpdb->update( // phpcs:disable WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching
            $wpdb->prefix . 'ap_reputation_events',
            array( 'icon' => $icon ),
            array( 'slug' => $slug )
        );
    }
}

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Add your comment