PluginProbe
Insert Html Snippet / 1.3.5
Insert Html Snippet v1.3.5
1.4.6 trunk 1.0 1.0.1 1.1 1.1.1 1.2 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.3 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.4 1.4.1 1.4.2 1.4.3 All 27 releases
insert-html-snippet / shortcode-handler.php

shortcode-handler.php in Insert Html Snippet 1.3.5, at shortcode-handler.php

38 lines 782 B
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 global $wpdb;
6
7 add_shortcode('xyz-ihs','xyz_ihs_display_content');
8
9 function xyz_ihs_display_content($xyz_snippet_name){
10 global $wpdb;
11
12 if(is_array($xyz_snippet_name)&& isset($xyz_snippet_name['snippet'])){
13
14 $snippet_name = $xyz_snippet_name['snippet'];
15
16 $query = $wpdb->get_results($wpdb->prepare( "SELECT * FROM ".$wpdb->prefix."xyz_ihs_short_code WHERE title=%s" ,$snippet_name));
17
18 if(!empty($query))//if(count($query)>0)
19 {
20 foreach ($query as $sippetdetails){
21 if($sippetdetails->status==1)
22 return do_shortcode($sippetdetails->content) ;
23 else
24 return '';
25 break;
26 }
27
28 }else{
29
30 return '';
31 }
32
33 }
34 }
35
36
37 add_filter('widget_text', 'do_shortcode'); // to run shortcodes in text widgets
38