예제 #1
0
 /**
  * @since 1.0.0
  * 
  * @param  array  $class
  * @return string
  */
 function presscore_list_container_html_class($custom_class = array())
 {
     $config = presscore_get_config();
     $html_class = array();
     if ('dark' == $config->get('post.preview.hover.color')) {
         $html_class[] = 'hover-color-static';
     }
     $html_class[] = presscore_template_loading_effect_html_class($config->get('post.preview.load.effect'));
     // ajax class
     if (!in_array($config->get('load_style'), array('default', false))) {
         $html_class[] = 'with-ajax';
     }
     // lazy loading
     if ('lazy_loading' == $config->get('load_style')) {
         $html_class[] = 'lazy-loading-mode';
     }
     //////////////
     // Output //
     //////////////
     if ($custom_class && !is_array($custom_class)) {
         $custom_class = explode(' ', $custom_class);
     }
     $html_class = apply_filters('presscore_masonry_container_class', array_merge($custom_class, $html_class));
     return $html_class ? sprintf('class="%s"', presscore_esc_implode(' ', array_unique($html_class))) : '';
 }
 /**
  * @since 1.0.0
  * 
  * @param  array  $class
  * @return string
  */
 function presscore_masonry_container_class($custom_class = array())
 {
     $config = Presscore_Config::get_instance();
     $html_class = array();
     //////////////////////
     // Common classes //
     //////////////////////
     // ajax class
     if (!in_array($config->get('load_style'), array('default', false))) {
         $html_class[] = 'with-ajax';
     }
     // loading effect
     $html_class[] = presscore_template_loading_effect_html_class($config->get('post.preview.load.effect'));
     // lazy loading
     if ('lazy_loading' == $config->get('load_style')) {
         $html_class[] = 'lazy-loading-mode';
     }
     // description style
     $description_style = $config->get('post.preview.description.style');
     if ('under_image' == $description_style) {
         $html_class[] = 'description-under-image';
     } else {
         if ('disabled' != $description_style) {
             $html_class[] = 'description-on-hover';
         }
     }
     // layout
     switch ($config->get('layout')) {
         case 'grid':
             $html_class[] = 'iso-grid';
             break;
         case 'masonry':
             $html_class[] = 'iso-container';
             break;
     }
     if ($config->get('justified_grid')) {
         $html_class[] = 'jg-container';
     }
     // post preview background
     if ($config->get('post.preview.background.enabled')) {
         $html_class[] = 'bg-under-post';
     }
     // hover classes
     switch ($config->get('post.preview.description.style')) {
         case 'on_hoover_centered':
             $html_class[] = 'hover-style-two';
             $html_class[] = presscore_hover_animation_class();
             if ('dark' == $config->get('post.preview.hover.color')) {
                 $html_class[] = 'hover-color-static';
             }
             break;
         case 'under_image':
             if ('dark' == $config->get('post.preview.hover.color')) {
                 $html_class[] = 'hover-color-static';
             }
             break;
         case 'on_dark_gradient':
             $html_class[] = 'hover-style-one';
             if ('always' == $config->get('post.preview.hover.content.visibility')) {
                 $html_class[] = 'always-show-info';
             }
             break;
         case 'from_bottom':
             $html_class[] = 'hover-style-three';
             $html_class[] = 'cs-style-3';
             if ('always' == $config->get('post.preview.hover.content.visibility')) {
                 $html_class[] = 'always-show-info';
             }
             break;
     }
     // round images
     if ('round' == $config->get('image_layout')) {
         $html_class[] = 'round-images';
     }
     //////////////
     // Output //
     //////////////
     if ($custom_class && !is_array($custom_class)) {
         $custom_class = explode(' ', $custom_class);
     }
     $html_class = apply_filters('presscore_masonry_container_class', array_merge($custom_class, $html_class));
     return $html_class ? sprintf('class="%s"', presscore_esc_implode(' ', array_unique($html_class))) : '';
 }