Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-inclu...
File: taxonomy.php
*
[5000] Fix | Delete
* @param int $term_id Term ID.
[5001] Fix | Delete
* @param string $taxonomy Taxonomy name.
[5002] Fix | Delete
* @return int|false Parent term ID on success, false on failure.
[5003] Fix | Delete
*/
[5004] Fix | Delete
function wp_get_term_taxonomy_parent_id( $term_id, $taxonomy ) {
[5005] Fix | Delete
$term = get_term( $term_id, $taxonomy );
[5006] Fix | Delete
if ( ! $term || is_wp_error( $term ) ) {
[5007] Fix | Delete
return false;
[5008] Fix | Delete
}
[5009] Fix | Delete
return (int) $term->parent;
[5010] Fix | Delete
}
[5011] Fix | Delete
[5012] Fix | Delete
/**
[5013] Fix | Delete
* Checks the given subset of the term hierarchy for hierarchy loops.
[5014] Fix | Delete
* Prevents loops from forming and breaks those that it finds.
[5015] Fix | Delete
*
[5016] Fix | Delete
* Attached to the {@see 'wp_update_term_parent'} filter.
[5017] Fix | Delete
*
[5018] Fix | Delete
* @since 3.1.0
[5019] Fix | Delete
*
[5020] Fix | Delete
* @param int $parent_term `term_id` of the parent for the term we're checking.
[5021] Fix | Delete
* @param int $term_id The term we're checking.
[5022] Fix | Delete
* @param string $taxonomy The taxonomy of the term we're checking.
[5023] Fix | Delete
* @return int The new parent for the term.
[5024] Fix | Delete
*/
[5025] Fix | Delete
function wp_check_term_hierarchy_for_loops( $parent_term, $term_id, $taxonomy ) {
[5026] Fix | Delete
// Nothing fancy here - bail.
[5027] Fix | Delete
if ( ! $parent_term ) {
[5028] Fix | Delete
return 0;
[5029] Fix | Delete
}
[5030] Fix | Delete
[5031] Fix | Delete
// Can't be its own parent.
[5032] Fix | Delete
if ( $parent_term === $term_id ) {
[5033] Fix | Delete
return 0;
[5034] Fix | Delete
}
[5035] Fix | Delete
[5036] Fix | Delete
// Now look for larger loops.
[5037] Fix | Delete
$loop = wp_find_hierarchy_loop( 'wp_get_term_taxonomy_parent_id', $term_id, $parent_term, array( $taxonomy ) );
[5038] Fix | Delete
if ( ! $loop ) {
[5039] Fix | Delete
return $parent_term; // No loop.
[5040] Fix | Delete
}
[5041] Fix | Delete
[5042] Fix | Delete
// Setting $parent_term to the given value causes a loop.
[5043] Fix | Delete
if ( isset( $loop[ $term_id ] ) ) {
[5044] Fix | Delete
return 0;
[5045] Fix | Delete
}
[5046] Fix | Delete
[5047] Fix | Delete
// There's a loop, but it doesn't contain $term_id. Break the loop.
[5048] Fix | Delete
foreach ( array_keys( $loop ) as $loop_member ) {
[5049] Fix | Delete
wp_update_term( $loop_member, $taxonomy, array( 'parent' => 0 ) );
[5050] Fix | Delete
}
[5051] Fix | Delete
[5052] Fix | Delete
return $parent_term;
[5053] Fix | Delete
}
[5054] Fix | Delete
[5055] Fix | Delete
/**
[5056] Fix | Delete
* Determines whether a taxonomy is considered "viewable".
[5057] Fix | Delete
*
[5058] Fix | Delete
* @since 5.1.0
[5059] Fix | Delete
*
[5060] Fix | Delete
* @param string|WP_Taxonomy $taxonomy Taxonomy name or object.
[5061] Fix | Delete
* @return bool Whether the taxonomy should be considered viewable.
[5062] Fix | Delete
*/
[5063] Fix | Delete
function is_taxonomy_viewable( $taxonomy ) {
[5064] Fix | Delete
if ( is_scalar( $taxonomy ) ) {
[5065] Fix | Delete
$taxonomy = get_taxonomy( $taxonomy );
[5066] Fix | Delete
if ( ! $taxonomy ) {
[5067] Fix | Delete
return false;
[5068] Fix | Delete
}
[5069] Fix | Delete
}
[5070] Fix | Delete
[5071] Fix | Delete
return $taxonomy->publicly_queryable;
[5072] Fix | Delete
}
[5073] Fix | Delete
[5074] Fix | Delete
/**
[5075] Fix | Delete
* Determines whether a term is publicly viewable.
[5076] Fix | Delete
*
[5077] Fix | Delete
* A term is considered publicly viewable if its taxonomy is viewable.
[5078] Fix | Delete
*
[5079] Fix | Delete
* @since 6.1.0
[5080] Fix | Delete
*
[5081] Fix | Delete
* @param int|WP_Term $term Term ID or term object.
[5082] Fix | Delete
* @return bool Whether the term is publicly viewable.
[5083] Fix | Delete
*/
[5084] Fix | Delete
function is_term_publicly_viewable( $term ) {
[5085] Fix | Delete
$term = get_term( $term );
[5086] Fix | Delete
[5087] Fix | Delete
if ( ! $term ) {
[5088] Fix | Delete
return false;
[5089] Fix | Delete
}
[5090] Fix | Delete
[5091] Fix | Delete
return is_taxonomy_viewable( $term->taxonomy );
[5092] Fix | Delete
}
[5093] Fix | Delete
[5094] Fix | Delete
/**
[5095] Fix | Delete
* Sets the last changed time for the 'terms' cache group.
[5096] Fix | Delete
*
[5097] Fix | Delete
* @since 5.0.0
[5098] Fix | Delete
*/
[5099] Fix | Delete
function wp_cache_set_terms_last_changed() {
[5100] Fix | Delete
wp_cache_set_last_changed( 'terms' );
[5101] Fix | Delete
}
[5102] Fix | Delete
[5103] Fix | Delete
/**
[5104] Fix | Delete
* Aborts calls to term meta if it is not supported.
[5105] Fix | Delete
*
[5106] Fix | Delete
* @since 5.0.0
[5107] Fix | Delete
*
[5108] Fix | Delete
* @param mixed $check Skip-value for whether to proceed term meta function execution.
[5109] Fix | Delete
* @return mixed Original value of $check, or false if term meta is not supported.
[5110] Fix | Delete
*/
[5111] Fix | Delete
function wp_check_term_meta_support_prefilter( $check ) {
[5112] Fix | Delete
if ( get_option( 'db_version' ) < 34370 ) {
[5113] Fix | Delete
return false;
[5114] Fix | Delete
}
[5115] Fix | Delete
[5116] Fix | Delete
return $check;
[5117] Fix | Delete
}
[5118] Fix | Delete
[5119] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function