Skip to:
Content

BuddyPress.org

Changeset 7476


Ignore:
Timestamp:
10/24/2013 01:46:03 AM (11 years ago)
Author:
boonebgorges
Message:

Improve inline docs in bp-core-catchuri.php. See #5022

File:
1 edited

Legend:

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

    r7471 r7476  
    22
    33/**
    4  * BuddyPress URI catcher
     4 * BuddyPress URI catcher.
    55 *
    66 * Functions for parsing the URI and determining which BuddyPress template file
     
    1515
    1616/**
    17  * Analyzes the URI structure and breaks it down into parts for use in code.
    18  * BuddyPress can use complete custom friendly URI's without the user having to
    19  * add new re-write rules. Custom components are able to use their own custom
     17 * Analyze the URI and break it down into BuddyPress-usable chunks.
     18 *
     19 * BuddyPress can use complete custom friendly URIs without the user having to
     20 * add new rewrite rules. Custom components are able to use their own custom
    2021 * URI structures with very little work.
    2122 *
    22  * The URI's are broken down as follows:
     23 * The URIs are broken down as follows:
    2324 *   - http:// domain.com / members / andy / [current_component] / [current_action] / [action_variables] / [action_variables] / ...
    2425 *   - OUTSIDE ROOT: http:// domain.com / sites / buddypress / members / andy / [current_component] / [current_action] / [action_variables] / [action_variables] / ...
     
    3031 *    - $bp->action_variables: array ['group', 5]
    3132 *
    32  * @package BuddyPress Core
    33  * @since BuddyPress (1.0)
     33 * @since BuddyPress (1.0.0)
    3434 */
    3535function bp_core_set_uri_globals() {
     
    317317
    318318/**
    319  * Are root profiles enabled and allowed
    320  *
    321  * @since BuddyPress (1.6)
    322  * @return bool True if yes, false if no
     319 * Are root profiles enabled and allowed?
     320 *
     321 * @since BuddyPress (1.6.0)
     322 *
     323 * @return bool True if yes, false if no.
    323324 */
    324325function bp_core_enable_root_profiles() {
     
    340341 *   wp-content/themes/[activated_theme]/members/index.php
    341342 *
    342  * @package BuddyPress Core
    343  * @param string $username Username to check.
    344  * @return int|bool The user ID of the matched user, or false.
     343 * @param array $templates Array of templates to attempt to load.
     344 * @return bool|null Returns false on failure.
    345345 */
    346346function bp_core_load_template( $templates ) {
     
    413413
    414414/**
    415  * bp_core_catch_profile_uri()
    416  *
    417  * If the extended profiles component is not installed we still need
    418  * to catch the /profile URI's and display whatever we have installed.
    419  *
     415 * Redirect away from /profile URIs if XProfile is not enabled.
    420416 */
    421417function bp_core_catch_profile_uri() {
     
    426422
    427423/**
    428  * Catches invalid access to BuddyPress pages and redirects them accordingly.
    429  *
    430  * @package BuddyPress Core
    431  * @since BuddyPress (1.5)
     424 * Catch unauthorized access to certain BuddyPress pages and redirect accordingly.
     425 *
     426 * @since BuddyPress (1.5.0)
    432427 */
    433428function bp_core_catch_no_access() {
     
    446441
    447442/**
    448  * Redirects a user to login for BP pages that require access control and adds an error message (if
    449  * one is provided).
     443 * Redirect a user to log in for BP pages that require access control.
     444 *
     445 * Add an error message (if one is provided).
     446 *
    450447 * If authenticated, redirects user back to requested content by default.
    451448 *
    452  * @package BuddyPress Core
    453  * @since BuddyPress (1.5)
     449 * @since BuddyPress (1.5.0)
     450 *
     451 * @param array $args {
     452 *     @type int $mode Specifies the destintation of the redirect. 1 will
     453 *           direct to the root domain (home page), which assumes you have a
     454 *           log-in form there; 2 directs to wp-login.php. Default: 2.
     455 *     @type string $redirect The URL the user will be redirected to after
     456 *           successfully logging in. Default: the URL originally requested.
     457 *     @type string $root The root URL of the site, used in case of error or
     458 *           mode 1 redirects. Default: the value of {@link bp_get_root_domain()}.
     459 *     @type string $message An error message to display to the user on the
     460 *           log-in page. Default: "You must log in to access the page you
     461 *           requested."
     462 * }
    454463 */
    455464function bp_core_no_access( $args = '' ) {
     
    513522
    514523/**
    515  * Adds an error message to wp-login.php.
     524 * Add an error message to wp-login.php.
     525 *
    516526 * Hooks into the "bpnoaccess" action defined in bp_core_no_access().
    517527 *
    518  * @package BuddyPress Core
    519  * @global $error
    520  * @since BuddyPress (1.5)
     528 * @since BuddyPress (1.5.0)
     529 *
     530 * @global $error Error message to pass to wp-login.php
    521531 */
    522532function bp_core_no_access_wp_login_error() {
     
    531541
    532542/**
    533  * Canonicalizes BuddyPress URLs
    534  *
    535  * This function ensures that requests for BuddyPress content are always redirected to their
    536  * canonical versions. Canonical versions are always trailingslashed, and are typically the most
    537  * general possible versions of the URL - eg, example.com/groups/mygroup/ instead of
    538  * example.com/groups/mygroup/home/
    539  *
    540  * @since BuddyPress (1.6)
    541  * @see BP_Members_Component::setup_globals() where $bp->canonical_stack['base_url'] and
    542  *   ['component'] may be set
    543  * @see bp_core_new_nav_item() where $bp->canonical_stack['action'] may be set
     543 * Canonicalize BuddyPress URLs.
     544 *
     545 * This function ensures that requests for BuddyPress content are always
     546 * redirected to their canonical versions. Canonical versions are always
     547 * trailingslashed, and are typically the most general possible versions of the
     548 * URL - eg, example.com/groups/mygroup/ instead of
     549 * example.com/groups/mygroup/home/.
     550 *
     551 * @since BuddyPress (1.6.0)
     552 *
     553 * @see BP_Members_Component::setup_globals() where
     554 *      $bp->canonical_stack['base_url'] and ['component'] may be set.
     555 * @see bp_core_new_nav_item() where $bp->canonical_stack['action'] may be set.
    544556 * @uses bp_get_canonical_url()
    545557 * @uses bp_get_requested_url()
     
    589601
    590602/**
    591  * Output rel=canonical header tag for BuddyPress content
    592  *
    593  * @since BuddyPress (1.6)
     603 * Output rel=canonical header tag for BuddyPress content.
     604 *
     605 * @since BuddyPress (1.6.0)
    594606 */
    595607function bp_rel_canonical() {
     
    601613
    602614/**
    603  * Returns the canonical URL of the current page
    604  *
    605  * @since BuddyPress (1.6)
    606  * @uses apply_filters() Filter bp_get_canonical_url to modify return value
    607  * @param array $args
    608  * @return string
     615 * Get the canonical URL of the current page.
     616 *
     617 * @since BuddyPress (1.6.0)
     618 *
     619 * @uses apply_filters() Filter bp_get_canonical_url to modify return value.
     620 *
     621 * @param array $args {
     622 *     Optional array of arguments.
     623 *     @type bool $include_query_args Whether to include current URL arguments
     624 *           in the canonical URL returned from the function.
     625 * }
     626 * @return string Canonical URL for the current page.
    609627 */
    610628function bp_get_canonical_url( $args = array() ) {
     
    684702
    685703/**
    686  * Returns the URL as requested on the current page load by the user agent
    687  *
    688  * @since BuddyPress (1.6)
    689  * @return string
     704 * Return the URL as requested on the current page load by the user agent.
     705 *
     706 * @since BuddyPress (1.6.0)
     707 *
     708 * @return string Requested URL string.
    690709 */
    691710function bp_get_requested_url() {
     
    701720
    702721/**
    703  * Remove WordPress's really awesome canonical redirect if we are trying to load
    704  * BuddyPress specific content. Avoids issues with WordPress thinking that a
    705  * BuddyPress URL might actually be a blog post or page.
     722 * Remove WP's canonical redirect when we are trying to load BP-specific content.
     723 *
     724 * Avoids issues with WordPress thinking that a BuddyPress URL might actually
     725 * be a blog post or page.
    706726 *
    707727 * This function should be considered temporary, and may be removed without
    708728 * notice in future versions of BuddyPress.
    709729 *
    710  * @since BuddyPress (1.6)
     730 * @since BuddyPress (1.6.0)
     731 *
    711732 * @uses bp_is_blog_page()
    712733 */
     
    718739
    719740/**
    720  * Rehook maybe_redirect_404() to run later than the default
     741 * Rehook maybe_redirect_404() to run later than the default.
    721742 *
    722743 * WordPress's maybe_redirect_404() allows admins on a multisite installation
     
    753774
    754775/**
    755  * Remove WordPress's rel=canonical HTML tag if we are trying to load BuddyPress
    756  * specific content.
     776 * Remove WP's rel=canonical HTML tag if we are trying to load BP-specific content.
    757777 *
    758778 * This function should be considered temporary, and may be removed without
    759779 * notice in future versions of BuddyPress.
    760780 *
    761  * @since BuddyPress (1.6)
     781 * @since BuddyPress (1.6.0)
    762782 */
    763783function _bp_maybe_remove_rel_canonical() {
Note: See TracChangeset for help on using the changeset viewer.