WordPress.org

Ready to get started?Download WordPress

Ideas

Extra hooks for widget admin pages

  1. danbrownweb
    Member

    It would be good if there was a better way to handle intialising / reinitialising javascript plugins on the widgets admin.

    If you have, say, a jquery plugin on an input on a widget, the plugin will be deactivated on save and when a widget is dragged in. So you need to initialise the javascript 3 times: On page load, on save, and on drag.

    This gets pretty hairy when you have to identify which widget it is, and discriminate between each widget. It would be ace if there were hooks for each of these states. And these could get passed the current widget's id as an argument so you could target the javascript to the widget in question without loads of DOM traversing for easier development.

    Posted: 1 year ago #
  2. cathy700
    Member

    12345

    I think i understand what you want, but it seems pretty hard to implement !

    Posted: 1 year ago #
  3. danbrownweb
    Member

    I think you're right :) Maybe a decent tutorial would be better than a change to core.

    Posted: 1 year ago #
  4. adamweiss
    Member

    Yes, initializing the plugin three times do hard time for the developer, but it will add less flexibility for the developer. Anyway, It could be implemented as an optional setting.

    Posted: 2 months ago #
  5. eriksmithwpc
    Member

    That's a great idea, but I don't think it will be implemented soon... For the meanwhile, lets create a good tutorial that will make the work easier.

    Posted: 2 months ago #
  6. mywpviews
    Member

    Hooks for each of these states? That seems like a nice idea, but I don't think it will be present in the next word press versions.

    Another option is to write a plugin that does what you described. Is it worth the time and effort? I doubt it.

    Posted: 3 weeks ago #
  7. Seems a bit daft that this hasn't been implemented or fixed in the updates since this was posted last year (or has it?)

    I'm just learning javascript and WordPress now so haven't seen this problem or had it happen, but now I'm worried that it could. I second the other opinions though that a fix or tutorial would be appreciated.

    Posted: 1 week ago #
  8. Tekmoz
    Member

    Easier to write a plugin IMO or into your coding.

    Posted: 1 week ago #

RSS feed for this topic

Reply

You must log in to post.

  • Rating

    12345
    1 Vote
  • Status

    This idea is under consideration