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

Embed widget type. #26093

Merged

Conversation

spacedmonkey
Copy link
Member

Description

Embed widget type in widget controller to add extra context data on a widget.

I thought about removing description and widget class, as this data in widget type controller, but I will leave this up to @TimothyBJacobs

How has this been tested?

Screenshots

Types of changes

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR.

@spacedmonkey spacedmonkey self-assigned this Oct 14, 2020
@spacedmonkey spacedmonkey added Core REST API Task Task for Core REST API efforts REST API Interaction Related to REST API [Feature] Widgets Screen The block-based screen that replaced widgets.php. [Package] Edit Widgets /packages/edit-widgets labels Oct 14, 2020
@TimothyBJacobs
Copy link
Member

The link relation should be about to match posts and post types.

@spacedmonkey
Copy link
Member Author

The link relation should be about to match posts and post types.

@TimothyBJacobs Done

@TimothyBJacobs
Copy link
Member

Thanks! We also need to fallback to id if the is base is empty to account for reference widgets.

@spacedmonkey
Copy link
Member Author

So we need to add?

$id = ( empty( $prepared['id_base'] ) ) ? $prepared['id_base'] : $prepared['id'];

@TimothyBJacobs
Copy link
Member

That looks right to me.

@spacedmonkey
Copy link
Member Author

Thoughts on this

I thought about removing description and widget class, as this data in widget type controller

@TimothyBJacobs

@TimothyBJacobs
Copy link
Member

The client needs to be updated first to use the new endpoints #26086.

@TimothyBJacobs TimothyBJacobs merged commit 45aeb74 into WordPress:master Oct 14, 2020
@github-actions github-actions bot added this to the Gutenberg 9.2 milestone Oct 14, 2020
sirreal pushed a commit that referenced this pull request Oct 14, 2020
* Embed widget type.

* Change to about.

* Check if id base
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core REST API Task Task for Core REST API efforts [Feature] Widgets Screen The block-based screen that replaced widgets.php. [Package] Edit Widgets /packages/edit-widgets REST API Interaction Related to REST API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants