| @@ 32-59 (lines=28) @@ | ||
| 29 | * @return n/a |
|
| 30 | */ |
|
| 31 | ||
| 32 | function __construct() { |
|
| 33 | ||
| 34 | // vars |
|
| 35 | $this->name = 'select'; |
|
| 36 | $this->label = __("Select",'acf'); |
|
| 37 | $this->category = 'choice'; |
|
| 38 | $this->defaults = array( |
|
| 39 | 'multiple' => 0, |
|
| 40 | 'allow_null' => 0, |
|
| 41 | 'choices' => array(), |
|
| 42 | 'default_value' => '', |
|
| 43 | 'ui' => 0, |
|
| 44 | 'ajax' => 0, |
|
| 45 | 'placeholder' => '', |
|
| 46 | 'disabled' => 0, |
|
| 47 | 'readonly' => 0, |
|
| 48 | ); |
|
| 49 | ||
| 50 | ||
| 51 | // ajax |
|
| 52 | add_action('wp_ajax_acf/fields/select/query', array($this, 'ajax_query')); |
|
| 53 | add_action('wp_ajax_nopriv_acf/fields/select/query', array($this, 'ajax_query')); |
|
| 54 | ||
| 55 | ||
| 56 | // do not delete! |
|
| 57 | parent::__construct(); |
|
| 58 | ||
| 59 | } |
|
| 60 | ||
| 61 | ||
| 62 | /* |
|
| @@ 32-60 (lines=29) @@ | ||
| 29 | * @return n/a |
|
| 30 | */ |
|
| 31 | ||
| 32 | function __construct() { |
|
| 33 | ||
| 34 | // vars |
|
| 35 | $this->name = 'taxonomy'; |
|
| 36 | $this->label = __("Taxonomy",'acf'); |
|
| 37 | $this->category = 'relational'; |
|
| 38 | $this->defaults = array( |
|
| 39 | 'taxonomy' => 'category', |
|
| 40 | 'field_type' => 'checkbox', |
|
| 41 | 'multiple' => 0, |
|
| 42 | 'allow_null' => 0, |
|
| 43 | //'load_save_terms' => 0, // removed in 5.2.7 |
|
| 44 | 'return_format' => 'id', |
|
| 45 | 'add_term' => 1, // 5.2.3 |
|
| 46 | 'load_terms' => 0, // 5.2.7 |
|
| 47 | 'save_terms' => 0 // 5.2.7 |
|
| 48 | ); |
|
| 49 | ||
| 50 | ||
| 51 | // extra |
|
| 52 | add_action('wp_ajax_acf/fields/taxonomy/query', array($this, 'ajax_query')); |
|
| 53 | add_action('wp_ajax_nopriv_acf/fields/taxonomy/query', array($this, 'ajax_query')); |
|
| 54 | add_action('wp_ajax_acf/fields/taxonomy/add_term', array($this, 'ajax_add_term')); |
|
| 55 | ||
| 56 | ||
| 57 | // do not delete! |
|
| 58 | parent::__construct(); |
|
| 59 | ||
| 60 | } |
|
| 61 | ||
| 62 | ||
| 63 | /* |
|