Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for deleting widgets #22

Closed
westonruter opened this issue Sep 30, 2013 · 8 comments
Closed

Add support for deleting widgets #22

westonruter opened this issue Sep 30, 2013 · 8 comments
Labels

Comments

@westonruter
Copy link
Contributor

@westonruter westonruter commented Sep 30, 2013

Just as there is a Delete link in the Widgets admin page for eliminating a widget from a sidebar, this same link should be in the widget form customizer control.

Relates to #3 (adding widgets)

Note that the widget control form currently hides the Delete button since it is not currently implemented:

pasted_image_10_8_13_10_18_am

@TrevorMills

This comment has been minimized.

Copy link
Contributor

@TrevorMills TrevorMills commented Oct 8, 2013

@westonruter that commit does not reflect this issue. Please ignore. It was a brain fart moment.

@westonruter

This comment has been minimized.

Copy link
Contributor Author

@westonruter westonruter commented Oct 8, 2013

@TrevorMills ok 😄

By the way, I updated the description in this issue to include a screenshot depicting what is going on with the hidden Delete link in the widget control form.

@TrevorMills

This comment has been minimized.

Copy link
Contributor

@TrevorMills TrevorMills commented Oct 8, 2013

@westonruter coolio. I'm working on this one now. Commit 3f0c41e actually reflects issue #26.

@TrevorMills

This comment has been minimized.

Copy link
Contributor

@TrevorMills TrevorMills commented Oct 8, 2013

@westonruter why are you using custom code to update the widget instead of routing through the same function that the main widgets page uses to update widgets? I see the note about copying most of the code from wp_ajax_save_widget

@westonruter

This comment has been minimized.

Copy link
Contributor Author

@westonruter westonruter commented Oct 8, 2013

@TrevorMills because we don't want to actually update the widget in the DB. We only want to execute the widget's update callback so that the previewed $instance will get processed, and then to call the widget's form callback so that the widget form in the preview can be refreshed with the previewed $instance. All of this is done without saving anything to the DB, which is what wp_ajax_save_widget does, and this is why we can't re-use it.

@TrevorMills

This comment has been minimized.

Copy link
Contributor

@TrevorMills TrevorMills commented Oct 8, 2013

Ah, right, so the changes don't actually go to the DB until the "Save & Publish" button is hit, correct?

@westonruter

This comment has been minimized.

Copy link
Contributor Author

@westonruter westonruter commented Oct 8, 2013

@TrevorMills exactly. This conversation reminded me of something else needing to be done related to saving settings. Added #28.

@westonruter

This comment has been minimized.

Copy link
Contributor Author

@westonruter westonruter commented Oct 16, 2013

@TrevorMills @shaunandrews: how widget “deletion” now looks in the customizer, which is actually now trashing since the widgets are just moved to the Inactive Widgets sidebar:

screenshot-4

fnakstad added a commit to knishiura-lab/wp-widget-customizer that referenced this issue Feb 5, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.