Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/07/2021 05:22:42 PM (4 years ago)
Author:
imath
Message:

Raise WordPress required version to 5.4

BuddyPress 10.0.0 will require at least WordPress 5.4. The BP Development team took this decision on October 6 (2021) according to our guideline about WordPress version compatibility.

  • Add WordPress 5.4 to the WordPress versions tested into our PHPUnit GitHub action.
  • Deprecate the bp.apiRequest script which was introduced to polyfill the wp.apiRequest one. Plugin developers are encouraged to directly use the wp.apiRequest script. Please note the bp.apiRequest script will be completely removed in a next major BuddyPress version.
  • Deprecate the bp_insert_site_hook() and bp_delete_site_hook() function which were introduced to make sure to use the best hook according to the installed WordPress version when creating a new site or deleting an existing one.

At least one more commit is required to finish this "raising" process, as BP Blocks do not need anymore the CompatibiltyServerSideRender component we introduced to preserve back compatibility with WordPress version older than 5.3.

Props oztaser

See #8571

File:
1 edited

Legend:

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

    r12985 r13140  
    5151     * Filter here to disable the BP REST API.
    5252     *
    53      * The BP REST API requires at least WordPress 4.7.0
     53     * The BP REST API requires at least WordPress 4.7.0.
    5454     *
    5555     * @since 5.0.0
     
    5757     * @param boolean $value True if the BP REST API is available. False otherwise.
    5858     */
    59     return apply_filters( 'bp_rest_api_is_available', bp_is_running_wp( '4.7.0' ) && bp_rest_in_buddypress() ) || bp_rest_is_plugin_active();
     59    return apply_filters( 'bp_rest_api_is_available', bp_rest_in_buddypress() ) || bp_rest_is_plugin_active();
    6060}
    6161
     
    6464 *
    6565 * @since 5.0.0
     66 * @deprecated 10.0.0
    6667 */
    6768function bp_rest_api_register_request_script() {
     
    7071    }
    7172
    72     $dependencies = array( 'jquery' );
    73 
    74     // The wrapper for WP REST API requests was introduced in WordPress 4.9.0.
    75     if ( wp_script_is( 'wp-api-request', 'registered' ) ) {
    76         $dependencies = array( 'wp-api-request' );
    77     }
    78 
    7973    wp_register_script(
    8074        'bp-api-request',
    8175        sprintf( '%1$sbp-core/js/bp-api-request%2$s.js', buddypress()->plugin_url, bp_core_get_minified_asset_suffix() ),
    82         $dependencies,
     76        array( 'jquery', 'wp-api-request' ),
    8377        bp_get_version(),
    8478        true
     
    8983        'bpApiSettings',
    9084        array(
    91             'root'            => esc_url_raw( get_rest_url() ),
    92             'nonce'           => wp_create_nonce( 'wp_rest' ),
    93             'unexpectedError' => __( 'An unexpected error occured. Please try again.', 'buddypress' ),
     85            'unexpectedError'   => __( 'An unexpected error occured. Please try again.', 'buddypress' ),
     86            'deprecatedWarning' => __( 'The bp.apiRequest function is deprecated since BuddyPress 10.0.0, please use wp.apiRequest instead.', 'buddypress' ),
    9487        )
    9588    );
Note: See TracChangeset for help on using the changeset viewer.