Beispiel #1
0
 /**
  * Tweaks row attributes on edit
  *
  * @since 3.0.0
  */
 public function edit_form_fields($atts)
 {
     // Parse ID
     if (empty($atts['el_id']) && !empty($atts['id'])) {
         $atts['el_id'] = $atts['id'];
         unset($atts['id']);
     }
     // Parse $typo_style into $typography_style
     if (empty($atts['typography_style']) && !empty($atts['typo_style'])) {
         if (in_array($atts['typo_style'], array_flip(wpex_typography_styles()))) {
             $atts['typography_style'] = $atts['typo_style'];
             unset($atts['typo_style']);
         }
     }
     // Remove old style param and add it to the classes field
     $style = isset($atts['style']) ? $atts['style'] : '';
     if ($style && ('bordered' == $style || 'boxed' == $style)) {
         if (!empty($atts['el_class'])) {
             $atts['el_class'] .= ' ' . $style . '-column';
         } else {
             $atts['el_class'] = $style . '-column';
         }
         unset($atts['style']);
     }
     // Parse css
     if (empty($atts['css'])) {
         // Convert deprecated fields to css field
         $atts['css'] = vcex_parse_deprecated_row_css($atts);
         // Unset deprecated vars
         unset($atts['bg_image']);
         unset($atts['bg_color']);
         unset($atts['margin_top']);
         unset($atts['margin_bottom']);
         unset($atts['margin_right']);
         unset($atts['margin_left']);
         unset($atts['padding_top']);
         unset($atts['padding_bottom']);
         unset($atts['padding_right']);
         unset($atts['padding_left']);
         unset($atts['border_width']);
         unset($atts['border_style']);
         unset($atts['border_color']);
     }
     // Return $atts
     return $atts;
 }
Beispiel #2
0
/**
 * Returns correct typography style class
 *
 * @since  2.0.2
 * @return string
 */
function wpex_typography_style_class($style)
{
    $class = '';
    if ($style && 'none' != $style && array_key_exists($style, wpex_typography_styles())) {
        $class = 'typography-' . $style;
    }
    return $class;
}
Beispiel #3
0
 /**
  * Tweaks row attributes on edit
  *
  * @since 2.0.2
  */
 public function edit_form_fields($atts)
 {
     // Parse ID
     if (empty($atts['el_id']) && !empty($atts['id'])) {
         $atts['el_id'] = $atts['id'];
         unset($atts['id']);
     }
     // Parse $style into $typography_style
     if (empty($atts['typography_style']) && !empty($atts['style'])) {
         if (in_array($atts['style'], array_flip(wpex_typography_styles()))) {
             $atts['typography_style'] = $atts['style'];
             unset($atts['style']);
         }
     }
     // Parse parallax
     if (!empty($atts['parallax'])) {
         if (in_array($atts['parallax'], array('simple', 'advanced', 'true'))) {
             $atts['parallax'] = 'vcex_parallax';
         }
     } elseif (empty($atts['parallax']) && !empty($atts['bg_style'])) {
         if ('parallax' == $atts['bg_style'] || 'parallax-advanced' == $atts['bg_style']) {
             $atts['parallax'] = 'vcex_parallax';
             unset($atts['bg_style']);
         }
     }
     // Parse video background
     if (!empty($atts['video_bg']) && 'yes' == $atts['video_bg']) {
         $atts['video_bg'] = 'self_hosted';
     }
     // Convert 'no-margins' to '0px' column_spacing
     if (empty($this->atts['column_spacing']) && !empty($atts['no_margins']) && 'true' == $atts['no_margins']) {
         $atts['column_spacing'] = '0px';
         unset($atts['no_margins']);
     }
     // Parse css
     if (empty($atts['css'])) {
         // Convert deprecated fields to css field
         $atts['css'] = vcex_parse_deprecated_row_css($atts);
         // Unset deprecated vars
         unset($atts['bg_image']);
         unset($atts['bg_color']);
         unset($atts['margin_top']);
         unset($atts['margin_bottom']);
         unset($atts['margin_right']);
         unset($atts['margin_left']);
         unset($atts['padding_top']);
         unset($atts['padding_bottom']);
         unset($atts['padding_right']);
         unset($atts['padding_left']);
         unset($atts['border_width']);
         unset($atts['border_style']);
         unset($atts['border_color']);
     }
     // Return $atts
     return $atts;
 }