Use widget instance in custom functions
-
Hi,
I am creating my own widget, which is displaying some information stored in the backend – just as all the “examples” on creating your own custom widget works.
I now would like to create a page, where I also display some of this information. My idea was to use a shortcode to display the output. In my plugin code I have done the following:
class GM_Server_Status extends WP_Widget { (...) public function display_gm_status($atts) { extract(shortcode_atts( array( 'gm' => '', ), $atts) ); } } add_shortcode('gmstatus', array('GM_Server_Status', 'display_gm_status'));
I would like to be able to get the $instance values inside the display_gm_status function… But how? Is it possible?
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Use widget instance in custom functions’ is closed to new replies.