PluginProbe ʕ •ᴥ•ʔ
Gallery : FooGallery / 3.1.36
Gallery : FooGallery v3.1.36
3.3.2 3.3.3 3.3.0 3.1.31 3.1.32 3.1.34 3.1.36 3.2.0 3.2.6 trunk 1.10.3 2.0.24 2.1.34 2.2.44 2.3.3 2.4.32 3.0.6 3.1.11 3.1.12 3.1.13 3.1.20 3.1.25 3.1.26 3.1.26.1 3.1.26.2
foogallery / extensions / albums / public / class-shortcodes.php
foogallery / extensions / albums / public Last commit date
class-foogallery-album-template-loader.php 2 months ago class-rewrite-rules.php 2 months ago class-shortcodes.php 2 months ago
class-shortcodes.php
45 lines
1 <?php
2 /*
3 * FooGallery Album Shortcode
4 */
5
6 if ( ! class_exists( 'FooGallery_Album_Shortcodes' ) ) {
7
8 class FooGallery_Album_Shortcodes {
9
10 function __construct() {
11 add_action( 'foogallery_loaded_album_template', array( $this, 'render_custom_css' ) );
12 add_shortcode( foogallery_album_shortcode_tag(), array( $this, 'render_foogallery_album_shortcode' ) );
13 }
14
15 function render_foogallery_album_shortcode( $atts ) {
16
17 $args = wp_parse_args( $atts, array(
18 'id' => 0,
19 'album' => '',
20 ) );
21
22 $args = apply_filters( 'foogallery-album_shortcode_atts', $args );
23
24 //create new instance of template engine
25 $engine = new FooGallery_Album_Template_Loader();
26
27 ob_start();
28
29 $engine->render_template( $args );
30
31 $output_string = ob_get_contents();
32 ob_end_clean();
33 return $output_string;
34 }
35
36 function render_custom_css( $foogallery_album ) {
37 if ( !empty( $foogallery_album->custom_css ) ) {
38 echo '<style type="text/css">';
39 echo $foogallery_album->custom_css; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Custom CSS from album settings
40 echo '</style>';
41 }
42 }
43 }
44 }
45