mirror of
https://github.com/discourse/discourse.git
synced 2025-03-12 11:05:29 +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:
|
* Example:
|
||||||
*
|
*
|
||||||
* ```
|
* ```
|
||||||
* api.addPostAdminMenuButton((name, attrs) => {
|
* api.addPostAdminMenuButton((post) => {
|
||||||
* return {
|
* return {
|
||||||
* action: () => {
|
* action: () => {
|
||||||
* alert('You clicked on the coffee button!');
|
* alert('You clicked on the coffee button!');
|
||||||
* },
|
* },
|
||||||
* icon: 'coffee',
|
* icon: 'coffee',
|
||||||
* className: 'hot-coffee',
|
* className: 'hot-coffee',
|
||||||
* title: 'coffee.title',
|
* label: 'coffee.title',
|
||||||
* };
|
* };
|
||||||
* });
|
* });
|
||||||
* ```
|
* ```
|
||||||
**/
|
**/
|
||||||
addPostAdminMenuButton(name, callback) {
|
addPostAdminMenuButton(callback) {
|
||||||
this.container
|
this.container
|
||||||
.lookup("service:admin-post-menu-buttons")
|
.lookup("service:admin-post-menu-buttons")
|
||||||
.addButton(name, callback);
|
.addButton(callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user