REST API: enable widgets module when inserting Business Address widget during JPO#8481
Closed
AnnaMag wants to merge 1 commit intoadd/jpo-save-business-addressfrom
Closed
REST API: enable widgets module when inserting Business Address widget during JPO#8481AnnaMag wants to merge 1 commit intoadd/jpo-save-business-addressfrom
AnnaMag wants to merge 1 commit intoadd/jpo-save-business-addressfrom
Conversation
Business Address is injected and stored in a JP widget, so we need to make sure it is enabled.
3029fc2 to
bf05241
Compare
Member
|
Let's land #8426 and rebase this one before reviewing - it can get tedious to review a chain of PRs. Approach seems sensible though 👍 |
tyxla
reviewed
Jan 8, 2018
| } else { | ||
| Jetpack_Widgets::activate_widget( $id_base, $first_sidebar, $position, $widget_options); | ||
| if ( ! $widgets_module_active ) { | ||
| if( $first_sidebar ) { |
Member
There was a problem hiding this comment.
Could combine those conditions in one if.
tyxla
reviewed
Jan 8, 2018
| } | ||
| } | ||
| } | ||
| } else { $error[] = 'widgets activate'; } |
Member
There was a problem hiding this comment.
I'd move $error[] = 'widgets activate'; on its own line.
Contributor
Author
|
@tyxla thanks for jumping in here. Yes, let's land the previous one first. |
Contributor
Author
|
Closing as it will be handled in #8523. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on #8480
This patch extends the JPO onboarding request, which inserts Business Address widget, to automatically enable the widgets module, if needed.
Testing instructions:
wp jetpack module deactivate widgets, go through the steps above and verify that the module was enabled automatically (wp jetpack module listshows active and the widget is visible with the correct content).