Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
04/09/2015 08:47:56 PM (10 years ago)
Author:
johnjamesjacoby
Message:

Activity: Improvements to "Load More" link functions:

  • Escape output of bp_activity_load_more_link() preventing pass-though issues with bp_get_requested_url()
  • Pass $url and $activities_template global through bp_get_activity_load_more_link filter

For (2.3) trunk.

File:
1 edited

Legend:

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

    r9721 r9728  
    793793 */
    794794function bp_activity_load_more_link() {
    795     echo bp_get_activity_load_more_link();
    796 }
     795    echo esc_url( bp_get_activity_load_more_link() );
     796}
     797    /**
     798     * Get the URL for the Load More link
     799     *
     800     * @since BuddyPress (2.1.0)
     801     */
    797802    function bp_get_activity_load_more_link() {
    798803        global $activities_template;
    799804
    800         $link = bp_get_requested_url();
    801         $link = add_query_arg( $activities_template->pag_arg, $activities_template->pag_page + 1, $link );
     805        $url = bp_get_requested_url();
     806        $link = add_query_arg( $activities_template->pag_arg, $activities_template->pag_page + 1, $url );
    802807
    803808        /**
     
    806811         * @since BuddyPress (2.1.0)
    807812         *
    808          * @param string $link The Load More link URL.
    809          */
    810         return apply_filters( 'bp_get_activity_load_more_link', $link );
     813         * @param string $link                The "Load More" link URL with appropriate query args
     814         * @param string $url                 The original URL
     815         * @param object $activities_template The activity template loop global
     816         */
     817        return apply_filters( 'bp_get_activity_load_more_link', $link, $url, $activities_template );
    811818    }
    812819
Note: See TracChangeset for help on using the changeset viewer.