Exemplo n.º 1
0
 /**
  * @param $attr
  * @param $value
  *
  * @since 4.3
  * @return array
  */
 public function _vc_google_fonts_parse_attributes($attr, $value)
 {
     $fields = array();
     if (is_array($attr) && !empty($attr)) {
         foreach ($attr as $key => $val) {
             if (is_numeric($key)) {
                 $fields[$val] = '';
             } else {
                 $fields[$key] = $val;
             }
         }
     }
     $values = vc_parse_multi_attribute($value, array('font_family' => isset($fields['font_family']) ? $fields['font_family'] : '', 'font_style' => isset($fields['font_style']) ? $fields['font_style'] : '', 'font_family_description' => isset($fields['font_family_description']) ? $fields['font_family_description'] : '', 'font_style_description' => isset($fields['font_style_description']) ? $fields['font_style_description'] : ''));
     return array('fields' => $fields, 'values' => $values);
 }
Exemplo n.º 2
0
/**
 * Parses the font_control / typography param
 *
 * @since 2.0.0
 */
function vcex_parse_typography_param($value)
{
    // Conter value to array
    $value = vc_parse_multi_attribute($value);
    // Define defaults
    $defaults = array('tag' => '', 'text_align' => '', 'font_size' => '', 'line_height' => '', 'color' => '', 'font_style_italic' => '', 'font_style_bold' => '', 'font_family' => '', 'letter_spacing' => '', 'font_family' => '');
    // Parse values so keys exist
    $values = wp_parse_args($value, $defaults);
    // Return values
    return $values;
}
Exemplo n.º 3
0
/**
 * @param $value
 *
 * @since 4.2
 * @return array
 */
function vc_build_link($value)
{
    return vc_parse_multi_attribute($value, array('url' => '', 'title' => '', 'target' => ''));
}
Exemplo n.º 4
0
 /**
  * @param $attr
  * @param $value
  *
  * @return array
  */
 public function _vc_font_container_parse_attributes($attr, $value)
 {
     $fields = array();
     if (isset($attr)) {
         foreach ($attr as $key => $val) {
             if (is_numeric($key)) {
                 $fields[$val] = "";
             } else {
                 $fields[$key] = $val;
             }
         }
     }
     $values = vc_parse_multi_attribute($value, array('tag' => isset($fields['tag']) ? $fields['tag'] : 'h2', 'font_size' => isset($fields['font_size']) ? $fields['font_size'] : '', 'font_style_italic' => isset($fields['font_style_italic']) ? $fields['font_style_italic'] : '', 'font_style_bold' => isset($fields['font_style_bold']) ? $fields['font_style_bold'] : '', 'font_family' => isset($fields['font_family']) ? $fields['font_family'] : '', 'color' => isset($fields['color']) ? $fields['color'] : '', 'line_height' => isset($fields['line_height']) ? $fields['line_height'] : '', 'text_align' => isset($fields['text_align']) ? $fields['text_align'] : 'left', 'tag_description' => isset($fields['tag_description']) ? $fields['tag_description'] : '', 'font_size_description' => isset($fields['font_size_description']) ? $fields['font_size_description'] : '', 'font_style_description' => isset($fields['font_style_description']) ? $fields['font_style_description'] : '', 'font_family_description' => isset($fields['font_family_description']) ? $fields['font_family_description'] : '', 'color_description' => isset($fields['color_description']) ? $fields['color_description'] : 'left', 'line_height_description' => isset($fields['line_height_description']) ? $fields['line_height_description'] : '', 'text_align_description' => isset($fields['text_align_description']) ? $fields['text_align_description'] : ''));
     return array('fields' => $fields, 'values' => $values);
 }