wpseek.com
Bazujące na WordPress narzędzie wyszukiwania dla deweloperów i twórców motywów.



_wp_preload_entity_actions › WordPress Function

Od7.2.0
Przestarzałyn/a
› _wp_preload_entity_actions ( $paths, $context = null )
Dostęp:
  • private
Parametry: (2)
  • (mixed) $paths REST API paths to preload.
    Wymagane: Tak
  • (mixed) $context Optional. Block editor context. Default null.
    Wymagane: Nie
    Domyślny: null
Powrót:
  • (mixed) Filtered preload paths. See _wp_add_entity_preload_paths().
Zdefiniowane na:
Codex:

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.


Źródło

function _wp_preload_entity_actions( $paths, $context = null ) {
	return _wp_add_entity_preload_paths( $paths, $context, '/wp/v2/entity-actions' );
}