wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



_wp_preload_entity_fields › WordPress Function

Seit7.2.0
Veraltetn/v
› _wp_preload_entity_fields ( $paths, $context = null )
Zugriff:
  • private
Parameter: (2)
  • (mixed) $paths REST API paths to preload.
    Erforderlich: Ja
  • (mixed) $context Optional. Block editor context. Default null.
    Erforderlich: Nein
    Standard: null
Gibt zurück:
  • (mixed) Filtered preload paths. See _wp_add_entity_preload_paths().
Definiert in:
Codex:

Preloads the fields of the post types the editors list.

The editors read them from the /wp/v2/entity-fields route, see useFields in packages/editor/src/dataviews/fields-loader/index.ts in Gutenberg. The post editor reads those of the edited post in the post summary of its inspector. The site editor reads those of the edited post, if any, and of the post types of the screen it opens on. A path must match the request of the getFieldsConfig core data resolver, see packages/core-data/src/resolvers.js in Gutenberg.


Quellcode

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