• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
Yoast SEO a2z

Yoast SEO a2z

WordPress SEO a2z

  • Home
  • Plugins
  • Blocks
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / WPSEO_Primary_Term_Admin::generate_primary_term_taxonomies() – Generates the primary term taxonomies.

You appear to be a bot. Output may be restricted

Description

Generates the primary term taxonomies.

Usage

$array = WPSEO_Primary_Term_Admin::generate_primary_term_taxonomies( $post_id );

Parameters

$post_id
( int ) required – ID of the post.

Returns

array

Source

File name: wordpress-seo/admin/class-primary-term-admin.php
Lines:

1 to 18 of 18
  protected function generate_primary_term_taxonomies( $post_id ) {
    $post_type      = get_post_type( $post_id );
    $all_taxonomies = get_object_taxonomies( $post_type, 'objects' );
    $all_taxonomies = array_filter( $all_taxonomies, [ $this, 'filter_hierarchical_taxonomies' ] );

    
/**
 * Filters which taxonomies for which the user can choose the primary term.
 *
 * @api array    $taxonomies An array of taxonomy objects that are primary_term enabled.
 *
 * @param string $post_type      The post type for which to filter the taxonomies.
 * @param array  $all_taxonomies All taxonomies for this post types, even ones that don't have primary term
 *                               enabled.
 */
    $taxonomies = (array) apply_filters( 'wpseo_primary_term_taxonomies', $all_taxonomies, $post_type, $all_taxonomies );

    return $taxonomies;
  }
 

 View on GitHub View on Trac

Published: 27th November 2019 | Last updated: 19th December 2019

Primary Sidebar

Information

Function name: WPSEO_Primary_Term_Admin::generate_primary_term_taxonomies
Class ref: WPSEO_Primary_Term_Admin
Plugin ref: Yoast SEO
Version: 20.2.1
Sourcefile: admin/class-primary-term-admin.php
File ref: admin/class-primary-term-admin.php
Deprecated?: No
API Letters: A,G,P,T,W

Footer

Yoast SEO a2z
Yoast SEO a2z
WordPress SEO a2z
WordPress 6.1.1
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  wordpress-seo.wp-a2z.org
© Copyright Yoast SEO a2z 2017-2023. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites