wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren
build_variation_for_navigation_link › WordPress Function
Seit5.9.0
Veraltetn/v
› build_variation_for_navigation_link ( $entity, $kind )
Parameter: (2) |
|
Gibt zurück: |
|
Definiert in: |
|
Codex: |
Returns a navigation link variation
Quellcode
function build_variation_for_navigation_link( $entity, $kind ) { $title = ''; $description = ''; if ( property_exists( $entity->labels, 'item_link' ) ) { $title = $entity->labels->item_link; } if ( property_exists( $entity->labels, 'item_link_description' ) ) { $description = $entity->labels->item_link_description; } $variation = array( 'name' => $entity->name, 'title' => $title, 'description' => $description, 'attributes' => array( 'type' => $entity->name, 'kind' => $kind, ), ); // Tweak some value for the variations. $variation_overrides = array( 'post_tag' => array( 'name' => 'tag', 'attributes' => array( 'type' => 'tag', 'kind' => $kind, ), ), 'post_format' => array( // The item_link and item_link_description for post formats is the // same as for tags, so need to be overridden. 'title' => __( 'Post Format Link' ), 'description' => __( 'A link to a post format' ), 'attributes' => array( 'type' => 'post_format', 'kind' => $kind, ), ), ); if ( array_key_exists( $entity->name, $variation_overrides ) ) { $variation = array_merge( $variation, $variation_overrides[ $entity->name ] ); } return $variation; }