mirror of
https://github.com/discourse/discourse.git
synced 2025-03-11 16:45:34 +08:00
DEV: Correct addPostAdminMenuButton docs (#24035)
The `name` argument doesn't do anything, and 'title' should actually be 'label'
This commit is contained in:
parent
0cfc42e0e6
commit
373b2ca362
@ -642,22 +642,22 @@ class PluginApi {
|
||||
* Example:
|
||||
*
|
||||
* ```
|
||||
* api.addPostAdminMenuButton((name, attrs) => {
|
||||
* api.addPostAdminMenuButton((post) => {
|
||||
* return {
|
||||
* action: () => {
|
||||
* alert('You clicked on the coffee button!');
|
||||
* },
|
||||
* icon: 'coffee',
|
||||
* className: 'hot-coffee',
|
||||
* title: 'coffee.title',
|
||||
* label: 'coffee.title',
|
||||
* };
|
||||
* });
|
||||
* ```
|
||||
**/
|
||||
addPostAdminMenuButton(name, callback) {
|
||||
addPostAdminMenuButton(callback) {
|
||||
this.container
|
||||
.lookup("service:admin-post-menu-buttons")
|
||||
.addButton(name, callback);
|
||||
.addButton(callback);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user