PluginProbe
Additional Terms Lite for WooCommerce / trunk
Additional Terms Lite for WooCommerce vtrunk
1.7.3 1.7.2.1 trunk 1.0.1 1.0.2 1.1.0 1.2.0 1.2.1 1.2.2 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.4.0 1.4.1 1.5.0 1.5.1 1.5.2 1.6.0 1.6.1 1.6.2 1.6.3 All 35 releases
woo-additional-terms / src / Ajax / Rated.php

Rated.php in Additional Terms Lite for WooCommerce trunk, at src/Ajax/Rated.php

66 lines 958 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Dismiss rate the plugin admin notice.
4 *
5 * @since 1.4.0
6 *
7 * @package woo-additional-terms
8 */
9
10 namespace Woo_Additional_Terms\Ajax;
11
12 use Woo_Additional_Terms\Enhancements;
13
14 /**
15 * Rate(d) admin notice class.
16 */
17 class Rated extends Ajax {
18
19 /**
20 * Setup hooks and filters.
21 *
22 * @since 1.4.0
23 *
24 * @return void
25 */
26 public function __construct() {
27
28 // Parent constructor.
29 parent::__construct(
30 'dismiss_rated',
31 Enhancements\Notices::DISMISS_NONCE_NAME
32 );
33 }
34
35 /**
36 * Setup hooks and filters.
37 *
38 * @since 1.4.0
39 *
40 * @return void
41 */
42 public function setup() {
43
44 // Register the AJAX action.
45 $this->register_admin();
46 }
47
48 /**
49 * AJAX dismiss the admin notice.
50 *
51 * @since 1.4.0
52 *
53 * @return void
54 */
55 public function ajax_callback() {
56
57 // Bail early if the nonce is invalid.
58 $this->verify_nonce();
59
60 // Set the already rated option.
61 add_option( Enhancements\Rate::OPTION_NAME, true );
62
63 exit();
64 }
65 }
66