• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
WordPress core a2z

WordPress core a2z

WordPress core only

  • Home
  • Plugins
  • Blocks
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / _wp_check_split_default_terms() – Check default categories when a term gets split to see if any of them need to be updated.

You appear to be a bot. Output may be restricted

Description

Check default categories when a term gets split to see if any of them need to be updated.

Usage

_wp_check_split_default_terms( $term_id, $new_term_id, $term_taxonomy_id, $taxonomy );

Parameters

$term_id
( int ) required – ID of the formerly shared term.
$new_term_id
( int ) required – ID of the new term created for the $term_taxonomy_id.
$term_taxonomy_id
( int ) required – ID for the term_taxonomy row affected by the split.
$taxonomy
( string ) required – Taxonomy for the split term.

Returns

void

Source

File name: wordpress/wp-includes/taxonomy.php
Lines:

1 to 11 of 11
function _wp_check_split_default_terms( $term_id, $new_term_id, $term_taxonomy_id, $taxonomy ) {
  if ( 'category' !== $taxonomy ) {
    return;
  }

  foreach ( array( 'default_category', 'default_link_category', 'default_email_category' ) as $option ) {
    if ( (int) get_option( $option, -1 ) === $term_id ) {
      update_option( $option, $new_term_id );
    }
  }
}
 

 View on GitHub View on Trac

Published: 25th November 2019 | Last updated: 2nd April 2020

Primary Sidebar

Information

Function name: _wp_check_split_default_terms
Plugin ref: WordPress
Version: 5.6
Sourcefile: wp-includes/taxonomy.php
File ref: wp-includes/taxonomy.php
API type: private
Deprecated?: No
API Letters: _,C,D,S,W

Footer

WP-a2z
WordPress core a2z
WordPress core only
WordPress 5.6
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:  core.wp-a2z.org
© Copyright WP-a2z 2014-2021. All rights reserved.


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

  • Home
  • Blog
  • Sitemap
  • Sites