WordPress.org

Ready to get started?Download WordPress

Ideas

Allow ability to pass parameters when registering widgets

  1. Timothy Wood
    Member

    12345

    I have run into an issue several times when calling register_widget( 'MyNewWidget' ); for a shared widget class it instantiates the widget over any previously called register_widget() calls to the same class. My proposal is to implement a change of the WP_Widget_Factory::register method to allow passing parameters thus allowing unique constructor calls when registering. My proposed change can be seen as an extension of the WP_Widget_Factory now: https://gist.github.com/2437027

    Posted: 2 years ago #
  2. Dieta Dukana
    Member

    I don't think many people have ran into the same problem as you Timothy, but I think that this is a good idea and would make wordpress better.

    Posted: 2 years ago #
  3. Wonder
    Member

    12345

    I do not think this is strictly required, I think wordpress developers will overlook.

    Posted: 2 years ago #
  4. Hello Timothy,
    first of all, excuse me for my bad english, i'm from Germany. I have to say that you problem is not too rare. But have you checked your code at this point?:
    Class Extend_WP_Widget_Factory extends WP_Widget_Factory {

    In the most cases the fault could be found here.

    I hope you can solve your problem!
    with best regards,
    Jens Zalando

    Posted: 2 years ago #

RSS feed for this topic

Reply

You must log in to post.

  • Rating

    12345
    4 Votes
  • Status

    This idea is under consideration