Filter - Admin Panes
This is a filter for adding extra panes to the admin panel for adding extra functionality. For example, say we're creating a backup plugin, we might add a pane to hold a button for initiating backups.
The filter name is "adminPane".
The callback takes one parameter: "panelID". This is the ID of the container the content should go in.
The options object should contain one property: "panelTitle". This is the title displayed to the users in the admin panel.
Here's an example:
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
registerCallback( | |
'adminPane', | |
(panelID) => { | |
const panel = document.querySelector(`#${panelID}`) | |
panel.innerHTML = `<button class="button" id="js-backup">Backup DB</button>` | |
loadAnalytics() | |
}, { | |
'panelTitle': 'Analytics' | |
} | |
) |