WordPress.org

Ready to get started?Download WordPress

Forums

Get Widget ID after drag/drop in admin panel (1 post)

  1. dc_photo
    Member
    Posted 1 year ago #

    Hi all,

    I found a similar question here, but it was never answered:
    http://wordpress.org/support/topic/auto-save-widget-after-drag-amp-drop-into-the-sidebar

    Basically I need the widget's ID right after the widget has been dragged-dropped in the admin panel.

    I use

    function form($instance) {
    //..
    $this->id;
    //..
    }

    but it only works after the page has been refreshed, or the widget settings have been saved.

    Surely it can be done, as just after the drag/drop this is created

    <div class="widget ui-draggable" style="display: block;" id="widget-6_my_widget-10">

    (with "my_widget-10" being what I want to get)

    Any suggestions? Thanks a lot!

Topic Closed

This topic has been closed to new replies.

About this Topic