PluginProbe
Post Grid Gutenberg Blocks – PostX / 2.2.1
Post Grid Gutenberg Blocks – PostX v2.2.1
5.0.39 5.0.38 5.0.37 5.0.36 5.0.35 5.0.34 5.0.33 5.0.32 5.0.31 5.0.30 5.0.29 5.0.28 5.0.27 5.0.26 5.0.25 5.0.23 5.0.24 5.0.22 5.0.21 5.0.20 5.0.19 5.0.18 5.0.17 2.1.1 2.1.2 All 237 releases
ultimate-post / addons / templates / Shortcode.php

Shortcode.php in Post Grid Gutenberg Blocks – PostX 2.2.1, at addons/templates/Shortcode.php

31 lines 911 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace ULTP;
3
4 defined('ABSPATH') || exit;
5
6 class Shortcode {
7 public function __construct(){
8 add_shortcode('gutenberg_post_blocks', array($this, 'shortcode_callback'));
9 }
10
11 // Shortcode Callback
12 function shortcode_callback( $atts = array(), $content = null ) {
13 extract(shortcode_atts(array(
14 'id' => ''
15 ), $atts));
16
17 $content = '';
18 if($id){
19 $init = new \ULTP\Initialization();
20 $init->register_scripts_common();
21 ultimate_post()->set_css_style($id);
22 $content_post = get_post($id);
23 $content = $content_post->post_content;
24 $content = apply_filters('the_content', $content);
25 $content = str_replace(']]>', ']]&gt;', $content);
26 return '<div class="ultp-shortcode" data-postid="'.$id.'">' . $content . '</div>';
27 }
28 return '';
29 }
30
31 }