PluginProbe
Gridable / trunk
Gridable vtrunk
1.2.12 1.2.11 trunk 0.1.0 0.5.0 1.0.0 1.1.0 1.2.0 1.2.1 1.2.10 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9
gridable / public / partials / col.php

col.php in Gridable trunk, at public/partials/col.php

56 lines 2.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) {
3 exit;
4 }
5
6 /**
7 * This is the col template output
8 *
9 * Variables available:
10 *
11 * - $content is the content between the [col]$content[/col] tags –– if you want inner shortcodes to run, use do_shortcode
12 *
13 * - $size (int) The size of the columnsset by user as attribute in [col size="6"]
14 *
15 * - $classes (array) The CSS classes array and the result of the `gridable_column_class` filter, so we encourage you to use it
16 *
17 * - $class (string) The string representing the `class=""` attribute
18 *
19 * - $atts (array) All the shortcode attributes are stored in this array as key -> value
20 *
21 */
22
23 do_action( 'gridable_before_column_render' ); ?>
24 <div class="<?php echo esc_attr( $class ); ?>" <?php echo wp_kses_data( $this->sanitize_attribute_fragment( apply_filters( 'gridable_column_attributes', '', $atts, $content ) ) ); ?>>
25 <?php
26 do_action( 'gridable_before_column_content_render', $atts );
27
28 $gridable_column_content = apply_filters( 'gridable_the_column_content', $content, $atts );
29
30 if ( apply_filters( 'gridable_render_shortcodes_in_column', true, $content, $atts ) ) {
31 $gridable_column_content = do_shortcode( $gridable_column_content );
32 }
33
34 /*
35 * Print the column content as it comes out of the shortcodes.
36 *
37 * This is post content that WordPress already sanitized on save (wp_filter_post_kses runs
38 * for every user without the `unfiltered_html` capability) and that we are printing inside
39 * `the_content`. Running wp_kses_post() over the *rendered* result strips elements themes
40 * legitimately emit -- `<style>`, `<iframe>`, `<svg>`, `<form>` -- and because kses keeps the
41 * inner text of a stripped tag, a theme's inline gallery CSS ends up rendered as visible page
42 * text. See https://github.com/pixelgrade/gridable/issues/119.
43 *
44 * Sites that want the extra pass can opt back in through the filter below.
45 */
46 if ( apply_filters( 'gridable_sanitize_rendered_content', false, 'col', $atts ) ) {
47 $gridable_column_content = wp_kses_post( $gridable_column_content );
48 }
49
50 echo $gridable_column_content; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Already-sanitized post content; see the note above.
51
52 do_action( 'gridable_after_column_content_render' ); ?>
53 </div>
54 <?php
55 do_action( 'gridable_after_column_render' );
56