Skip to:
Content

BuddyPress.org

Changeset 9763


Ignore:
Timestamp:
04/17/2015 03:34:18 AM (7 years ago)
Author:
tw2113
Message:

Adds hooks documentation for buddypress-functions.php in Templates component.

See #5948.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-templates/bp-legacy/buddypress-functions.php

    r9694 r9763  
    193193        /** Override **********************************************************/
    194194
     195        /**
     196         * Fires after all of the BuddyPress theme compat actions have been added.
     197         *
     198         * @since BuddyPress (1.7.0)
     199         *
     200         * @param BP_Legacy $this Current BP_Legacy instance.
     201         */
    195202        do_action_ref_array( 'bp_theme_compat_actions', array( &$this ) );
    196203    }
     
    259266        }
    260267
    261         // Add words that we need to use in JS to the end of the page
    262         // so they can be translated and still used.
     268        /**
     269         * Filters core JavaScript strings for internationalization before AJAX usage.
     270         *
     271         * @since BuddyPress (2.0.0)
     272         *
     273         * @param array $value Array of key/value pairs for AJAX usage.
     274         */
    263275        $params = apply_filters( 'bp_core_get_js_strings', array(
    264276            'accepted'            => __( 'Accepted', 'buddypress' ),
     
    487499    public function theme_compat_page_templates( $templates = array() ) {
    488500
    489         // Bail if not looking at a directory
     501        /**
     502         * Filters whether or not we are looking at a directory to determine if to return early.
     503         *
     504         * @since BuddyPress (2.2.0)
     505         *
     506         * @param bool $value Whether or not we are viewing a directory.
     507         */
    490508        if ( true === (bool) apply_filters( 'bp_legacy_theme_compat_page_templates_directory_only', ! bp_is_directory() ) ) {
    491509            return $templates;
     
    699717        $object_extras = $_BP_COOKIE['bp-' . $object . '-extras'];
    700718
     719    /**
     720     * Filters the AJAX query string for the component loops.
     721     *
     722     * @since BuddyPress (1.7.0)
     723     *
     724     * @param string $query_string        The query string we are working with.
     725     * @param string $object              The type of page we are on.
     726     * @param string $object_filter       The current object filter.
     727     * @param string $object_scope        The current object scope.
     728     * @param string $object_page         The current object page.
     729     * @param string $object_search_terms The current object search terms.
     730     * @param string $object_extras       The current object extras.
     731     */
    701732    return apply_filters( 'bp_legacy_theme_ajax_querystring', $query_string, $object, $object_filter, $object_scope, $object_page, $object_search_terms, $object_extras );
    702733}
     
    817848    bp_get_template_part( 'activity/activity-loop' );
    818849    $result['contents'] = ob_get_contents();
     850
     851    /**
     852     * Filters the feed URL for when activity is requested via AJAX.
     853     *
     854     * @since BuddyPress (1.7.0)
     855     *
     856     * @param string $feed_url URL for the feed to be used.
     857     * @param string $scope    Scope for the activity request.
     858     */
    819859    $result['feed_url'] = apply_filters( 'bp_legacy_theme_activity_feed_url', $feed_url, $scope );
    820860    ob_end_clean();
     
    854894
    855895    } else {
     896
     897        /** This filter is documented in bp-activity/bp-activity-actions.php */
    856898        $activity_id = apply_filters( 'bp_activity_custom_update', false, $_POST['object'], $_POST['item_id'], $_POST['content'] );
    857899    }
     
    9861028        exit( '-1' );
    9871029
    988     // Call the action before the delete so plugins can still fetch information about it
     1030    /** This action is documented in bp-activity/bp-activity-actions.php */
    9891031    do_action( 'bp_activity_before_action_delete_activity', $activity->id, $activity->user_id );
    9901032
     
    9921034        exit( '-1<div id="message" class="error bp-ajax-message"><p>' . __( 'There was a problem when deleting. Please try again.', 'buddypress' ) . '</p></div>' );
    9931035
     1036    /** This action is documented in bp-activity/bp-activity-actions.php */
    9941037    do_action( 'bp_activity_action_delete_activity', $activity->id, $activity->user_id );
    9951038    exit;
     
    10221065        exit( '-1' );
    10231066
    1024     // Call the action before the delete so plugins can still fetch information about it
     1067    /** This action is documented in bp-activity/bp-activity-actions.php */
    10251068    do_action( 'bp_activity_before_action_delete_activity', $_POST['id'], $comment->user_id );
    10261069
     
    10281071        exit( '-1<div id="message" class="error bp-ajax-message"><p>' . __( 'There was a problem when deleting. Please try again.', 'buddypress' ) . '</p></div>' );
    10291072
     1073    /** This action is documented in bp-activity/bp-activity-actions.php */
    10301074    do_action( 'bp_activity_action_delete_activity', $_POST['id'], $comment->user_id );
    10311075    exit;
     
    10651109    check_admin_referer( 'bp_activity_akismet_spam_' . $activity->id );
    10661110
    1067     // Call an action before the spamming so plugins can modify things if they want to
     1111    /** This action is documented in bp-activity/bp-activity-actions.php */
    10681112    do_action( 'bp_activity_before_action_spam_activity', $activity->id, $activity );
    10691113
     
    10721116    $activity->save();
    10731117
     1118    /** This action is documented in bp-activity/bp-activity-actions.php */
    10741119    do_action( 'bp_activity_action_spam_activity', $activity->id, $activity->user_id );
    10751120    exit;
     
    11151160
    11161161/**
    1117  * Fetches full an activity's full, non-excerpted content via a POST request.
     1162 * Fetches an activity's full, non-excerpted content via a POST request.
    11181163 * Used for the 'Read More' link on long activity items.
    11191164 *
     
    11361181        exit; // @todo: error?
    11371182
     1183    /**
     1184     * Fires before the return of an activity's full, non-excerpted content via a POST request.
     1185     *
     1186     * @since BuddyPress (1.7.0)
     1187     *
     1188     * @param string $activity Activity content. Passed by reference.
     1189     */
    11381190    do_action_ref_array( 'bp_legacy_theme_get_single_activity_content', array( &$activity ) );
    11391191
    11401192    // Activity content retrieved through AJAX should run through normal filters, but not be truncated
    11411193    remove_filter( 'bp_get_activity_content_body', 'bp_activity_truncate_entry', 5 );
     1194
     1195    /** This filter is documented in bp-activity/bp-activity-template.php */
    11421196    $content = apply_filters( 'bp_get_activity_content_body', $activity->content );
    11431197
     
    14451499        <div class="message-box new-message <?php echo $class; ?>">
    14461500            <div class="message-metadata">
    1447                 <?php do_action( 'bp_before_message_meta' ); ?>
     1501                <?php
     1502
     1503                /**
     1504                 * Fires before the notifications for private messages.
     1505                 *
     1506                 * @since BuddyPress (1.1.0)
     1507                 */
     1508                do_action( 'bp_before_message_meta' ); ?>
    14481509                <?php echo bp_loggedin_user_avatar( 'type=thumb&width=30&height=30' ); ?>
    14491510
    14501511                <strong><a href="<?php echo bp_loggedin_user_domain(); ?>"><?php bp_loggedin_user_fullname(); ?></a> <span class="activity"><?php printf( __( 'Sent %s', 'buddypress' ), bp_core_time_since( bp_core_current_time() ) ); ?></span></strong>
    14511512
    1452                 <?php do_action( 'bp_after_message_meta' ); ?>
     1513                <?php
     1514
     1515                /**
     1516                 * Fires after the notifications for private messages.
     1517                 *
     1518                 * @since BuddyPress (1.1.0)
     1519                 */
     1520                do_action( 'bp_after_message_meta' ); ?>
    14531521            </div>
    14541522
    1455             <?php do_action( 'bp_before_message_content' ); ?>
     1523            <?php
     1524
     1525            /**
     1526             * Fires before the message content for a private message.
     1527             *
     1528             * @since BuddyPress (1.1.0)
     1529             */
     1530            do_action( 'bp_before_message_content' ); ?>
    14561531
    14571532            <div class="message-content">
    1458                 <?php echo stripslashes( apply_filters( 'bp_get_the_thread_message_content', $_REQUEST['content'] ) ); ?>
     1533                <?php
     1534
     1535                /** This filter is documented in bp-messages/bp-messages-template.php */
     1536                echo stripslashes( apply_filters( 'bp_get_the_thread_message_content', $_REQUEST['content'] ) ); ?>
    14591537            </div>
    14601538
    1461             <?php do_action( 'bp_after_message_content' ); ?>
     1539            <?php
     1540
     1541            /**
     1542             * Fires after the message content for a private message.
     1543             *
     1544             * @since BuddyPress (1.1.0)
     1545             */
     1546            do_action( 'bp_after_message_content' ); ?>
    14621547
    14631548            <div class="clear"></div>
     
    15551640 */
    15561641function bp_legacy_theme_ajax_messages_autocomplete_results() {
     1642
     1643    /**
     1644     * Filters the max results default value for ajax messages autocomplete results.
     1645     *
     1646     * @since BuddyPress (1.5.0)
     1647     *
     1648     * @param int $value Max results for autocomplete. Default 10.
     1649     */
    15571650    $limit = isset( $_GET['limit'] ) ? absint( $_GET['limit'] )          : (int) apply_filters( 'bp_autocomplete_max_results', 10 );
    15581651    $term  = isset( $_GET['q'] )     ? sanitize_text_field( $_GET['q'] ) : '';
Note: See TracChangeset for help on using the changeset viewer.