How to use Widget as Shortcode in WordPress Page, Post
function widget($atts) { global $wp_widget_factory; extract(shortcode_atts(array( ‘widget_name’ => FALSE, ‘instance’ => ” ), $atts)); $widget_name = esc_html($widget_name); if (!is_a($wp_widget_factory->widgets[$widget_name], ‘WP_Widget’)): $wp_class = ‘WP_Widget_’.ucwords(strtolower($class)); if (!is_a($wp_widget_factory->widgets[$wp_class], ‘WP_Widget’)): return ”.sprintf(__(“%s: Widget class not found. Make sure this widget exists and the class…
You must be logged in to post a comment.