protected function get_data_atts() { $data_atts = array('orientation' => $this->atts['orientation'], 'offset' => sprintf('%1.1f', $this->atts['offset'] / 100)); if ('move' == $this->atts['navigation']) { $data_atts['navigation'] = 'move'; } return ' ' . presscore_get_inlide_data_attr($data_atts); }
protected function get_container_data_atts() { return presscore_get_inlide_data_attr(array('padding-side' => $this->atts['padding'], 'autoslide' => $this->atts['autoslide'] ? 'true' : 'false', 'delay' => $this->atts['autoslide'], 'loop' => $this->atts['loop'] ? 'true' : 'false')); }
protected function get_conatiner_data_attributes() { $data_atts = array('width' => $this->atts['column_width'] . 'px', 'columns' => $this->atts['columns_number']); return ' ' . presscore_get_inlide_data_attr($data_atts); }
/** * Add post open div for masonry layout. */ function presscore_before_post_masonry() { global $post; $config = presscore_config(); $html_class = array('wf-cell'); // wide posts if (!$config->get('all_the_same_width') && 'wide' == $config->get('post.preview.width')) { $html_class[] = 'double-width'; } // masonry layout if ('masonry' == $config->get('layout')) { $html_class[] = 'iso-item'; } // if filter enabled if ($config->get('template.posts_filter.terms.enabled') || $config->get('template.posts_filter.orderby.enabled') || $config->get('template.posts_filter.order.enabled')) { // add terms to class $taxonomy = apply_filters('presscore_before_post_masonry-filter_taxonomy', 'category', get_post_type()); $terms = get_the_terms(get_the_ID(), $taxonomy); if ($terms && !is_wp_error($terms)) { foreach ($terms as $term) { $html_class[] = 'category-' . $term->term_id; } } else { $html_class[] = 'category-0'; } } // data attributes for filtering $data_attr = array('post-id' => get_the_ID(), 'date' => esc_attr(get_the_date('c')), 'name' => esc_attr($post->post_title)); $data_attr = apply_filters('presscore_before_post_masonry-wrap_data_attr', $data_attr); $html_class = apply_filters('presscore_before_post_masonry-wrap_class', $html_class); echo '<div class="' . presscore_esc_implode(' ', $html_class) . '" ' . presscore_get_inlide_data_attr($data_attr) . '>'; }