Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
04/08/2023 06:31:46 AM (13 months ago)
Author:
imath
Message:

Make sure all Groups component URLs are built using BP rewrites API

  • Introduce the bp_groups_get_create_url() to ease Groups create URLs generation.
  • Improve bp_groups_get_path_chunks() to deal with front-end group admin URLs and the Groups create URLs.
  • Deprecate bp_get_groups_directory_permalink() in favor of bp_get_groups_directory_url().
  • Replace all remaining deprecated functions usage.
  • Start putting deprecated functions behind a function_exists( 'bp_classic' ) check, corresponding functions were added inside the BP Classic backcompat plugin.
  • Adjust some Groups routing unit tests.

Props r-a-y, johnjamesjacoby, boonebgorges

Closes https://github.com/buddypress/buddypress/pull/83
See #4954

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/bp-core-template.php

    r13448 r13449  
    14511451    echo esc_url( bp_get_root_url() );
    14521452}
    1453 
    1454 /**
    1455  * Output the "root domain", the URL of the BP root blog.
    1456  *
    1457  * @since 1.1.0
    1458  * @deprecated 12.0.0
    1459  */
    1460 function bp_root_domain() {
    1461     _deprecated_function( __FUNCTION__, '12.0.0', 'bp_root_url()' );
    1462     bp_root_url();
    1463 }
    1464     /**
    1465      * Return the "root domain", the URL of the BP root blog.
    1466      *
    1467      * @since 1.1.0
    1468      * @deprecated 12.0.0
    1469      *
    1470      * @return string URL of the BP root blog.
    1471      */
    1472     function bp_get_root_domain() {
    1473         /*
    1474          * This function is used at many places and we need to review all this
    1475          * places during the 12.0 development cycle. Using BP Rewrites means we
    1476          * cannot concatenate URL chunks to build our URL anymore. We now need
    1477          * to use `bp_rewrites_get_url( $array )` and make sure to use the right
    1478          * arguments inside this `$array`.
    1479          *
    1480          * @todo Once every link reviewed, we'll be able to remove this check
    1481          *       and let PHPUnit tell us the one we forgot, eventually!
    1482          */
    1483         if ( ! buddypress()->is_phpunit_running ) {
    1484             _deprecated_function( __FUNCTION__, '12.0.0', 'bp_get_root_url()' );
    1485         }
    1486 
    1487         $domain = bp_get_root_url();
    1488 
    1489         /**
    1490          *  Filters the "root domain", the URL of the BP root blog.
    1491          *
    1492          * @since 1.2.4
    1493          * @deprecated 12.0.0 Use {@see 'bp_get_root_url'} instead.
    1494          *
    1495          * @param string $domain URL of the BP root blog.
    1496          */
    1497         return apply_filters_deprecated( 'bp_core_get_root_domain', array( $domain ), '12.0.0', 'bp_get_root_url' );
    1498     }
    14991453
    15001454/**
Note: See TracChangeset for help on using the changeset viewer.