| [ Index ] |
PHP Cross Reference of WordPress Trunk (Updated Daily) |
[Source view] [Print] [Project Stats]
Entity actions API. An action definition is the serializable subset of the DataViews Action API: every property that is plain data (`id`, `label`, `isPrimary`, `supportsBulk`, `context`, `modalHeader`, …). Properties that are JavaScript callbacks, components, or elements (`callback`, `RenderModal`, `isEligible`, `icon`, a `label` that depends on the items, …) cannot be declared here. They are provided by a script module registered for the entity along with its actions: its default export maps action ids to the properties of each action that are JavaScript. An entity can have several modules. Each module applies to the actions it was registered with, see {@see wp_get_registered_entity_action_modules()}.
| File Size: | 160 lines (7 kb) |
| Included or required: | 0 times |
| Referenced: | 0 times |
| Includes or requires: | 0 files |
| wp_register_entity_actions( $origin, $kind, $name, $actions, $script_module = null ) X-Ref |
| Registers actions for an entity, see {@see WP_Entity_Actions_Registry::register()}. It only runs on the `wp_entity_actions_api_init` action. return: string[] The ids of the actions registered, in the order of the param: string $origin Who registers the actions: `core`, or param: string $kind The entity kind (e.g. `postType`). param: string $name The entity name (e.g. `page`). param: array[] $actions The list of action definitions, each with an `id`. param: string|null $script_module The id of the script module providing |
| wp_unregister_entity_actions( $kind, $name, $ids = null ) X-Ref |
| Unregisters actions of an entity, see {@see WP_Entity_Actions_Registry::unregister()}. It only runs on the `wp_entity_actions_api_init` action. return: array[] The list of the definitions unregistered, in param: string $kind The entity kind (e.g. `postType`). param: string $name The entity name (e.g. `page`). param: string[]|null $ids The ids of the actions to unregister. Default |
| wp_get_registered_entity_actions( $kind, $name ) X-Ref |
| Returns the actions registered for the given entity. return: array[] The list of registered action definitions, in param: string $kind The entity kind (e.g. `postType`). param: string $name The entity name (e.g. `page`). |
| wp_get_registered_entity_action_modules( $kind, $name ) X-Ref |
| Returns the script modules registered for the given entity. return: array[] { param: string $kind The entity kind (e.g. `postType`). param: string $name The entity name (e.g. `page`). |
| wp_get_all_registered_entity_action_modules() X-Ref |
| Returns the ids of all script modules registered for any entity. return: array<string, array<string, string[]>> The lists of module ids, |
| _wp_add_entity_action_modules_to_editor_script( $scripts = null ) X-Ref |
| Declares the script modules of the entity actions as dependencies of the editor script, see _wp_add_entity_modules_to_editor_script(). The actions are loaded by `usePostActions()` of the editor script, so every screen showing them loads it. The `admin_footer` action passes it no argument, so the global registry is used. In other scenarios (tests), the scripts are given directly. param: WP_Scripts|null $scripts The scripts registry. Defaults to the global one. |
| _wp_preload_entity_actions( $paths, $context = null ) X-Ref |
| Preloads the actions of the post types the editors list. The editors read them from the `/wp/v2/entity-actions` route as they load, see `useEntityActions()` in packages/editor/src/dataviews/entity-actions-loader.ts in Gutenberg. The post editor reads those of the edited post in its actions menu. The site editor reads those of the edited post, if any, and of the post types of the screen it opens on, whose lists show the actions of their items. A path must match the request of the `getEntityActionsConfig` core data resolver, see packages/core-data/src/resolvers.js in Gutenberg. return: mixed Filtered preload paths. See _wp_add_entity_preload_paths(). param: mixed $paths REST API paths to preload. param: mixed $context Optional. Block editor context. Default null. |
| Generated : Mon Nov 9 08:20:01 2026 | Cross-referenced by PHPXref |