get_results( "SELECT * FROM ".$wpdb->prefix."xyz_ihs_short_code WHERE status='1'" ); // if(count($totalDetails)>0){ // foreach ($totalDetails as $total){ add_shortcode('xyz-ihs','xyz_ihs_display_content'); // } // } function xyz_ihs_display_content($xyz_snippet_name){ global $wpdb; if(is_array($xyz_snippet_name)){ $snippet_name = $xyz_snippet_name['snippet']; $query = $wpdb->get_results( "SELECT * FROM ".$wpdb->prefix."xyz_ihs_short_code WHERE title='$snippet_name'" ); if(count($query)>0){ foreach ($query as $sippetdetails){ // return stripslashes($sippetdetails->content); if($sippetdetails->status==1) return $sippetdetails->content; else return ''; break; } }else{ return "