示例#1
0
/**
 * Return an array of Mm Blockquote templates for use in a Visual Composer param.
 *
 * @since   1.0.0
 *
 * @param   string  $context  The context to pass to our filter.
 *
 * @return  array             The array of template names.
 */
function mm_get_mm_blockquote_templates_for_vc($context = '')
{
    return array_flip(mm_get_mm_blockquote_templates($context));
}
示例#2
0
 /**
  * Output the Widget settings form.
  *
  * @since  1.0.0
  *
  * @param  array  $instance  The options for the widget instance.
  */
 public function form($instance)
 {
     $defaults = array('title' => '', 'template' => '', 'content' => '', 'citation' => '', 'link_citation' => '', 'image_id' => '', 'citation_link' => '', 'citation_link_text' => '');
     // Use our instance args if they are there, otherwise use the defaults.
     $instance = wp_parse_args($instance, $defaults);
     $title = $instance['title'];
     $template = $instance['template'];
     $quote = $instance['content'];
     $citation = $instance['citation'];
     $link_citation = $instance['link_citation'];
     $citation_link = $instance['citation_link'];
     $citation_link_text = $instance['citation_link_text'];
     $image_id = $instance['image_id'];
     $classname = $this->options['classname'];
     $templates = mm_get_mm_blockquote_templates('mm-blockquote');
     // Title.
     $this->field_text(__('Title', 'mm-components'), '', $classname . '-title widefat', 'title', $title);
     // Template
     $this->field_select(__('Template', 'mm-components'), '', $classname . '-template widefat', 'template', $template, $templates);
     // Quote.
     $this->field_textarea(__('Quote', 'mm-components'), '', $classname . '-quote widefat', 'content', $quote);
     // Citation.
     $this->field_text(__('Citation', 'mm-components'), '', $classname . '-citation widefat', 'citation', $citation);
     $this->field_checkbox(__('Link citation?', 'mm-components'), '', $classname . '-link-citation widefat', 'link_citation', $link_citation);
     // Citation Link.
     $this->field_text(__('Citation Link', 'mm-components'), '', $classname . '-citation-link widefat', 'citation_link', $citation_link);
     // Citation URL
     $this->field_text(__('Citation Link Text', 'mm-components'), '', $classname . '-citation-link-text widefat', 'citation_link_text', $citation_link_text);
     // Image.
     $this->field_single_media(__('Image', 'mm-components'), __('Select an image from the library.', 'mm-components'), $classname . '-image widefat', 'image_id', $image_id);
 }