/** * Return frontend HTML for this column * * @param array $row_options Formatted options for the parent row * @param array $post_options Formatted options for the parent post * @return string Frontend HTML */ public function get_frontend_view($row_options, $post_options) { $elements_html = ''; foreach ($this->elements as $element) { $elements_html .= $element->get_frontend_view($this->options->get_formatted_values(), $row_options, $post_options, $this->width); } $class = Layotter_Settings::get_col_layout_class($this->width); if (has_filter('layotter/view/column')) { return apply_filters('layotter/view/column', $elements_html, $class, $this->options->get_formatted_values(), $row_options, $post_options); } else { $html_wrapper = Layotter_Settings::get_html_wrapper('cols'); $html_before = str_replace('%%CLASS%%', $class, $html_wrapper['before']); return $html_before . $elements_html . $html_wrapper['after']; } }
/** * Get the frontend view * * @param array $col_options Formatted options for the parent column * @param array $row_options Formatted options for the parent row * @param array $post_options Formatted options for the parent post * @param string $col_width Width of the parent column, e.g. '1/3' * @return string Frontend view HTML */ public final function get_frontend_view($col_options, $row_options, $post_options, $col_width) { ob_start(); $this->frontend_view($this->formatted_values, $col_width, $col_options, $row_options, $post_options); $element_html = ob_get_clean(); if (has_filter('layotter/view/element')) { return apply_filters('layotter/view/element', $element_html, $this->options->get_formatted_values(), $col_options, $row_options, $post_options); } else { $html_wrapper = Layotter_Settings::get_html_wrapper('elements'); return $html_wrapper['before'] . $element_html . $html_wrapper['after']; } }
/** * Return frontend HTML for this row * * @param array $post_options Formatted options for the parent post * @return string Frontend HTML */ public function get_frontend_view($post_options) { $cols_html = ''; foreach ($this->cols as $col) { $cols_html .= $col->get_frontend_view($this->options->get_formatted_values(), $post_options); } if (has_filter('layotter/view/row')) { return apply_filters('layotter/view/row', $cols_html, $this->options->get_formatted_values(), $post_options); } else { $html_wrapper = Layotter_Settings::get_html_wrapper('rows'); return $html_wrapper['before'] . $cols_html . $html_wrapper['after']; } }
/** * Return frontend HTML for this post * * @return string Frontend HTML */ public function get_frontend_view() { $rows_html = ''; foreach ($this->rows as $row) { $rows_html .= $row->get_frontend_view($this->options->get_formatted_values()); } // if a custom filter for frontend was hooked, run through that filter and return HTML if (has_filter('layotter/view/post')) { return apply_filters('layotter/view/post', $rows_html, $this->options->get_formatted_values()); } else { // otherwise, get HTML wrapper from settings, apply and return HTML $html_wrapper = Layotter_Settings::get_html_wrapper('wrapper'); return $html_wrapper['before'] . $rows_html . $html_wrapper['after']; } }