PluginProbe
Additional Terms Lite for WooCommerce / 1.6.2
Additional Terms Lite for WooCommerce v1.6.2
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 1.6.2, at src/Ajax/Rated.php

68 lines 1.0 KB
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 * @author MyPreview (Github: @mahdiyazdani, @gooklani, @mypreview)
6 *
7 * @since 1.4.0
8 *
9 * @package woo-additional-terms
10 */
11
12 namespace Woo_Additional_Terms\Ajax;
13
14 use Woo_Additional_Terms\Enhancements;
15
16 /**
17 * Rate(d) admin notice class.
18 */
19 class Rated extends Ajax {
20
21 /**
22 * Setup hooks and filters.
23 *
24 * @since 1.4.0
25 *
26 * @return void
27 */
28 public function __construct() {
29
30 // Parent constructor.
31 parent::__construct(
32 'dismiss_rated',
33 Enhancements\Notices::DISMISS_NONCE_NAME
34 );
35 }
36
37 /**
38 * Setup hooks and filters.
39 *
40 * @since 1.4.0
41 *
42 * @return void
43 */
44 public function setup() {
45
46 // Register the AJAX action.
47 $this->register_admin();
48 }
49
50 /**
51 * AJAX dismiss the admin notice.
52 *
53 * @since 1.4.0
54 *
55 * @return void
56 */
57 public function ajax_callback() {
58
59 // Bail early if the nonce is invalid.
60 $this->verify_nonce();
61
62 // Set the already rated option.
63 add_option( Enhancements\Rate::OPTION_NAME, true );
64
65 exit();
66 }
67 }
68