-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Fix/plugin document setting panel docs #16620
Merged
youknowriad
merged 34 commits into
WordPress:master
from
ryanwelcher:fix/plugin-document-setting-panel-docs
Jul 26, 2019
Merged
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
10f2155
Merge remote-tracking branch 'upstream/master'
1e71527
Merge branch 'master' of github.com:ryanwelcher/gutenberg
1f84880
Merge remote-tracking branch 'upstream/master'
1b8abb5
Merge remote-tracking branch 'upstream/master'
4e157e3
Merge remote-tracking branch 'upstream/master'
80d16f9
Merge remote-tracking branch 'upstream/master'
44df501
Merge remote-tracking branch 'upstream/master'
60ecdbf
Merge remote-tracking branch 'upstream/master'
becc99e
Merge remote-tracking branch 'upstream/master'
baabb3d
Merge remote-tracking branch 'upstream/master'
7875f9c
Merge remote-tracking branch 'upstream/master'
47b6603
Merge remote-tracking branch 'upstream/master'
d406e81
Merge remote-tracking branch 'upstream/master'
ae92d91
Merge remote-tracking branch 'upstream/master'
88e5faf
Merge remote-tracking branch 'upstream/master'
642b80f
Merge remote-tracking branch 'upstream/master'
25a396e
Merge remote-tracking branch 'upstream/master'
ac92347
Merge remote-tracking branch 'upstream/master'
30e4692
Merge remote-tracking branch 'upstream/master'
c78138a
Merge remote-tracking branch 'upstream/master'
9e36834
Merge remote-tracking branch 'upstream/master'
58709fa
Merge remote-tracking branch 'upstream/master'
2078d23
Merge remote-tracking branch 'upstream/master'
0941bd4
Merge remote-tracking branch 'upstream/master'
2c96740
Merge remote-tracking branch 'upstream/master'
9b1d4b7
Merge remote-tracking branch 'upstream/master'
c6f59c6
Adds Documentation for the PluginDocumentSettingPanel SlotFill
c199dfa
Getting the name right on the docs is a good idea
3b1e60c
Regenerate docs
dbe8aa2
Closing example code block and regenerate docs
57e442a
Adds new SlotFill to the list
4b6082a
Merge remote-tracking branch 'upstream/master'
cf35bd3
Merge branch 'master' into fix/plugin-document-setting-panel-docs
9a63c5b
Changes to SlotFill description as per @youknowriad
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
26 changes: 26 additions & 0 deletions
26
docs/designers-developers/developers/slotfills/plugin-document-setting-panel.md
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# PluginDocumentSettingPanel | ||
|
||
This SlotFill allows registering a UI to edit Document settings. | ||
|
||
## Available Props | ||
* __name__ `string`: A string identifying the panel. | ||
* __className__ `string`: An optional class name added to the sidebar body. | ||
* __title__ `string`: Title displayed at the top of the sidebar. | ||
* __icon__ `(string|Element)`: The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element. | ||
|
||
## Example | ||
```js | ||
const { registerPlugin } = wp.plugins; | ||
const { PluginDocumentSettingPanel } = wp.editPost; | ||
|
||
const PluginDocumentSettingPanelDemo = () => ( | ||
<PluginDocumentSettingPanel | ||
name="custom-panel" | ||
title="Custom Panel" | ||
className="custom-panel" | ||
> | ||
Custom Panel Contents | ||
</PluginDocumentSettingPanel> | ||
); | ||
registerPlugin( 'plugin-document-setting-panel-demo', { render: PluginDocumentSettingPanelDemo, icon: 'palmtree' } ); | ||
ryanwelcher marked this conversation as resolved.
Show resolved
Hide resolved
|
||
``` |
This file contains 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
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe an example to edit a document setting (a meta field for instance) could be more valuable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great suggestion - perhaps we should apply this feedback to the other docs for SlotFill as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that makes sense.
Also, I feel having a "slotfills" category/section in the docs is also a bit misleading. I'd personally prefer extensibility options organized in a more "semantic way".
Instead of SlotFills section, we could have:
we could continue these adaptations separately.
Thanks for the update on this one 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if there is an automated way to do that, via some kind of jsdoc tag to move slotfills into a more self-documented approach? (Just a musing!)