WordPress.org

Ready to get started?Download WordPress

Forums

WP Page Widget
[resolved] Generic fix for Image Widget type problems (3 posts)

  1. rbottomley
    Member
    Posted 10 months ago #

    I have a widget that was having the same issues as Image Widget once was: code that was attached to sidebar_admin_setup action was not firing when using the widget in a page, but would work fine on the global widgets. Around line 1286 of wp-page-widgets.php I see hardcoded code to fix Image Widget. But what about any other widgets that need this action?

    Instead of the code for Image Widget, how about doing:

    do_action('sidebar_admin_setup');

    This fixed my widget. Is there a reason not to call do_action? If there is no downside, this generic fix would work for any widget the requires the sidebar_admin_setup action.

    http://wordpress.org/plugins/wp-page-widget/

  2. rbottomley
    Member
    Posted 10 months ago #

    When I said "line 1286", I was looking at the wrong thing. That should be "line 107". Sorry.

  3. CodeAndMore
    Member
    Plugin Author

    Posted 5 months ago #

    That line is open for all widgets now so consider solved.

Reply

You must log in to post.

About this Plugin

About this Topic