public static function image_source($id, $field) { $field = wp_parse_args($field, array('default' => 'none')); $sources = mom_su_Tools::select(array('options' => array('media' => __('Media library', 'theme'), 'posts: recent' => __('Recent posts', 'theme'), 'category' => __('Category', 'theme'), 'taxonomy' => __('Taxonomy', 'theme')), 'selected' => '0', 'none' => __('Select images source', 'theme') . '…', 'class' => 'mom-su-generator-isp-sources')); $categories = mom_su_Tools::select(array('options' => mom_su_Tools::get_terms('category'), 'multiple' => true, 'size' => 10, 'class' => 'mom-su-generator-isp-categories')); $taxonomies = mom_su_Tools::select(array('options' => mom_su_Tools::get_taxonomies(), 'none' => __('Select taxonomy', 'theme') . '…', 'selected' => '0', 'class' => 'mom-su-generator-isp-taxonomies')); $terms = mom_su_Tools::select(array('class' => 'mom-su-generator-isp-terms', 'multiple' => true, 'size' => 10, 'disabled' => true, 'style' => 'display:none')); $return = '<div class="mom-su-generator-isp">' . $sources . '<div class="mom-su-generator-isp-source mom-su-generator-isp-source-media"><div class="mom-su-generator-clearfix"><a href="javascript:;" class="button button-primary mom-su-generator-isp-add-media"><i class="fa fa-plus"></i> ' . __('Add images', 'theme') . '</a></div><div class="mom-su-generator-isp-images mom-su-generator-clearfix"><em class="description">' . __('Click the button above and select images.<br>You can select multimple images with Ctrl (Cmd) key', 'theme') . '</em></div></div><div class="mom-su-generator-isp-source mom-su-generator-isp-source-category"><em class="description">' . __('Select categories to retrieve posts from.<br>You can select multiple categories with Ctrl (Cmd) key', 'theme') . '</em>' . $categories . '</div><div class="mom-su-generator-isp-source mom-su-generator-isp-source-taxonomy"><em class="description">' . __('Select taxonomy and it\'s terms.<br>You can select multiple terms with Ctrl (Cmd) key', 'theme') . '</em>' . $taxonomies . $terms . '</div><input type="hidden" name="' . $id . '" value="' . $field['default'] . '" id="mom-su-generator-attr-' . $id . '" class="mom-su-generator-attr" /></div>'; return $return; }
public static function ajax_get_taxonomies() { self::access(); $args = array(); $args['options'] = mom_su_Tools::get_taxonomies(); die(mom_su_Tools::select($args)); }