PluginProbe ʕ •ᴥ•ʔ
Gallery : FooGallery / 3.2.6
Gallery : FooGallery v3.2.6
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 1 month ago class-rewrite-rules.php 1 month ago class-shortcodes.php 1 month ago
class-shortcodes.php
50 lines
1 <?php
2
3 if ( ! defined( 'ABSPATH' ) ) {
4 exit;
5 }
6
7 /*
8 * FooGallery Album Shortcode
9 */
10
11 if ( ! class_exists( 'FooGallery_Album_Shortcodes' ) ) {
12
13 class FooGallery_Album_Shortcodes {
14
15 function __construct() {
16 add_action( 'foogallery_loaded_album_template', array( $this, 'render_custom_css' ) );
17 add_shortcode( foogallery_album_shortcode_tag(), array( $this, 'render_foogallery_album_shortcode' ) );
18 }
19
20 function render_foogallery_album_shortcode( $atts ) {
21
22 $args = wp_parse_args( $atts, array(
23 'id' => 0,
24 'album' => '',
25 ) );
26
27 $args = apply_filters( 'foogallery-album_shortcode_atts', $args );
28
29 //create new instance of template engine
30 $engine = new FooGallery_Album_Template_Loader();
31
32 ob_start();
33
34 $engine->render_template( $args );
35
36 $output_string = ob_get_contents();
37 ob_end_clean();
38 return $output_string;
39 }
40
41 function render_custom_css( $foogallery_album ) {
42 if ( !empty( $foogallery_album->custom_css ) ) {
43 echo '<style type="text/css">';
44 echo $foogallery_album->custom_css; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Custom CSS from album settings
45 echo '</style>';
46 }
47 }
48 }
49 }
50