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



pre_get_shortlink ›

Seit3.0.0
Veraltetn/v
apply_filters( 'pre_get_shortlink', false, $id, $context, $allow_slugs )
Parameter: (4)
  • (bool|string) $return Short-circuit return value. Either false or a URL string.
    Erforderlich: Ja
  • (int) $id Post ID, or 0 for the current post.
    Erforderlich: Ja
  • (string) $context The context for the link. One of 'post' or 'query',
    Erforderlich: Ja
  • (bool) $allow_slugs Whether to allow post slugs in the shortlink.
    Erforderlich: Ja
Definiert in:
Codex:

Filters whether to preempt generating a shortlink for the given post.

Passing a truthy value to the filter will effectively short-circuit the shortlink-generation process, returning that value instead.





Quellcode

$shortlink = apply_filters( 'pre_get_shortlink', false, $id, $context, $allow_slugs );