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: category-template.php
$a = array();
[1000] Fix | Delete
[1001] Fix | Delete
// Generate the output links array.
[1002] Fix | Delete
foreach ( $tags_data as $key => $tag_data ) {
[1003] Fix | Delete
$class = $tag_data['class'] . ' tag-link-position-' . ( $key + 1 );
[1004] Fix | Delete
$a[] = sprintf(
[1005] Fix | Delete
'<a href="%1$s"%2$s class="%3$s" style="font-size: %4$s;"%5$s>%6$s%7$s</a>',
[1006] Fix | Delete
esc_url( $tag_data['url'] ),
[1007] Fix | Delete
$tag_data['role'],
[1008] Fix | Delete
esc_attr( $class ),
[1009] Fix | Delete
esc_attr( str_replace( ',', '.', $tag_data['font_size'] ) . $args['unit'] ),
[1010] Fix | Delete
$tag_data['aria_label'],
[1011] Fix | Delete
esc_html( $tag_data['name'] ),
[1012] Fix | Delete
$tag_data['show_count']
[1013] Fix | Delete
);
[1014] Fix | Delete
}
[1015] Fix | Delete
[1016] Fix | Delete
switch ( $args['format'] ) {
[1017] Fix | Delete
case 'array':
[1018] Fix | Delete
$return =& $a;
[1019] Fix | Delete
break;
[1020] Fix | Delete
case 'list':
[1021] Fix | Delete
/*
[1022] Fix | Delete
* Force role="list", as some browsers (sic: Safari 10) don't expose to assistive
[1023] Fix | Delete
* technologies the default role when the list is styled with `list-style: none`.
[1024] Fix | Delete
* Note: this is redundant but doesn't harm.
[1025] Fix | Delete
*/
[1026] Fix | Delete
$return = "<ul class='wp-tag-cloud' role='list'>\n\t<li>";
[1027] Fix | Delete
$return .= implode( "</li>\n\t<li>", $a );
[1028] Fix | Delete
$return .= "</li>\n</ul>\n";
[1029] Fix | Delete
break;
[1030] Fix | Delete
default:
[1031] Fix | Delete
$return = implode( $args['separator'], $a );
[1032] Fix | Delete
break;
[1033] Fix | Delete
}
[1034] Fix | Delete
[1035] Fix | Delete
if ( $args['filter'] ) {
[1036] Fix | Delete
/**
[1037] Fix | Delete
* Filters the generated output of a tag cloud.
[1038] Fix | Delete
*
[1039] Fix | Delete
* The filter is only evaluated if a true value is passed
[1040] Fix | Delete
* to the $filter argument in wp_generate_tag_cloud().
[1041] Fix | Delete
*
[1042] Fix | Delete
* @since 2.3.0
[1043] Fix | Delete
*
[1044] Fix | Delete
* @see wp_generate_tag_cloud()
[1045] Fix | Delete
*
[1046] Fix | Delete
* @param string[]|string $return String containing the generated HTML tag cloud output
[1047] Fix | Delete
* or an array of tag links if the 'format' argument
[1048] Fix | Delete
* equals 'array'.
[1049] Fix | Delete
* @param WP_Term[] $tags An array of terms used in the tag cloud.
[1050] Fix | Delete
* @param array $args An array of wp_generate_tag_cloud() arguments.
[1051] Fix | Delete
*/
[1052] Fix | Delete
return apply_filters( 'wp_generate_tag_cloud', $return, $tags, $args );
[1053] Fix | Delete
} else {
[1054] Fix | Delete
return $return;
[1055] Fix | Delete
}
[1056] Fix | Delete
}
[1057] Fix | Delete
[1058] Fix | Delete
/**
[1059] Fix | Delete
* Serves as a callback for comparing objects based on name.
[1060] Fix | Delete
*
[1061] Fix | Delete
* Used with `uasort()`.
[1062] Fix | Delete
*
[1063] Fix | Delete
* @since 3.1.0
[1064] Fix | Delete
* @access private
[1065] Fix | Delete
*
[1066] Fix | Delete
* @param object $a The first object to compare.
[1067] Fix | Delete
* @param object $b The second object to compare.
[1068] Fix | Delete
* @return int Negative number if `$a->name` is less than `$b->name`, zero if they are equal,
[1069] Fix | Delete
* or greater than zero if `$a->name` is greater than `$b->name`.
[1070] Fix | Delete
*/
[1071] Fix | Delete
function _wp_object_name_sort_cb( $a, $b ) {
[1072] Fix | Delete
return strnatcasecmp( $a->name, $b->name );
[1073] Fix | Delete
}
[1074] Fix | Delete
[1075] Fix | Delete
/**
[1076] Fix | Delete
* Serves as a callback for comparing objects based on count.
[1077] Fix | Delete
*
[1078] Fix | Delete
* Used with `uasort()`.
[1079] Fix | Delete
*
[1080] Fix | Delete
* @since 3.1.0
[1081] Fix | Delete
* @access private
[1082] Fix | Delete
*
[1083] Fix | Delete
* @param object $a The first object to compare.
[1084] Fix | Delete
* @param object $b The second object to compare.
[1085] Fix | Delete
* @return int Negative number if `$a->count` is less than `$b->count`, zero if they are equal,
[1086] Fix | Delete
* or greater than zero if `$a->count` is greater than `$b->count`.
[1087] Fix | Delete
*/
[1088] Fix | Delete
function _wp_object_count_sort_cb( $a, $b ) {
[1089] Fix | Delete
return ( $a->count - $b->count );
[1090] Fix | Delete
}
[1091] Fix | Delete
[1092] Fix | Delete
//
[1093] Fix | Delete
// Helper functions.
[1094] Fix | Delete
//
[1095] Fix | Delete
[1096] Fix | Delete
/**
[1097] Fix | Delete
* Retrieves HTML list content for category list.
[1098] Fix | Delete
*
[1099] Fix | Delete
* @since 2.1.0
[1100] Fix | Delete
* @since 5.3.0 Formalized the existing `...$args` parameter by adding it
[1101] Fix | Delete
* to the function signature.
[1102] Fix | Delete
*
[1103] Fix | Delete
* @uses Walker_Category to create HTML list content.
[1104] Fix | Delete
* @see Walker::walk() for parameters and return description.
[1105] Fix | Delete
*
[1106] Fix | Delete
* @param mixed ...$args Elements array, maximum hierarchical depth and optional additional arguments.
[1107] Fix | Delete
* @return string
[1108] Fix | Delete
*/
[1109] Fix | Delete
function walk_category_tree( ...$args ) {
[1110] Fix | Delete
// The user's options are the third parameter.
[1111] Fix | Delete
if ( empty( $args[2]['walker'] ) || ! ( $args[2]['walker'] instanceof Walker ) ) {
[1112] Fix | Delete
$walker = new Walker_Category();
[1113] Fix | Delete
} else {
[1114] Fix | Delete
/**
[1115] Fix | Delete
* @var Walker $walker
[1116] Fix | Delete
*/
[1117] Fix | Delete
$walker = $args[2]['walker'];
[1118] Fix | Delete
}
[1119] Fix | Delete
return $walker->walk( ...$args );
[1120] Fix | Delete
}
[1121] Fix | Delete
[1122] Fix | Delete
/**
[1123] Fix | Delete
* Retrieves HTML dropdown (select) content for category list.
[1124] Fix | Delete
*
[1125] Fix | Delete
* @since 2.1.0
[1126] Fix | Delete
* @since 5.3.0 Formalized the existing `...$args` parameter by adding it
[1127] Fix | Delete
* to the function signature.
[1128] Fix | Delete
*
[1129] Fix | Delete
* @uses Walker_CategoryDropdown to create HTML dropdown content.
[1130] Fix | Delete
* @see Walker::walk() for parameters and return description.
[1131] Fix | Delete
*
[1132] Fix | Delete
* @param mixed ...$args Elements array, maximum hierarchical depth and optional additional arguments.
[1133] Fix | Delete
* @return string
[1134] Fix | Delete
*/
[1135] Fix | Delete
function walk_category_dropdown_tree( ...$args ) {
[1136] Fix | Delete
// The user's options are the third parameter.
[1137] Fix | Delete
if ( empty( $args[2]['walker'] ) || ! ( $args[2]['walker'] instanceof Walker ) ) {
[1138] Fix | Delete
$walker = new Walker_CategoryDropdown();
[1139] Fix | Delete
} else {
[1140] Fix | Delete
/**
[1141] Fix | Delete
* @var Walker $walker
[1142] Fix | Delete
*/
[1143] Fix | Delete
$walker = $args[2]['walker'];
[1144] Fix | Delete
}
[1145] Fix | Delete
return $walker->walk( ...$args );
[1146] Fix | Delete
}
[1147] Fix | Delete
[1148] Fix | Delete
//
[1149] Fix | Delete
// Tags.
[1150] Fix | Delete
//
[1151] Fix | Delete
[1152] Fix | Delete
/**
[1153] Fix | Delete
* Retrieves the link to the tag.
[1154] Fix | Delete
*
[1155] Fix | Delete
* @since 2.3.0
[1156] Fix | Delete
*
[1157] Fix | Delete
* @see get_term_link()
[1158] Fix | Delete
*
[1159] Fix | Delete
* @param int|object $tag Tag ID or object.
[1160] Fix | Delete
* @return string Link on success, empty string if tag does not exist.
[1161] Fix | Delete
*/
[1162] Fix | Delete
function get_tag_link( $tag ) {
[1163] Fix | Delete
return get_category_link( $tag );
[1164] Fix | Delete
}
[1165] Fix | Delete
[1166] Fix | Delete
/**
[1167] Fix | Delete
* Retrieves the tags for a post.
[1168] Fix | Delete
*
[1169] Fix | Delete
* @since 2.3.0
[1170] Fix | Delete
*
[1171] Fix | Delete
* @param int|WP_Post $post Post ID or object.
[1172] Fix | Delete
* @return WP_Term[]|false|WP_Error Array of WP_Term objects on success, false if there are no terms
[1173] Fix | Delete
* or the post does not exist, WP_Error on failure.
[1174] Fix | Delete
*/
[1175] Fix | Delete
function get_the_tags( $post = 0 ) {
[1176] Fix | Delete
$terms = get_the_terms( $post, 'post_tag' );
[1177] Fix | Delete
[1178] Fix | Delete
/**
[1179] Fix | Delete
* Filters the array of tags for the given post.
[1180] Fix | Delete
*
[1181] Fix | Delete
* @since 2.3.0
[1182] Fix | Delete
*
[1183] Fix | Delete
* @see get_the_terms()
[1184] Fix | Delete
*
[1185] Fix | Delete
* @param WP_Term[]|false|WP_Error $terms Array of WP_Term objects on success, false if there are no terms
[1186] Fix | Delete
* or the post does not exist, WP_Error on failure.
[1187] Fix | Delete
*/
[1188] Fix | Delete
return apply_filters( 'get_the_tags', $terms );
[1189] Fix | Delete
}
[1190] Fix | Delete
[1191] Fix | Delete
/**
[1192] Fix | Delete
* Retrieves the tags for a post formatted as a string.
[1193] Fix | Delete
*
[1194] Fix | Delete
* @since 2.3.0
[1195] Fix | Delete
*
[1196] Fix | Delete
* @param string $before Optional. String to use before the tags. Default empty.
[1197] Fix | Delete
* @param string $sep Optional. String to use between the tags. Default empty.
[1198] Fix | Delete
* @param string $after Optional. String to use after the tags. Default empty.
[1199] Fix | Delete
* @param int $post_id Optional. Post ID. Defaults to the current post ID.
[1200] Fix | Delete
* @return string|false|WP_Error A list of tags on success, false if there are no terms,
[1201] Fix | Delete
* WP_Error on failure.
[1202] Fix | Delete
*/
[1203] Fix | Delete
function get_the_tag_list( $before = '', $sep = '', $after = '', $post_id = 0 ) {
[1204] Fix | Delete
$tag_list = get_the_term_list( $post_id, 'post_tag', $before, $sep, $after );
[1205] Fix | Delete
[1206] Fix | Delete
/**
[1207] Fix | Delete
* Filters the tags list for a given post.
[1208] Fix | Delete
*
[1209] Fix | Delete
* @since 2.3.0
[1210] Fix | Delete
*
[1211] Fix | Delete
* @param string $tag_list List of tags.
[1212] Fix | Delete
* @param string $before String to use before the tags.
[1213] Fix | Delete
* @param string $sep String to use between the tags.
[1214] Fix | Delete
* @param string $after String to use after the tags.
[1215] Fix | Delete
* @param int $post_id Post ID.
[1216] Fix | Delete
*/
[1217] Fix | Delete
return apply_filters( 'the_tags', $tag_list, $before, $sep, $after, $post_id );
[1218] Fix | Delete
}
[1219] Fix | Delete
[1220] Fix | Delete
/**
[1221] Fix | Delete
* Displays the tags for a post.
[1222] Fix | Delete
*
[1223] Fix | Delete
* @since 2.3.0
[1224] Fix | Delete
*
[1225] Fix | Delete
* @param string $before Optional. String to use before the tags. Defaults to 'Tags:'.
[1226] Fix | Delete
* @param string $sep Optional. String to use between the tags. Default ', '.
[1227] Fix | Delete
* @param string $after Optional. String to use after the tags. Default empty.
[1228] Fix | Delete
*/
[1229] Fix | Delete
function the_tags( $before = null, $sep = ', ', $after = '' ) {
[1230] Fix | Delete
if ( null === $before ) {
[1231] Fix | Delete
$before = __( 'Tags: ' );
[1232] Fix | Delete
}
[1233] Fix | Delete
[1234] Fix | Delete
$the_tags = get_the_tag_list( $before, $sep, $after );
[1235] Fix | Delete
[1236] Fix | Delete
if ( ! is_wp_error( $the_tags ) ) {
[1237] Fix | Delete
echo $the_tags;
[1238] Fix | Delete
}
[1239] Fix | Delete
}
[1240] Fix | Delete
[1241] Fix | Delete
/**
[1242] Fix | Delete
* Retrieves tag description.
[1243] Fix | Delete
*
[1244] Fix | Delete
* @since 2.8.0
[1245] Fix | Delete
*
[1246] Fix | Delete
* @param int $tag Optional. Tag ID. Defaults to the current tag ID.
[1247] Fix | Delete
* @return string Tag description, if available.
[1248] Fix | Delete
*/
[1249] Fix | Delete
function tag_description( $tag = 0 ) {
[1250] Fix | Delete
return term_description( $tag );
[1251] Fix | Delete
}
[1252] Fix | Delete
[1253] Fix | Delete
/**
[1254] Fix | Delete
* Retrieves term description.
[1255] Fix | Delete
*
[1256] Fix | Delete
* @since 2.8.0
[1257] Fix | Delete
* @since 4.9.2 The `$taxonomy` parameter was deprecated.
[1258] Fix | Delete
*
[1259] Fix | Delete
* @param int $term Optional. Term ID. Defaults to the current term ID.
[1260] Fix | Delete
* @param null $deprecated Deprecated. Not used.
[1261] Fix | Delete
* @return string Term description, if available.
[1262] Fix | Delete
*/
[1263] Fix | Delete
function term_description( $term = 0, $deprecated = null ) {
[1264] Fix | Delete
if ( ! $term && ( is_tax() || is_tag() || is_category() ) ) {
[1265] Fix | Delete
$term = get_queried_object();
[1266] Fix | Delete
if ( $term ) {
[1267] Fix | Delete
$term = $term->term_id;
[1268] Fix | Delete
}
[1269] Fix | Delete
}
[1270] Fix | Delete
[1271] Fix | Delete
$description = get_term_field( 'description', $term );
[1272] Fix | Delete
[1273] Fix | Delete
return is_wp_error( $description ) ? '' : $description;
[1274] Fix | Delete
}
[1275] Fix | Delete
[1276] Fix | Delete
/**
[1277] Fix | Delete
* Retrieves the terms of the taxonomy that are attached to the post.
[1278] Fix | Delete
*
[1279] Fix | Delete
* @since 2.5.0
[1280] Fix | Delete
*
[1281] Fix | Delete
* @param int|WP_Post $post Post ID or object.
[1282] Fix | Delete
* @param string $taxonomy Taxonomy name.
[1283] Fix | Delete
* @return WP_Term[]|false|WP_Error Array of WP_Term objects on success, false if there are no terms
[1284] Fix | Delete
* or the post does not exist, WP_Error on failure.
[1285] Fix | Delete
*/
[1286] Fix | Delete
function get_the_terms( $post, $taxonomy ) {
[1287] Fix | Delete
$post = get_post( $post );
[1288] Fix | Delete
[1289] Fix | Delete
if ( ! $post ) {
[1290] Fix | Delete
return false;
[1291] Fix | Delete
}
[1292] Fix | Delete
[1293] Fix | Delete
$terms = get_object_term_cache( $post->ID, $taxonomy );
[1294] Fix | Delete
[1295] Fix | Delete
if ( false === $terms ) {
[1296] Fix | Delete
$terms = wp_get_object_terms( $post->ID, $taxonomy );
[1297] Fix | Delete
if ( ! is_wp_error( $terms ) ) {
[1298] Fix | Delete
$term_ids = wp_list_pluck( $terms, 'term_id' );
[1299] Fix | Delete
wp_cache_add( $post->ID, $term_ids, $taxonomy . '_relationships' );
[1300] Fix | Delete
}
[1301] Fix | Delete
}
[1302] Fix | Delete
[1303] Fix | Delete
/**
[1304] Fix | Delete
* Filters the list of terms attached to the given post.
[1305] Fix | Delete
*
[1306] Fix | Delete
* @since 3.1.0
[1307] Fix | Delete
*
[1308] Fix | Delete
* @param WP_Term[]|WP_Error $terms Array of attached terms, or WP_Error on failure.
[1309] Fix | Delete
* @param int $post_id Post ID.
[1310] Fix | Delete
* @param string $taxonomy Name of the taxonomy.
[1311] Fix | Delete
*/
[1312] Fix | Delete
$terms = apply_filters( 'get_the_terms', $terms, $post->ID, $taxonomy );
[1313] Fix | Delete
[1314] Fix | Delete
if ( empty( $terms ) ) {
[1315] Fix | Delete
return false;
[1316] Fix | Delete
}
[1317] Fix | Delete
[1318] Fix | Delete
return $terms;
[1319] Fix | Delete
}
[1320] Fix | Delete
[1321] Fix | Delete
/**
[1322] Fix | Delete
* Retrieves a post's terms as a list with specified format.
[1323] Fix | Delete
*
[1324] Fix | Delete
* Terms are linked to their respective term listing pages.
[1325] Fix | Delete
*
[1326] Fix | Delete
* @since 2.5.0
[1327] Fix | Delete
*
[1328] Fix | Delete
* @param int $post_id Post ID.
[1329] Fix | Delete
* @param string $taxonomy Taxonomy name.
[1330] Fix | Delete
* @param string $before Optional. String to use before the terms. Default empty.
[1331] Fix | Delete
* @param string $sep Optional. String to use between the terms. Default empty.
[1332] Fix | Delete
* @param string $after Optional. String to use after the terms. Default empty.
[1333] Fix | Delete
* @return string|false|WP_Error A list of terms on success, false if there are no terms,
[1334] Fix | Delete
* WP_Error on failure.
[1335] Fix | Delete
*/
[1336] Fix | Delete
function get_the_term_list( $post_id, $taxonomy, $before = '', $sep = '', $after = '' ) {
[1337] Fix | Delete
$terms = get_the_terms( $post_id, $taxonomy );
[1338] Fix | Delete
[1339] Fix | Delete
if ( is_wp_error( $terms ) ) {
[1340] Fix | Delete
return $terms;
[1341] Fix | Delete
}
[1342] Fix | Delete
[1343] Fix | Delete
if ( empty( $terms ) ) {
[1344] Fix | Delete
return false;
[1345] Fix | Delete
}
[1346] Fix | Delete
[1347] Fix | Delete
$links = array();
[1348] Fix | Delete
[1349] Fix | Delete
foreach ( $terms as $term ) {
[1350] Fix | Delete
$link = get_term_link( $term, $taxonomy );
[1351] Fix | Delete
if ( is_wp_error( $link ) ) {
[1352] Fix | Delete
return $link;
[1353] Fix | Delete
}
[1354] Fix | Delete
$links[] = '<a href="' . esc_url( $link ) . '" rel="tag">' . $term->name . '</a>';
[1355] Fix | Delete
}
[1356] Fix | Delete
[1357] Fix | Delete
/**
[1358] Fix | Delete
* Filters the term links for a given taxonomy.
[1359] Fix | Delete
*
[1360] Fix | Delete
* The dynamic portion of the hook name, `$taxonomy`, refers
[1361] Fix | Delete
* to the taxonomy slug.
[1362] Fix | Delete
*
[1363] Fix | Delete
* Possible hook names include:
[1364] Fix | Delete
*
[1365] Fix | Delete
* - `term_links-category`
[1366] Fix | Delete
* - `term_links-post_tag`
[1367] Fix | Delete
* - `term_links-post_format`
[1368] Fix | Delete
*
[1369] Fix | Delete
* @since 2.5.0
[1370] Fix | Delete
*
[1371] Fix | Delete
* @param string[] $links An array of term links.
[1372] Fix | Delete
*/
[1373] Fix | Delete
$term_links = apply_filters( "term_links-{$taxonomy}", $links ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
[1374] Fix | Delete
[1375] Fix | Delete
return $before . implode( $sep, $term_links ) . $after;
[1376] Fix | Delete
}
[1377] Fix | Delete
[1378] Fix | Delete
/**
[1379] Fix | Delete
* Retrieves term parents with separator.
[1380] Fix | Delete
*
[1381] Fix | Delete
* @since 4.8.0
[1382] Fix | Delete
*
[1383] Fix | Delete
* @param int $term_id Term ID.
[1384] Fix | Delete
* @param string $taxonomy Taxonomy name.
[1385] Fix | Delete
* @param string|array $args {
[1386] Fix | Delete
* Array of optional arguments.
[1387] Fix | Delete
*
[1388] Fix | Delete
* @type string $format Use term names or slugs for display. Accepts 'name' or 'slug'.
[1389] Fix | Delete
* Default 'name'.
[1390] Fix | Delete
* @type string $separator Separator for between the terms. Default '/'.
[1391] Fix | Delete
* @type bool $link Whether to format as a link. Default true.
[1392] Fix | Delete
* @type bool $inclusive Include the term to get the parents for. Default true.
[1393] Fix | Delete
* }
[1394] Fix | Delete
* @return string|WP_Error A list of term parents on success, WP_Error or empty string on failure.
[1395] Fix | Delete
*/
[1396] Fix | Delete
function get_term_parents_list( $term_id, $taxonomy, $args = array() ) {
[1397] Fix | Delete
$list = '';
[1398] Fix | Delete
$term = get_term( $term_id, $taxonomy );
[1399] Fix | Delete
[1400] Fix | Delete
if ( is_wp_error( $term ) ) {
[1401] Fix | Delete
return $term;
[1402] Fix | Delete
}
[1403] Fix | Delete
[1404] Fix | Delete
if ( ! $term ) {
[1405] Fix | Delete
return $list;
[1406] Fix | Delete
}
[1407] Fix | Delete
[1408] Fix | Delete
$term_id = $term->term_id;
[1409] Fix | Delete
[1410] Fix | Delete
$defaults = array(
[1411] Fix | Delete
'format' => 'name',
[1412] Fix | Delete
'separator' => '/',
[1413] Fix | Delete
'link' => true,
[1414] Fix | Delete
'inclusive' => true,
[1415] Fix | Delete
);
[1416] Fix | Delete
[1417] Fix | Delete
$args = wp_parse_args( $args, $defaults );
[1418] Fix | Delete
[1419] Fix | Delete
foreach ( array( 'link', 'inclusive' ) as $bool ) {
[1420] Fix | Delete
$args[ $bool ] = wp_validate_boolean( $args[ $bool ] );
[1421] Fix | Delete
}
[1422] Fix | Delete
[1423] Fix | Delete
$parents = get_ancestors( $term_id, $taxonomy, 'taxonomy' );
[1424] Fix | Delete
[1425] Fix | Delete
if ( $args['inclusive'] ) {
[1426] Fix | Delete
array_unshift( $parents, $term_id );
[1427] Fix | Delete
}
[1428] Fix | Delete
[1429] Fix | Delete
foreach ( array_reverse( $parents ) as $term_id ) {
[1430] Fix | Delete
$parent = get_term( $term_id, $taxonomy );
[1431] Fix | Delete
$name = ( 'slug' === $args['format'] ) ? $parent->slug : $parent->name;
[1432] Fix | Delete
[1433] Fix | Delete
if ( $args['link'] ) {
[1434] Fix | Delete
$list .= '<a href="' . esc_url( get_term_link( $parent->term_id, $taxonomy ) ) . '">' . $name . '</a>' . $args['separator'];
[1435] Fix | Delete
} else {
[1436] Fix | Delete
$list .= $name . $args['separator'];
[1437] Fix | Delete
}
[1438] Fix | Delete
}
[1439] Fix | Delete
[1440] Fix | Delete
return $list;
[1441] Fix | Delete
}
[1442] Fix | Delete
[1443] Fix | Delete
/**
[1444] Fix | Delete
* Displays the terms for a post in a list.
[1445] Fix | Delete
*
[1446] Fix | Delete
* @since 2.5.0
[1447] Fix | Delete
*
[1448] Fix | Delete
* @param int $post_id Post ID.
[1449] Fix | Delete
* @param string $taxonomy Taxonomy name.
[1450] Fix | Delete
* @param string $before Optional. String to use before the terms. Default empty.
[1451] Fix | Delete
* @param string $sep Optional. String to use between the terms. Default ', '.
[1452] Fix | Delete
* @param string $after Optional. String to use after the terms. Default empty.
[1453] Fix | Delete
* @return void|false Void on success, false on failure.
[1454] Fix | Delete
*/
[1455] Fix | Delete
function the_terms( $post_id, $taxonomy, $before = '', $sep = ', ', $after = '' ) {
[1456] Fix | Delete
$term_list = get_the_term_list( $post_id, $taxonomy, $before, $sep, $after );
[1457] Fix | Delete
[1458] Fix | Delete
if ( is_wp_error( $term_list ) ) {
[1459] Fix | Delete
return false;
[1460] Fix | Delete
}
[1461] Fix | Delete
[1462] Fix | Delete
/**
[1463] Fix | Delete
* Filters the list of terms to display.
[1464] Fix | Delete
*
[1465] Fix | Delete
* @since 2.9.0
[1466] Fix | Delete
*
[1467] Fix | Delete
* @param string $term_list List of terms to display.
[1468] Fix | Delete
* @param string $taxonomy The taxonomy name.
[1469] Fix | Delete
* @param string $before String to use before the terms.
[1470] Fix | Delete
* @param string $sep String to use between the terms.
[1471] Fix | Delete
* @param string $after String to use after the terms.
[1472] Fix | Delete
*/
[1473] Fix | Delete
echo apply_filters( 'the_terms', $term_list, $taxonomy, $before, $sep, $after );
[1474] Fix | Delete
}
[1475] Fix | Delete
[1476] Fix | Delete
/**
[1477] Fix | Delete
* Checks if the current post has any of given category.
[1478] Fix | Delete
*
[1479] Fix | Delete
* The given categories are checked against the post's categories' term_ids, names and slugs.
[1480] Fix | Delete
* Categories given as integers will only be checked against the post's categories' term_ids.
[1481] Fix | Delete
*
[1482] Fix | Delete
* If no categories are given, determines if post has any categories.
[1483] Fix | Delete
*
[1484] Fix | Delete
* @since 3.1.0
[1485] Fix | Delete
*
[1486] Fix | Delete
* @param string|int|array $category Optional. The category name/term_id/slug,
[1487] Fix | Delete
* or an array of them to check for. Default empty.
[1488] Fix | Delete
* @param int|WP_Post $post Optional. Post to check. Defaults to the current post.
[1489] Fix | Delete
* @return bool True if the current post has any of the given categories
[1490] Fix | Delete
* (or any category, if no category specified). False otherwise.
[1491] Fix | Delete
*/
[1492] Fix | Delete
function has_category( $category = '', $post = null ) {
[1493] Fix | Delete
return has_term( $category, 'category', $post );
[1494] Fix | Delete
}
[1495] Fix | Delete
[1496] Fix | Delete
/**
[1497] Fix | Delete
* Checks if the current post has any of given tags.
[1498] Fix | Delete
*
[1499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function