public function add_js_defaults($data) { $newdata = array('defaults' => self::default_properties(), 'template' => upfront_get_template_url('uaccordion', upfront_element_url('tpl/uaccordion.html', dirname(__FILE__)))); if (isset($data['uaccordion'])) { if (isset($data['uaccordion']['defaults'])) { $merged_defaults = array_merge($data['uaccordion']['defaults'], $newdata['defaults']); $data['uaccordion']['defaults'] = $merged_defaults; } else { $data['uaccordion']['defaults'] = $newdata['defaults']; } $data['uaccordion']['template'] = $newdata['template']; } else { $data['uaccordion'] = $newdata; } return $data; }
public function add_js_defaults($data) { $post_types = get_post_types(array('public' => true), 'objects'); $labels = get_terms('media_label', array('hide_empty' => false)); $labels_names = array(); $labels_ids = array(); foreach ($labels as $label) { if (!is_object($label)) { continue; } $labels_ids[$label->term_id] = array('id' => $label->term_id, 'text' => $label->name); $labels_names[$label->name] = array('id' => $label->term_id, 'text' => $label->name); } // Sanitize post type objects array foreach ($post_types as $ptidx => $ptype) { if (empty($ptype->register_meta_box_cb)) { continue; } $ptype->register_meta_box_cb = false; $post_types[$ptidx] = $ptype; } // Whatever we need in the post types array, I am fairly sure metabox callback is *NOT* one of those things... $data['ugallery'] = array('defaults' => self::default_properties(), 'imageDefaults' => self::image_defaults(), 'template' => upfront_get_template_url('ugallery', upfront_element_url('tpl/ugallery.html', dirname(__FILE__))), 'lightboxTpl' => upfront_get_template('lightbox', array(), dirname(dirname(__FILE__)) . '/tpl/lightbox.html'), 'postTypes' => $post_types, 'grids' => array(), 'label_names' => $labels_names, 'label_ids' => $labels_ids, 'themeDefaults' => apply_filters('upfront_gallery_defaults', array())); return $data; }
public function add_js_defaults($data) { $data['uimage'] = array('defaults' => self::default_properties(), 'template' => upfront_get_template_url('uimage', upfront_element_url('tpl/image.html', dirname(__FILE__)))); return $data; }
public static function add_js_defaults($data) { $data['uslider'] = array('defaults' => self::default_properties(), 'slideDefaults' => self::slide_defaults(), 'template' => upfront_get_template_url('uslider', upfront_element_url('tpls/uslider.html', dirname(__FILE__)))); return $data; }