AP_Activate::set_reputation_events_icon()

Description #

Set the reputation events icon.

Changelog #

VersionDescription
4.4.0Introduced.

Source #

File: activate.php

	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