/** * Output an image upload control. * * @since 0.1.0 * @param string $handle The image upload control name. * @param string $id ID of the selected attachment. * @param array $args An array of arguments for the control. */ function ev_image_upload($handle, $id, $args = array()) { $args = wp_parse_args($args, array('thumb_size' => '', 'density' => '1', 'breakpoint' => 'desktop', 'multiple' => false, 'sortable' => false, 'densities' => array(), 'breakpoints' => array())); $thumb_size = $args['thumb_size']; $density = $args['density']; $breakpoint = $args['breakpoint']; $multiple = (bool) $args['multiple']; $sortable = (bool) $args['sortable']; $densities = $args['densities']; $breakpoints = $args['breakpoints']; ev_template(EV_FRAMEWORK_TEMPLATES_FOLDER . 'fields/partials/image_upload', array('id' => $id, 'handle' => $handle, 'density' => $density, 'breakpoint' => $breakpoint, 'thumb_size' => $thumb_size, 'multiple' => $multiple, 'sortable' => $sortable, 'densities' => $densities, 'breakpoints' => $breakpoints)); }
/** * Get contents from a partial template. If we're in a child theme, the * function will attempt to look for the resource in the child theme directory * first. * * @since 0.1.0 * @param string $file The template file. * @param array $data The data array to be passed to the template. * @param boolean $echo True to echo the template part. * @return string */ function ev_get_template_part($file, $data = array(), $echo = true) { $file = ev_string_ensure_right($file, '.php'); $path = locate_template($file); return ev_template($path, $data, $echo); }
/** * Render the field inner content. * * @since 0.1.0 * @param Ev_Field $field A field object. */ public function render_inner($field = false) { if ($field === false) { $field = $this; } echo '<div class="ev-field-inner">'; echo '<div class="ev-field-panel-controls-wrapper">'; echo '<div class="ev-field-panel-controls-inner-wrapper">'; echo '<span class="ev-repeatable-remove"></span>'; echo '<span class="ev-sortable-handle"></span>'; echo '</div>'; echo '</div>'; if ($this->_bundle === false && !ev_is_skipped_on_saving($this->_type)) { $this->_render_repeatable_controls('prepend'); } $template = EV_FRAMEWORK_TEMPLATES_FOLDER . "fields/{$this->_type}"; $template = apply_filters("ev_field_template[type:{$this->_type}]", $template); ev_template($template, array('field' => $field)); if ($this->_bundle === false && !ev_is_skipped_on_saving($this->_type)) { $this->_render_repeatable_controls('append'); } echo '</div>'; }
/** * Render the field inner content. * * @since 0.1.0 * @param Ev_Field $field A field object. */ public function render_inner($field = false) { if ($field === false) { $field = $this; } echo '<div class="ev-field-inner">'; echo '<span class="ev-sortable-handle"></span>'; $template = EV_FRAMEWORK_TEMPLATES_FOLDER . "fields/{$this->_type}"; $template = apply_filters("ev_field_template[type:{$this->_type}]", $template); ev_template($template, array('field' => $field)); echo '<span class="ev-repeatable-remove"></span>'; echo '</div>'; }