PluginProbe
Discount Rules for WooCommerce – Disco | Dynamic Pricing, Conditions, Bulk, Bundle, BOGO / 1.4.14
Discount Rules for WooCommerce – Disco | Dynamic Pricing, Conditions, Bulk, Bundle, BOGO v1.4.14
1.4.14 1.4.13 1.4.12 1.4.11 1.4.10 1.4.9 1.4.8 1.4.7 1.4.6 1.4.5 1.4.4 1.4.3 1.4.2 1.4.1 1.4.0 1.3.54 1.3.53 1.3.52 1.3.51 1.3.50 1.3.49 1.3.48 1.3.47 1.3.46 1.3.45 All 177 releases
disco / ajax / Ajax_Admin.php

Ajax_Admin.php in Discount Rules for WooCommerce – Disco | Dynamic Pricing, Conditions, Bulk, Bundle, BOGO 1.4.14, at ajax/Ajax_Admin.php

53 lines 866 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Disco
5 *
6 * @package Disco
7 * @author Ohidul Islam <wahid0003@gmail.com>
8 * @copyright 2022 WebAppick
9 * @license GPL 2.0+
10 * @link http://domain.tld
11 */
12
13 namespace Disco\Ajax;
14
15 use Disco\Engine\Base;
16
17 /**
18 * AJAX as logged user
19 */
20 class Ajax_Admin extends Base {
21
22 /**
23 * Initialize the class.
24 *
25 * @return void
26 */
27 public function initialize() {
28 if ( ! \apply_filters( 'disco_d_ajax_admin_initialize', true ) ) {
29 return;
30 }
31
32 // For logged user
33 \add_action( 'wp_ajax_your_admin_method', array( $this, 'your_admin_method' ) );
34 }
35
36 /**
37 * The method to run on ajax
38 *
39 * @since 1.0.0
40 * @return void
41 */
42 public function your_admin_method() {
43 $return = array(
44 'message' => 'Saved',
45 'ID' => 2,
46 );
47
48 $this->clean_buffer();
49 \wp_send_json_success( $return );
50 }
51
52 }
53