Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
784 views
in Plugins by
edited by

Hi all, I have created a widget and a page for my plugin.

Now I would like to display the widget on this plugin page (that is not available in the custom page list).

I tried the following in the 'plugin_page'.php without success:

            $widget['title'] = "qa_best_users_per_month_widget";
            $module=qa_load_module('widget', $widget['title']);
            $qa_content['widgets'][$region][$place][]=$module;

 

Update: I forgot to define $region and $place. But after assigning values:
$region = "side";            $place = "high";

I got the following error:
PHP Fatal error:  Call to a member function output_widget() on a non-object

question still remains open...

1 Answer

+2 votes
by
selected by
 
Best answer

You need to use the user-displayed title of the widget, not its class name. See your qa-plugin.php for what you used. Also, ensure you're doing all of this after calling qa_content_prepare(...) in your page.

by
edited by
+1
thanks, solved:

    // WIDGET CALL: we want the best-user-widget also to be displayed on this page
    $widget['title'] = "Best Users per Month";
    $module=qa_load_module('widget', $widget['title']);
    $region = "side";
    $place = "high";
    $qa_content['widgets'][$region][$place][] = $module;
by
Thanks..this helps!!
...