| @@ -1,350 +1,102 @@ | ||
| 1 | 1 | <?php |
| 2 | - if(!function_exists('blockspare_flash_render_block')){ | |
| 3 | - function blockspare_flash_render_block($attributes) | |
| 4 | - { | |
| 5 | - ob_start(); | |
| 6 | - $unq_class = mt_rand(100000,999999); | |
| 7 | - $blockuniqueclass = ''; | |
| 8 | - | |
| 9 | - if(!empty($attributes['uniqueClass'])){ | |
| 10 | - $blockuniqueclass = $attributes['uniqueClass']; | |
| 11 | - }else{ | |
| 12 | - $blockuniqueclass = 'blockspare-posts-block-list-'.$unq_class; | |
| 13 | - } | |
| 14 | - | |
| 15 | - | |
| 16 | - | |
| 17 | - if ( isset( $attributes['categories'] ) && ! empty( $attributes['categories'] ) && is_array( $attributes['categories'] ) ) { | |
| 18 | - $categories = array(); | |
| 19 | - $i = 1; | |
| 20 | - foreach ( $attributes['categories'] as $key => $value ) { | |
| 21 | - $categories[] = $value['value']; | |
| 22 | - } | |
| 23 | - } else { | |
| 24 | - $categories = array(); | |
| 25 | - } | |
| 26 | - | |
| 27 | - if ( isset( $attributes['tags'] ) && ! empty( $attributes['tags'] ) && is_array( $attributes['tags'] ) ) { | |
| 28 | - $tags = array(); | |
| 29 | - $i = 1; | |
| 30 | - foreach ( $attributes['tags'] as $key => $value ) { | |
| 31 | - $tags[] = $value['value']; | |
| 32 | - } | |
| 33 | - } else { | |
| 34 | - $tags = array(); | |
| 35 | - } | |
| 36 | - | |
| 37 | - /* Setup the query */ | |
| 38 | - | |
| 39 | - $query_args = array( | |
| 40 | - 'posts_per_page' => $attributes['postsToShow'], | |
| 41 | - 'post_status' => 'publish', | |
| 42 | - 'order' => $attributes['order'], | |
| 43 | - 'orderby' => $attributes['orderBy'], | |
| 44 | - 'offset' => $attributes['offset'], | |
| 45 | - 'post_type' => $attributes['postType'], | |
| 46 | - 'ignore_sticky_posts' => 1, | |
| 47 | - ); | |
| 48 | - | |
| 49 | - if($attributes['taxType'] =='category'){ | |
| 50 | - $query_args['category__in'] =$categories; | |
| 51 | - | |
| 52 | - } | |
| 53 | - if($attributes['taxType'] =='post_tag'){ | |
| 54 | - $query_args['tag__in'] =$tags; | |
| 55 | - | |
| 56 | - } | |
| 57 | - | |
| 58 | - | |
| 59 | - if($attributes['taxType'] !='category' && $attributes['taxType'] != 'post_tag'){ | |
| 60 | - | |
| 61 | - $tax_type = $attributes['taxType']; | |
| 62 | - if ( $tax_type ) { | |
| 63 | - $query_args['tax_query'][] = array( | |
| 64 | - 'taxonomy' => ( isset( $tax_type ) ) ? $tax_type : 'category', | |
| 65 | - 'field' => 'id', | |
| 66 | - 'terms' => $categories, | |
| 67 | - 'operator' => 'IN' , | |
| 68 | - ); | |
| 69 | - } | |
| 70 | - } | |
| 2 | +if (!function_exists('latest_posts_style_control_flash')) { | |
| 3 | + function latest_posts_style_control_flash($blockuniqueclass, $attributes) | |
| 4 | + { | |
| 71 | 5 | |
| 72 | - $grid_query = new WP_Query($query_args); | |
| 73 | - | |
| 74 | - | |
| 75 | - | |
| 76 | - $responsivelayoutTab = 1; | |
| 77 | - $responsivelayoutMobile = 1; | |
| 78 | - $verticals = false; | |
| 79 | 6 | |
| 80 | - if($attributes['carouselType']=='vertical'){ | |
| 81 | - $verticals = true; | |
| 82 | - } | |
| 83 | - | |
| 84 | - | |
| 85 | - | |
| 86 | - | |
| 87 | - | |
| 88 | - | |
| 89 | - /* Start the loop */ | |
| 90 | - if ($grid_query->have_posts()) { | |
| 91 | - $alignclass = blockspare_checkalignment($attributes['align']); | |
| 92 | - /* Build the block classes */ | |
| 93 | - $class = 'align'.$alignclass; | |
| 94 | - | |
| 95 | - if (isset($attributes['class'])) { | |
| 96 | - $class .= ' ' . $attributes['class']; | |
| 97 | - } | |
| 98 | - if( $attributes['animation']){ | |
| 99 | - $class .= ' blockspare-block-animation ' . $attributes['animation']; | |
| 100 | - } | |
| 101 | - | |
| 102 | - | |
| 103 | - | |
| 104 | - | |
| 105 | - //$list_layout_class = $attributes['trending']; | |
| 106 | - $listgridClass = 'blockspare-posts-block-is-carousel' ; | |
| 107 | - | |
| 108 | - /* Layout orientation class */ | |
| 109 | - $block_post_wrap = $blockuniqueclass . ' blockspare-posts-block-post-wrap'; | |
| 110 | - $count = 0; | |
| 111 | - $layout_class = 'bs-flash-wrap flash-layout ' . $attributes['layoutStyle']; | |
| 112 | - | |
| 113 | - $exclusive_posts = 'bs-exclusive-posts'; | |
| 114 | - if($attributes['border']){ | |
| 115 | - $exclusive_posts .= ' bs-border-enabled bs-' . $attributes['borderStyle']; | |
| 116 | - } else { | |
| 117 | - $exclusive_posts .= ' bs-border-disabled'; | |
| 118 | - } | |
| 119 | - $flash_spiner_class = 'bs-spinner '; | |
| 120 | - if($attributes['spinnerOption']=='spinner-option-1'){ | |
| 121 | - $flash_spiner_class .= $attributes['spinnerStyle']; | |
| 122 | - }else{ | |
| 123 | - $flash_spiner_class .= $attributes['animationStyle']; | |
| 124 | - } | |
| 125 | - $spinner_icon = $attributes['spinnerIcon']; | |
| 126 | - $marquee_class = 'marquee bs-flash-side ' . $attributes['direction']; | |
| 127 | - if($attributes['pauseOnHover']){ | |
| 128 | - $marquee_class .= ' pause-on-hover'; | |
| 129 | - } | |
| 130 | - ?> | |
| 131 | - | |
| 132 | -<div class="<?php echo esc_attr($class);?>"> | |
| 133 | - <section class="<?php echo esc_attr($block_post_wrap);?>"> | |
| 134 | - <div class="<?php echo esc_attr($layout_class);?>"> | |
| 135 | - <div class="<?php echo esc_attr($exclusive_posts);?>"> | |
| 136 | - <div class="bs-exclusive-now"> | |
| 137 | - <?php if($attributes['exclusiveSubtitle']){?> | |
| 138 | - <span class="bs-exclusive-news-title"><?php echo esc_html($attributes['exclusiveSubtitleText']); ?></span> | |
| 139 | - <?php }?> | |
| 140 | - <div class="bs-exclusive-now-txt-animation-wrap"> | |
| 141 | - <?php if($attributes['spinner']){?> | |
| 142 | - <span class="<?php echo esc_attr($flash_spiner_class); ?>"> | |
| 143 | - <?php if($attributes['spinnerOption'] == 'spinner-option-1') {?> | |
| 144 | - <div class="ring"></div> | |
| 145 | - <div class="ring"></div> | |
| 146 | - <div class="ring"></div> | |
| 147 | - <div class="ring"></div> | |
| 148 | - <div class="ring"></div> | |
| 149 | - <?php } else {?> | |
| 150 | - <i class="<?php echo esc_attr($spinner_icon);?>"></i> | |
| 151 | - <?php }?> | |
| 152 | - </span> | |
| 153 | - <?php }?> | |
| 154 | - <span class="bs-exclusive-texts-wrapper"> | |
| 155 | - <?php echo $attributes['exclusiveText'] != "" ? $attributes['exclusiveText'] : "Breaking News";?> | |
| 156 | - </span> | |
| 157 | - </div> | |
| 158 | - </div> | |
| 159 | - <div class="bs-exclusive-slides"> | |
| 160 | - <div class="<?php echo esc_attr($marquee_class);?>"> | |
| 161 | - <div class="bs-marquee-wrapper"> | |
| 162 | - <?php while ($grid_query->have_posts()) { | |
| 163 | - $grid_query->the_post(); | |
| 164 | - | |
| 165 | - $count++; | |
| 166 | - | |
| 167 | - /* Setup the post ID */ | |
| 168 | - $post_id = get_the_ID(); | |
| 169 | - | |
| 170 | - /* Setup the featured image ID */ | |
| 171 | - $post_thumb_id = get_post_thumbnail_id($post_id); | |
| 172 | - | |
| 173 | - | |
| 174 | - /* Setup the post classes */ | |
| 175 | - $post_classes = 'bs-post-title '; | |
| 176 | - | |
| 177 | - ?> | |
| 178 | - | |
| 179 | - <h4 class="<?php echo esc_attr($post_classes) ?>"> | |
| 180 | - <?php | |
| 181 | - | |
| 182 | - if (!empty($attributes['imageSize'])) { | |
| 183 | - $post_thumb_size = 'thumbnail '; | |
| 184 | - }?> | |
| 185 | - <a href="<?php echo esc_url(get_permalink($post_id));?>" rel="bookmark" aria-hidden="true" | |
| 186 | - tabindex="-1"> | |
| 187 | - <span class="bs-circle-marq"> | |
| 188 | - <?php if($attributes['enableCount']){?> | |
| 189 | - <span class="bs-trending-no"><?php echo esc_html( $count );?></span> | |
| 190 | - <?php }?> | |
| 191 | - <?php | |
| 192 | - if(has_post_thumbnail($post_id)){ | |
| 193 | - echo wp_kses_post(wp_get_attachment_image($post_thumb_id, $post_thumb_size)); | |
| 194 | - }else{?> | |
| 195 | - <div class="bs-no-thumbnail-img"> </div> | |
| 196 | - <?php } ?> | |
| 197 | - </span> | |
| 198 | - <span class="bs-post-title"> | |
| 199 | - <?php | |
| 200 | - $title = get_the_title($post_id); | |
| 201 | - | |
| 202 | - if (!$title) { | |
| 203 | - $title = __('Untitled', 'blockspare'); | |
| 204 | - } | |
| 205 | - | |
| 206 | - echo esc_html($title); | |
| 207 | - ?> | |
| 208 | - </span> | |
| 209 | - </a> | |
| 210 | - </h4> | |
| 211 | - <?php }?> | |
| 212 | - </div> | |
| 213 | - </div> | |
| 214 | - </div> | |
| 215 | - </div> | |
| 216 | - </div> | |
| 217 | - </section> | |
| 218 | -</div> | |
| 219 | -<?php wp_reset_postdata(); | |
| 220 | - $data_content = latest_posts_style_control_flash($blockuniqueclass ,$attributes); | |
| 221 | - $data_content .= ob_get_clean(); | |
| 222 | - return $data_content; | |
| 223 | - } | |
| 224 | - } | |
| 225 | -} | |
| 226 | - | |
| 227 | - /** | |
| 228 | - * Registers the post grid block on server | |
| 229 | - */ | |
| 230 | - if(!function_exists('blockspare_flash_register_block_core')){ | |
| 231 | - function blockspare_flash_register_block_core() | |
| 232 | - { | |
| 233 | - | |
| 234 | - if (!function_exists('register_block_type')) { | |
| 235 | - return; | |
| 236 | - } | |
| 237 | - | |
| 238 | - | |
| 239 | - ob_start(); | |
| 240 | - include BLOCKSPARE_PLUGIN_DIR . 'inc/latest-post-block/posts-flash/block.json'; | |
| 241 | - | |
| 242 | - $metadata = json_decode(ob_get_clean(), true); | |
| 243 | - | |
| 244 | - | |
| 245 | - /* Block attributes */ | |
| 246 | - register_block_type( | |
| 247 | - 'blockspare/latest-posts-flash', | |
| 248 | - array( | |
| 249 | - 'attributes' =>$metadata['attributes'], | |
| 250 | - 'render_callback' => 'blockspare_flash_render_block', | |
| 251 | - ) | |
| 252 | - ); | |
| 253 | - } | |
| 254 | - | |
| 255 | - add_action('init', 'blockspare_flash_register_block_core'); | |
| 256 | -} | |
| 257 | - | |
| 258 | - | |
| 259 | - | |
| 260 | - | |
| 261 | - if(!function_exists('latest_posts_style_control_flash')){ | |
| 262 | - function latest_posts_style_control_flash($blockuniqueclass ,$attributes) | |
| 263 | - { | |
| 264 | - | |
| 265 | - $boxshadowcss = ''; | |
| 266 | - | |
| 267 | - | |
| 268 | - | |
| 269 | - | |
| 270 | - | |
| 271 | - $block_content = ''; | |
| 272 | - $block_content .= '<style type="text/css">'; | |
| 273 | - | |
| 274 | - | |
| 275 | - //post-flash-background | |
| 276 | - if($attributes['background']) { | |
| 277 | - $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts{ | |
| 7 | + // Build CSS separately | |
| 8 | + $inline_css = ''; | |
| 9 | + $inline_css .= blockspare_visibility_css($attributes, $blockuniqueclass); | |
| 10 | + //post-flash-background | |
| 11 | + if ($attributes['background']) { | |
| 12 | + $inline_css .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts{ | |
| 278 | 13 | background-color:' . $attributes['backGroundColor'] . '; |
| 279 | 14 | }'; |
| 280 | - } | |
| 15 | + } | |
| 281 | 16 | |
| 282 | - //post-flash-border-radius | |
| 283 | - $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts, .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-now-txt-animation-wrap, .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-slides{ | |
| 17 | + //post-flash-border-radius | |
| 18 | + $inline_css .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts{ | |
| 284 | 19 | border-radius:' . $attributes['borderRadius'] . 'px; |
| 285 | 20 | }'; |
| 21 | + $inline_css .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-now-txt-animation-wrap{ | |
| 22 | + border-radius:' . $attributes['borderRadius'] . 'px; | |
| 23 | + }'; | |
| 24 | + $inline_css .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-slides{ | |
| 25 | + border-radius:' . $attributes['borderRadius'] . 'px; | |
| 26 | + }'; | |
| 286 | 27 | |
| 287 | - //post-image-border-radius | |
| 288 | - $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-slides .bs-circle-marq{ | |
| 28 | + //post-image-border-radius | |
| 29 | + $inline_css .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-slides .bs-circle-marq{ | |
| 289 | 30 | border-radius:' . $attributes['imgBorderRadius'] . 'px; |
| 290 | 31 | }'; |
| 291 | 32 | |
| 292 | - //post-flash-animation-speed | |
| 293 | - $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-slides .marquee .bs-marquee-wrapper{ | |
| 294 | - animation-duration:' . $attributes['animationSpeed'] . 'ms; | |
| 33 | + //post-flash-animation-speed | |
| 34 | + $inline_css .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-slides .bs-marquee .bs-marquee-wrapper{ | |
| 35 | + animation-duration:' . $attributes['animationSpeed'] . 's; | |
| 295 | 36 | }'; |
| 296 | 37 | |
| 297 | - //Title color | |
| 298 | - $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-slides a .bs-post-title{ | |
| 38 | + //post-widht | |
| 39 | + $inline_css .= ' .' . $blockuniqueclass . ' .bs-flash-wrap.has-fixed-width h2.bs-post-title{ | |
| 40 | + width:' . $attributes['postWidth'] . 'px; | |
| 41 | + }'; | |
| 42 | + | |
| 43 | + //Title color | |
| 44 | + $inline_css .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-slides a .bs-post-title{ | |
| 299 | 45 | color:' . $attributes['postTitleColor'] . '; |
| 300 | 46 | }'; |
| 301 | 47 | |
| 302 | - //Title hover color | |
| 303 | - $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-slides a:hover .bs-post-title{ | |
| 48 | + //Title hover color | |
| 49 | + $inline_css .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-slides a:hover .bs-post-title{ | |
| 304 | 50 | color:' . $attributes['titleOnHoverColor'] . '; |
| 305 | 51 | }'; |
| 306 | 52 | |
| 307 | - //Exclusive News color and background | |
| 308 | - $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-now .bs-exclusive-now-txt-animation-wrap{ | |
| 53 | + //Exclusive News color and background | |
| 54 | + $inline_css .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-now .bs-exclusive-now-txt-animation-wrap{ | |
| 309 | 55 | color:' . $attributes['newsColor'] . '; |
| 310 | 56 | background-color: ' . $attributes['newsBgColor'] . '; |
| 311 | 57 | }'; |
| 312 | - $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap.flash-style-2 .bs-exclusive-posts .bs-exclusive-now .bs-exclusive-now-txt-animation-wrap::after{ | |
| 58 | + $inline_css .= ' .' . $blockuniqueclass . ' .bs-flash-wrap.flash-style-2 .bs-exclusive-posts .bs-exclusive-now .bs-exclusive-now-txt-animation-wrap::after{ | |
| 313 | 59 | border-left-color:' . $attributes['newsBgColor'] . '; |
| 314 | 60 | }'; |
| 315 | - $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap.flash-style-3 .bs-exclusive-posts .bs-exclusive-now .bs-exclusive-now-txt-animation-wrap::after, .bs-flash-wrap.flash-style-4 .bs-exclusive-posts .bs-exclusive-now .bs-exclusive-now-txt-animation-wrap::after{ | |
| 61 | + $inline_css .= ' .' . $blockuniqueclass . ' .bs-flash-wrap.flash-style-3 .bs-exclusive-posts .bs-exclusive-now .bs-exclusive-now-txt-animation-wrap::after{ | |
| 316 | 62 | background-color:' . $attributes['newsBgColor'] . '; |
| 317 | 63 | }'; |
| 64 | + $inline_css .= ' .' . $blockuniqueclass . ' .bs-flash-wrap.flash-style-4 .bs-exclusive-posts .bs-exclusive-now .bs-exclusive-now-txt-animation-wrap::after{ | |
| 65 | + background-color:' . $attributes['newsBgColor'] . '; | |
| 66 | + }'; | |
| 318 | 67 | |
| 319 | - //Border | |
| 320 | - if($attributes['border']) { | |
| 321 | - $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts{ | |
| 68 | + //Border | |
| 69 | + if ($attributes['border']) { | |
| 70 | + $inline_css .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts{ | |
| 322 | 71 | border-width:' . $attributes['borderWidth'] . 'px; |
| 323 | 72 | border-color:' . $attributes['borderColor'] . '; |
| 324 | 73 | }'; |
| 325 | - } | |
| 74 | + } | |
| 326 | 75 | |
| 327 | - //Exclusive Subtitle color and background | |
| 328 | - if($attributes['exclusiveSubtitle']) { | |
| 329 | - $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-now > span{ | |
| 76 | + //Exclusive Subtitle color and background | |
| 77 | + if ($attributes['exclusiveSubtitle']) { | |
| 78 | + $inline_css .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-now > span{ | |
| 330 | 79 | color:' . $attributes['exclusiveColor'] . '; |
| 331 | 80 | background-color: ' . $attributes['exclusiveBgColor'] . '; |
| 332 | 81 | }'; |
| 333 | - $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-now > span::before{ | |
| 82 | + $inline_css .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-now > span::before{ | |
| 334 | 83 | border-top-color:' . $attributes['exclusiveBgColor'] . '; |
| 335 | 84 | }'; |
| 336 | - $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-now > span::after{ | |
| 85 | + $inline_css .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-now > span::after{ | |
| 337 | 86 | border-bottom-color:' . $attributes['exclusiveBgColor'] . '; |
| 338 | 87 | }'; |
| 339 | - } | |
| 88 | + } | |
| 340 | 89 | |
| 341 | - //Block Gaps | |
| 342 | - $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts{ | |
| 90 | + //Block Gaps | |
| 91 | + $inline_css .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts{ | |
| 343 | 92 | margin-top:' . $attributes['marginTop'] . 'px; |
| 344 | 93 | margin-right:' . $attributes['marginRight'] . 'px; |
| 345 | 94 | margin-bottom:' . $attributes['marginBottom'] . 'px; |
| 346 | 95 | margin-left:' . $attributes['marginLeft'] . 'px; |
| 96 | + }'; | |
| 97 | + | |
| 98 | + $inline_css .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-slides{ | |
| 347 | 99 | padding-top:' . $attributes['paddingTop'] . 'px; |
| 348 | 100 | padding-right:' . $attributes['paddingRight'] . 'px; |
| 349 | 101 | padding-bottom:' . $attributes['paddingBottom'] . 'px; |
| 350 | 102 | padding-left:' . $attributes['paddingLeft'] . 'px; |
| @@ -349,51 +101,68 @@ | ||
| 349 | 101 | padding-bottom:' . $attributes['paddingBottom'] . 'px; |
| 350 | 102 | padding-left:' . $attributes['paddingLeft'] . 'px; |
| 351 | 103 | }'; |
| 352 | 104 | |
| 353 | - // Post Number Color | |
| 354 | - if($attributes['enableCount']){ | |
| 355 | - $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-slides .marquee h4.bs-post-title a .bs-circle-marq .bs-trending-no{ | |
| 105 | + // Post Number Color | |
| 106 | + if ($attributes['enableCount']) { | |
| 107 | + $inline_css .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-slides .bs-marquee h2.bs-post-title a .bs-circle-marq .bs-trending-no{ | |
| 356 | 108 | color: ' . $attributes['countColor'] . '; |
| 357 | 109 | }'; |
| 358 | - } | |
| 359 | - | |
| 360 | - | |
| 361 | - | |
| 362 | - //Font Settings | |
| 363 | - | |
| 364 | - $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-slides a .bs-post-title{ | |
| 110 | + } | |
| 111 | + | |
| 112 | + //Font Settings | |
| 113 | + | |
| 114 | + $inline_css .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-slides a .bs-post-title{ | |
| 365 | 115 | font-size: ' . $attributes['postTitleFontSize'] . $attributes['titleFontSizeType'] . '; |
| 366 | - '.bscheckFontfamily($attributes['titleFontFamily']).'; | |
| 367 | - font-weight: ' . $attributes['titleFontWeight'] . '; | |
| 116 | + ' . bscheckFontfamily($attributes['titleFontFamily']) . '; | |
| 117 | + ' . bscheckFontfamilyWeight($attributes['titleFontWeight']) . '; | |
| 118 | + line-height: ' . $attributes['postTitleLineHeight'] . '; | |
| 368 | 119 | }'; |
| 369 | 120 | |
| 370 | - $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-now .bs-exclusive-now-txt-animation-wrap .bs-exclusive-texts-wrapper{ | |
| 121 | + $inline_css .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-now .bs-exclusive-now-txt-animation-wrap .bs-exclusive-texts-wrapper{ | |
| 371 | 122 | font-size: ' . $attributes['exclusiveFontSize'] . $attributes['exclusiveFontSizeType'] . '; |
| 372 | - '.bscheckFontfamily($attributes['exclusiveFontFamily']).'; | |
| 373 | - font-weight: ' . $attributes['exclusiveFontWeight'] . '; | |
| 123 | + ' . bscheckFontfamily($attributes['exclusiveFontFamily']) . '; | |
| 124 | + ' . bscheckFontfamilyWeight($attributes['exclusiveFontWeight']) . '; | |
| 374 | 125 | }'; |
| 375 | - | |
| 376 | - $block_content .= '@media (max-width: 1025px) { '; | |
| 377 | - $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-slides a .bs-post-title{ | |
| 126 | + | |
| 127 | + $inline_css .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-now .bs-exclusive-news-title{ | |
| 128 | + font-size: ' . $attributes['exclusiveSubtitleFontSize'] . $attributes['exclusiveSubtitleFontSizeType'] . '; | |
| 129 | + ' . bscheckFontfamily($attributes['exclusiveSubtitleFontFamily']) . '; | |
| 130 | + ' . bscheckFontfamilyWeight($attributes['exclusiveSubtitleFontWeight']) . '; | |
| 131 | + }'; | |
| 132 | + | |
| 133 | + $inline_css .= '@media (max-width: 1025px) { '; | |
| 134 | + $inline_css .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-slides a .bs-post-title{ | |
| 378 | 135 | font-size: ' . $attributes['titleFontSizeTablet'] . $attributes['titleFontSizeType'] . '; |
| 379 | 136 | }'; |
| 380 | - $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-now .bs-exclusive-now-txt-animation-wrap .bs-exclusive-texts-wrapper{ | |
| 137 | + $inline_css .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-now .bs-exclusive-now-txt-animation-wrap .bs-exclusive-texts-wrapper{ | |
| 381 | 138 | font-size: ' . $attributes['exclusiveFontSizeTablet'] . $attributes['exclusiveFontSizeType'] . '; |
| 382 | 139 | }'; |
| 383 | - $block_content .= '}'; | |
| 384 | - | |
| 385 | - $block_content .= '@media (max-width: 767px) { '; | |
| 386 | - $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-slides a .bs-post-title{ | |
| 140 | + $inline_css .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-now .bs-exclusive-news-title{ | |
| 141 | + font-size: ' . $attributes['exclusiveSubtitleFontSizeTablet'] . $attributes['exclusiveSubtitleFontSizeType'] . '; | |
| 142 | + }'; | |
| 143 | + $inline_css .= '}'; | |
| 144 | + | |
| 145 | + $inline_css .= '@media (max-width: 767px) { '; | |
| 146 | + $inline_css .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-posts .bs-exclusive-slides a .bs-post-title{ | |
| 387 | 147 | font-size: ' . $attributes['titleFontSizeMobile'] . $attributes['titleFontSizeType'] . '; |
| 388 | 148 | }'; |
| 389 | - $block_content .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-now .bs-exclusive-now-txt-animation-wrap .bs-exclusive-texts-wrapper{ | |
| 149 | + $inline_css .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-now .bs-exclusive-now-txt-animation-wrap .bs-exclusive-texts-wrapper{ | |
| 390 | 150 | font-size: ' . $attributes['exclusiveFontSizeMobile'] . $attributes['exclusiveFontSizeType'] . '; |
| 391 | 151 | }'; |
| 392 | - $block_content .= '}'; | |
| 393 | - | |
| 394 | - $block_content .= '</style>'; | |
| 395 | - return $block_content; | |
| 152 | + $inline_css .= ' .' . $blockuniqueclass . ' .bs-flash-wrap .bs-exclusive-now .bs-exclusive-news-title{ | |
| 153 | + font-size: ' . $attributes['exclusiveSubtitleFontSizeMobile'] . $attributes['exclusiveSubtitleFontSizeType'] . '; | |
| 154 | + }'; | |
| 155 | + $inline_css .= '}'; | |
| 156 | + | |
| 157 | + // $block_content .= blockspare_minify_css($inline_css); | |
| 158 | + | |
| 159 | + // $block_content .= '</style>'; | |
| 160 | + // return $block_content; | |
| 161 | + | |
| 162 | + if (!empty($inline_css)) { | |
| 163 | + wp_register_style('bs-flash-inline', false); | |
| 164 | + wp_enqueue_style('bs-flash-inline'); | |
| 165 | + wp_add_inline_style('bs-flash-inline', blockspare_minify_css($inline_css)); | |
| 396 | 166 | } |
| 167 | + } | |
| 397 | 168 | } |
| 398 | - | |
| 399 | - | |