s( $post_id, $ri, $ci, $wi, '> .panel-widget-style', $standard_css ); } if ( ! empty( $tablet_css ) ) { $css->add_widget_css( $post_id, $ri, $ci, $wi, '> .panel-widget-style', $tablet_css, "$tablet_width:$mobile_width" ); } if ( ! empty( $mobile_css ) ) { $css->add_widget_css( $post_id, $ri, $ci, $wi, '> .panel-widget-style', $mobile_css, $mobile_width ); } if ( ! empty( $widget['panels_info']['style']['link_color'] ) ) { $css->add_widget_css( $post_id, $ri, $ci, $wi, ' a', array( 'color' => $widget['panels_info']['style']['link_color'], ) ); } if ( ! empty( $widget['panels_info']['style']['link_color_hover'] ) ) { $css->add_widget_css( $post_id, $ri, $ci, $wi, ' a:hover', array( 'color' => $widget['panels_info']['style']['link_color_hover'], ) ); } if ( ! empty( $widget['panels_info']['style']['box_shadow_hover'] ) && ! empty( $widget['panels_info']['style']['box_shadow_hover_color'] ) ) { $css->add_widget_css( $post_id, $ri, $ci, $wi, '> .panel-widget-style:hover', self::generate_box_shadow_css( 'box_shadow_hover', $widget['panels_info']['style'] ) ); } } } } return $css; } /** * Add in custom styles for the row's bottom margin. * * @return mixed */ public static function filter_row_bottom_margin( $margin, $grid ) { if ( ! empty( $grid['style']['bottom_margin'] ) ) { $margin = $grid['style']['bottom_margin']; } return $margin; } /** * Add in custom styles for spacing between cells in a row. * * @return mixed */ public static function filter_row_cell_bottom_margin( $margin, $cell, $ci, $row, $ri ) { if ( ! empty( $row['style']['mobile_cell_margin'] ) ) { $margin = $row['style']['mobile_cell_margin']; } return $margin; } public static function filter_widget_mobile_margin( $margin, $widget, $wi, $panels_data, $post_id ) { if ( ! empty( $widget['style']['mobile_margin'] ) ) { $margin = $widget['style']['mobile_margin']; } return $margin; } /** * Add in custom styles for a row's mobile bottom margin. * * @return mixed */ public static function filter_row_mobile_bottom_margin( $margin, $grid ) { if ( ! empty( $grid['style']['mobile_bottom_margin'] ) ) { $margin = $grid['style']['mobile_bottom_margin']; } return $margin; } public static function filter_row_gutter( $gutter, $grid ) { if ( ! empty( $grid['style']['gutter'] ) ) { $gutter = $grid['style']['gutter']; } return $gutter; } /** * Adds widget specific styles not included in the general style fields. * * @param $widget_css The CSS properties and values. * @param $widget_style_data The style settings as obtained from the style fields. * * @return mixed */ public static function filter_widget_style_css( $widget_css, $widget_style_data ) { if ( ! empty( $widget_style_data['margin'] ) && ! siteorigin_panels_setting( 'inline-styles' ) ) { $widget_css['margin'] = $widget_style_data['margin']; } return $widget_css; } public static function get_attachment_image_src( $image, $size = 'full' ) { if ( empty( $image ) ) { return false; } elseif ( is_numeric( $image ) ) { return wp_get_attachment_image_src( $image, $size ); } elseif ( is_string( $image ) ) { preg_match( '/(.*?)\#([0-9]+)x([0-9]+)$/', $image, $matches ); return ! empty( $matches ) ? $matches : false; } } }