Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/31/2015 04:19:19 AM (12 years ago)
Author:
tw2113
Message:

Adds hooks documentation for bp-core-filters.php and bp-core-catchuri.php, fixes version number.

See #5940.

File:
1 edited

Legend:

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

    r9559 r9664  
    5656                $path = esc_url( $_SERVER['REQUEST_URI'] );
    5757
    58         // Filter the path
     58        /**
     59         * Filters the BuddyPress global URI path.
     60         *
     61         * @since BuddyPress (1.0.0)
     62         *
     63         * @param string $path Path to set.
     64         */
    5965        $path = apply_filters( 'bp_uri', $path );
    6066
    … …  
    328334                $retval = true;
    329335
     336        /**
     337         * Filters whether or not root profiles are enabled and allowed.
     338         *
     339         * @since BuddyPress (1.6.0)
     340         *
     341         * @param bool $retval Whether or not root profiles are available.
     342         */
    330343        return apply_filters( 'bp_core_enable_root_profiles', $retval );
    331344}
    … …  
    371384        }
    372385
    373         // Filter the template locations so that plugins can alter where they are located
     386        /**
     387         * Filters the template locations.
     388         *
     389         * Allows plugins to alter where the template files are located.
     390         *
     391         * @since BuddyPress (1.1.0)
     392         *
     393         * @param string $template           Located template path.
     394         * @param array  $filtered_templates Array of templates to attempt to load.
     395         */
    374396        $located_template = apply_filters( 'bp_located_template', $template, $filtered_templates );
    375397        if ( !empty( $located_template ) ) {
    … …  
    380402                $wp_query->is_404      = false;
    381403
     404                /**
     405                 * Fires before the loading of a located template file.
     406                 *
     407                 * @since BuddyPress (1.6.0)
     408                 *
     409                 * @param string $located_template Template found to be loaded.
     410                 */
    382411                do_action( 'bp_core_pre_load_template', $located_template );
    383412
     413                /**
     414                 * Filters the selected template right before loading.
     415                 *
     416                 * @since BuddyPress (1.1.0)
     417                 *
     418                 * @param string $located_template Template found to be loaded.
     419                 */
    384420                load_template( apply_filters( 'bp_load_template', $located_template ) );
    385421
     422                /**
     423                 * Fires after the loading of a located template file.
     424                 *
     425                 * @since BuddyPress (1.6.0)
     426                 *
     427                 * @param string $located_template Template found that was loaded.
     428                 */
    386429                do_action( 'bp_core_post_load_template', $located_template );
    387430
    … …  
    402445                }
    403446
     447                /**
     448                 * Fires if there are no found templates to load and theme compat is needed.
     449                 *
     450                 * @since BuddyPress (1.7.0)
     451                 */
    404452                do_action( 'bp_setup_theme_compat' );
    405453        }
    … …  
    411459function bp_core_catch_profile_uri() {
    412460        if ( !bp_is_active( 'xprofile' ) ) {
     461
     462                /**
     463                 * Filters the path to redirect users to if XProfile is not enabled.
     464                 *
     465                 * @since BuddyPress (1.0.0)
     466                 *
     467                 * @param string $value Path to redirect users to.
     468                 */
    413469                bp_core_load_template( apply_filters( 'bp_core_template_display_profile', 'members/single/home' ) );
    414470        }
    … …  
    473529
    474530        $r = wp_parse_args( $args, $defaults );
     531
     532        /**
     533         * Filters the arguments used for user redirecting when visiting access controlled areas.
     534         *
     535         * @since BuddyPress (1.6.0)
     536         *
     537         * @param array $r Array of parsed arguments for redirect determination.
     538         */
    475539        $r = apply_filters( 'bp_core_no_access', $r );
    476540        extract( $r, EXTR_SKIP );
    … …  
    529593        global $error;
    530594
     595        /**
     596         * Filters the error message for wp-login.php when needing to log in before accessing.
     597         *
     598         * @since BuddyPress (1.5.0)
     599         *
     600         * @param string $value Error message to display.
     601         * @param string $value URL to redirect user to after successful login.
     602         */
    531603        $error = apply_filters( 'bp_wp_login_error', __( 'You must log in to access the page you requested.', 'buddypress' ), $_REQUEST['redirect_to'] );
    532604
    … …  
    555627function bp_redirect_canonical() {
    556628
     629        /**
     630         * Filters whether or not to do canonical redirects on BuddyPress URLs.
     631         *
     632         * @since BuddyPress (1.6.0)
     633         *
     634         * @param bool $value Whether or not to do canonical redirects. Default true.
     635         */
    557636        if ( !bp_is_blog_page() && apply_filters( 'bp_do_redirect_canonical', true ) ) {
    558637                // If this is a POST request, don't do a canonical redirect.
    … …  
    655734                // the members directory to avoid redirect loops
    656735                } elseif ( bp_is_register_page() && 'register' == $front_page_component && is_user_logged_in() ) {
     736
     737                        /**
     738                         * Filters the logged in register page redirect URL.
     739                         *
     740                         * @since BuddyPress (1.5.1)
     741                         *
     742                         * @param string $value URL to redirect logged in members to.
     743                         */
    657744                        $bp->canonical_stack['canonical_url'] = apply_filters( 'bp_loggedin_register_page_redirect_to', bp_get_members_directory_permalink() );
    658745                }
    … …  
    696783        }
    697784
     785        /**
     786         * Filters the canonical url of the current page.
     787         *
     788         * @since BuddyPress (1.6.0)
     789         *
     790         * @param string $canonical_url Canonical URL of the current page.
     791         * @param array  $args          Array of arguments to help determine canonical URL.
     792         */
    698793        return apply_filters( 'bp_get_canonical_url', $canonical_url, $args );
    699794}
    … …  
    714809        }
    715810
     811        /**
     812         * Filters the URL as requested on the current page load by the user agent.
     813         *
     814         * @since BuddyPress (1.7.0)
     815         *
     816         * @param string $value Requested URL string.
     817         */
    716818        return apply_filters( 'bp_get_requested_url', $bp->canonical_stack['requested_url'] );
    717819}
Note: See TracChangeset for help on using the changeset viewer.