Changeset 13432 for trunk/src/bp-core/bp-core-template.php
- Timestamp:
- 03/01/2023 08:17:11 AM (3 years ago)
- File:
-
- 1 edited
-
trunk/src/bp-core/bp-core-template.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-template.php
r13417 r13432 1400 1400 1401 1401 /** 1402 * Gets the BP root blog's URL. 1403 * 1404 * @since 12.0.0 1405 * 1406 * @return string The BP root blog's URL. 1407 */ 1408 function bp_get_root_url() { 1409 $bp = buddypress(); 1410 1411 if ( ! empty( $bp->root_url ) ) { 1412 $url = $bp->root_url; 1413 } else { 1414 $url = bp_rewrites_get_root_url(); 1415 $bp->root_url = $url; 1416 } 1417 1418 /** 1419 * Filters the "root url", the URL of the BP root blog. 1420 * 1421 * @since 12.0.0 1422 * 1423 * @param string $url URL of the BP root blog. 1424 */ 1425 return apply_filters( 'bp_get_root_url', $url ); 1426 } 1427 1428 /** 1429 * Output the "root url", the URL of the BP root blog. 1430 * 1431 * @since 12.0.0 1432 */ 1433 function bp_root_url() { 1434 echo esc_url( bp_get_root_url() ); 1435 } 1436 1437 /** 1402 1438 * Output the "root domain", the URL of the BP root blog. 1403 1439 * 1404 1440 * @since 1.1.0 1441 * @deprecated 12.0.0 1405 1442 */ 1406 1443 function bp_root_domain() { 1407 echo bp_get_root_domain(); 1444 _deprecated_function( __FUNCTION__, '12.0.0', 'bp_root_url()' ); 1445 bp_root_url(); 1408 1446 } 1409 1447 /** … … 1411 1449 * 1412 1450 * @since 1.1.0 1451 * @deprecated 12.0.0 1413 1452 * 1414 1453 * @return string URL of the BP root blog. 1415 1454 */ 1416 1455 function bp_get_root_domain() { 1417 $bp = buddypress(); 1418 1419 if ( ! empty( $bp->root_domain ) ) { 1420 $domain = $bp->root_domain; 1421 } else { 1422 $domain = bp_core_get_root_domain(); 1423 $bp->root_domain = $domain; 1424 } 1456 /* 1457 * This function is used at many places and we need to review all this 1458 * places during the 12.0 development cycle. Using BP Rewrites means we 1459 * cannot concatenate URL chunks to build our URL anymore. We now need 1460 * to use `bp_rewrites_get_url( $array )` and make sure to use the right 1461 * arguments inside this `$array`. 1462 * 1463 * @todo Once every link reviewed, we'll be able to remove this check 1464 * and let PHPUnit tell us the one we forgot, eventually! 1465 */ 1466 if ( ! buddypress()->is_phpunit_running ) { 1467 _deprecated_function( __FUNCTION__, '12.0.0', 'bp_get_root_url()' ); 1468 } 1469 1470 $domain = bp_get_root_url(); 1425 1471 1426 1472 /** 1427 * Filters the "root domain", the URL of the BP root blog.1473 * Filters the "root domain", the URL of the BP root blog. 1428 1474 * 1429 1475 * @since 1.2.4 1476 * @deprecated 12.0.0 Use {@see 'bp_get_root_url'} instead. 1430 1477 * 1431 1478 * @param string $domain URL of the BP root blog. 1432 1479 */ 1433 return apply_filters ( 'bp_get_root_domain', $domain);1480 return apply_filters_deprecated( 'bp_core_get_root_domain', array( $domain ), '12.0.0', 'bp_get_root_url' ); 1434 1481 } 1435 1482
Note: See TracChangeset
for help on using the changeset viewer.