14.1 Dữ liệu hàm get (ok)

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

public function save_themplate(array $post) {
    $result = false;
    if (!empty($post['layout'])) {
      $option = WPF_Options_CT::get_option($this->plugin_name, $this->version);
      if (empty($post['name'])) {
        $post['name'] = uniqid($this->plugin_name . '_');
      }
      $themplate_id = !empty($post['themplate_id']) ? $post['themplate_id'] : $option->unique_name($post['name']);
      $data = $option->get();
      $layout = stripslashes_deep($post['layout']);
    }
    
    return $result;
  }

C:\xampp\htdocs\test\wp-content\plugins\themify-wc-product-filter\includes\class-wpf-options.php

public  function get($recreate=false){
    static $options = null;
    if(is_null($options) || $recreate){
        $options = get_option(self::$settings_key);
    }
    return $options?$options:array();
}

C:\xampp\htdocs\test\wp-content\themes\twentyfifteen-child\header.php

Kết quả:

Last updated

Was this helpful?