0 ) { foreach ( $custom_options as $key => $custom_option ) { /*Aside*/ if ( isset( $custom_option['as_color'] ) || isset( $custom_option['as_bgcolor'] ) ) { $custom_metabox_css .= "#post-{$key}.format-aside .post-group-cell span, #post-{$key}.format-aside .post-group-cell p, #post-{$key}.format-aside .post-media .fa {"; $custom_metabox_css .= ! empty( $custom_option['as_color'] ) ? 'color:'. $custom_option['as_color'].';' :'color: #333333;'; $custom_metabox_css .= "}"; $custom_metabox_css .= "#post-{$key}.format-aside .overlay, #post-{$key}.format-aside .post-media .fa {"; $custom_metabox_css .= ! empty( $custom_option['as_bgcolor'] ) ? 'background-color:'. $custom_option['as_bgcolor'].';' :'background-color: #eeeeee;'; $custom_metabox_css .= "}"; } /*Quote*/ if ( isset( $custom_option['q_color'] ) || isset( $custom_option['q_bgcolor'] ) || isset( $custom_option['q_media'] ) ) { $custom_metabox_css .= "#post-{$key} .quote-photo {"; $custom_metabox_css .= ! empty( $custom_option['q_media'] ) ? 'background-image:url( '. $custom_option['q_media'].' );' :''; $custom_metabox_css .= "}"; $custom_metabox_css .= "#post-{$key}.format-quote .post-group-cell span, #post-{$key}.format-quote .post-media .fa {"; $custom_metabox_css .= ! empty( $custom_option['q_color'] ) ? 'color:'. $custom_option['q_color'].';' :'color: #333333;'; $custom_metabox_css .= "}"; $custom_metabox_css .= "#post-{$key}.format-quote .overlay, #post-{$key}.format-quote .post-media .fa {"; $custom_metabox_css .= ! empty( $custom_option['q_bgcolor'] ) ? 'background-color:'. $custom_option['q_bgcolor'].';' :'background-color: #eeeeee;'; $custom_metabox_css .= "}"; $custom_metabox_css .= "#post-{$key}.format-quote .author {"; $custom_metabox_css .= ! empty( $custom_option['q_color'] ) ? 'border-color:'. $custom_option['q_color'].';' :'border-color: #333333;'; $custom_metabox_css .= "}"; } /*Link*/ if ( isset( $custom_option['l_font'] ) || isset( $custom_option['l_span_font'] ) || isset( $custom_option['l_text_align'] ) || isset( $custom_option['l_color'] ) || isset( $custom_option['l_span_color'] ) || isset( $custom_option['l_bgcolor'] ) || isset( $custom_option['l_media'] ) ) { $custom_metabox_css .= "#post-{$key} .link-text {"; $custom_metabox_css .= ! empty( $custom_option['l_text_align'] ) ? 'text-align:'. $custom_option['l_text_align'].';' :'text-align: left'; $custom_metabox_css .= "}"; $custom_metabox_css .= "#post-{$key}.format-link .post-media .fa {"; $custom_metabox_css .= ! empty( $custom_option['l_color'] ) ? 'color:'. $custom_option['l_color'].';' :'color: #ffffff;'; $custom_metabox_css .= "}"; $custom_metabox_css .= "#post-{$key} .link-text header {"; $custom_metabox_css .= ! empty( $custom_option['l_color'] ) ? 'color:'. $custom_option['l_color'].';' :'color: #ffffff;'; $custom_metabox_css .= ! empty( $custom_option['l_font'] ) ? 'font-size:'. $custom_option['l_font'].'px;' :'font-size: 40px;'; $custom_metabox_css .= "}"; $custom_metabox_css .= "#post-{$key} .link-text span {"; $custom_metabox_css .= ! empty( $custom_option['l_span_color'] ) ? 'color:'. $custom_option['l_span_color'].';' :'color: #ffffff;'; $custom_metabox_css .= ! empty( $custom_option['l_span_font'] ) ? 'font-size:'. $custom_option['l_span_font'].'px;' :'font-size: 14px;'; $custom_metabox_css .= "}"; $custom_metabox_css .= "#post-{$key} .format-link .overlay, #post-{$key}.format-link .post-media .fa {"; $custom_metabox_css .= ! empty( $custom_option['l_bgcolor'] ) ? 'background-color:'. $custom_option['l_bgcolor'].';' :'background-color: #eeeeee;'; $custom_metabox_css .= "}"; } /*Image*/ if ( isset( $custom_option['i_color'] ) || isset( $custom_option['i_bgcolor'] ) ) { $custom_metabox_css .= "#post-{$key}.format-image .caption-title a, #post-{$key}.format-image .caption-excerpt p, #post-{$key}.format-image .post-media .fa {"; $custom_metabox_css .= ! empty( $custom_option['i_color'] ) ? 'color:'. $custom_option['i_color'].';' :'color: #ffffff;'; $custom_metabox_css .= "}"; $custom_metabox_css .= "#post-{$key}.format-image .caption-background, #post-{$key}.format-image .overlay, #post-{$key}.format-image .post-media .fa {"; $custom_metabox_css .= ! empty( $custom_option['i_bgcolor'] ) ? 'background-color:'. $custom_option['i_bgcolor'].';' :'background-color: #1e6864;'; $custom_metabox_css .= "}"; } /*Gallery*/ if ( isset( $custom_option['g_color'] ) || isset( $custom_option['g_bgcolor'] ) ) { $custom_metabox_css .= "#post-{$key}.format-gallery .wp-caption-text, #post-{$key}.format-gallery .gallery-caption, #post-{$key}.format-gallery .post-media .fa, .format-gallery .gallery-item:before {"; $custom_metabox_css .= ! empty( $custom_option['g_color'] ) ? 'color:'. $custom_option['g_color'].';' :'color: #ffffff;'; $custom_metabox_css .= "}"; $custom_metabox_css .= "#post-{$key}.format-gallery .bglayer, #post-{$key}.format-gallery .landscape, #post-{$key}.format-gallery.portrait, #post-{$key}.format-gallery .post-media .fa, #post-{$key}.format-gallery .carousel-control .fa:before, #post-{$key}.format-gallery .carousel-indicators li.active {"; $custom_metabox_css .= ! empty( $custom_option['g_bgcolor'] ) ? 'background-color:'. $custom_option['g_bgcolor'].';' :'background-color: #1e6864;'; $custom_metabox_css .= "}"; $custom_metabox_css .= "#post-{$key}.format-gallery .carousel-indicators li {"; $custom_metabox_css .= ! empty( $custom_option['g_bgcolor'] ) ? 'border-color:'. $custom_option['g_bgcolor'].';' :'border-color: #1e6864;'; $custom_metabox_css .= "}"; } /*Audio*/ if ( isset( $custom_option['a_bgcolor'] ) ) { $custom_metabox_css .= "#post-{$key} .mejs-container, #post-{$key} .mejs-container .mejs-controls, #post-{$key} .mejs-embed, .mejs-embed body, #post-{$key}.format-audio .post-media .fa {"; $custom_metabox_css .= ! empty( $custom_option['a_bgcolor'] ) ? 'background:'. $custom_option['a_bgcolor'].';' :'background: #1e6864;'; $custom_metabox_css .= "}"; } $i++; } } wp_add_inline_style( PASSPORT_THEME_SLUG . '-custom-style', $custom_metabox_css); } } add_action( 'wp_enqueue_scripts', 'passport_metabox_inline_style' );