Adds filter to allow modification of status inside admin.

This commit is contained in:
mateuswetah 2024-07-29 15:35:12 -03:00
parent 3afe409fa5
commit cc42170623
1 changed files with 9 additions and 2 deletions

View File

@ -426,8 +426,15 @@ StatusHelperPlugin.install = function (app, options = {}) {
}); });
this.statuses.push({ this.statuses.push({
name: tainacan_plugin.i18n['status_trash'], name: tainacan_plugin.i18n['status_trash'],
slug: 'trash'} slug: 'trash'
); });
/**
* Filter the available status in Tainacan admin.
*
* @param array Array of objects containing slug and name of each status.
*/
this.statuses = wp.hooks.applyFilters('tainacan_admin_available_statuses', JSON.parse(JSON.stringify(this.statuses)));
}) })
.catch(error => { .catch(error => {
console.error( error ); console.error( error );