16.1 Hiển thị popup chỉnh sửa (ok)

C:\xampp\htdocs\reset\wp-content\plugins\themify-wc-product-filter\admin\class-wpf-admin.php

add_action('wp_ajax_wpf_edit_ct',array($this,'add_template'));
public function add_template() {
    check_ajax_referer($this->plugin_name . '_edit', 'nonce', true);
    if (current_user_can('manage_options')) {
      if ($_REQUEST['action'] === 'wpf_edit_ct' && !empty($_REQUEST['slug'])) {
        global $cpt_id;
        $cpt_id = sanitize_key($_REQUEST['slug']);
      }
      include_once 'partials/form_ct.php';
    }
    wp_die();
  }

C:\xampp\htdocs\test\wp-content\plugins\plugin-name\includes\class-wpf-list_ct.php

Last updated

Was this helpful?