Changeset 11763 for trunk/src/bp-core/bp-core-template.php
- Timestamp:
- 12/08/2017 12:22:09 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-template.php
r11605 r11763 549 549 if ( bp_is_active( 'blogs' ) && is_multisite() ) { 550 550 $options['blogs'] = _x( 'Blogs', 'search form', 'buddypress' ); 551 }552 553 if ( bp_is_active( 'forums' ) && bp_forums_is_installed_correctly() && bp_forums_has_directory() ) {554 $options['forums'] = _x( 'Forums', 'search form', 'buddypress' );555 551 } 556 552 … … 2200 2196 * 2201 2197 * @since 1.5.0 2198 * @since 3.0.0 Required for bbPress 2 integration. 2202 2199 * 2203 2200 * @return bool True if the current page is part of the Forums component. … … 2474 2471 2475 2472 /** 2476 * Is this a user's forums page?2477 *2478 * Eg http://example.com/members/joe/forums/ (or a subpage thereof).2479 *2480 * @since 1.5.02481 *2482 * @return bool True if the current page is a user's forums page.2483 */2484 function bp_is_user_forums() {2485 2486 if ( ! bp_is_active( 'forums' ) ) {2487 return false;2488 }2489 2490 if ( bp_is_user() && bp_is_forums_component() ) {2491 return true;2492 }2493 2494 return false;2495 }2496 2497 /**2498 * Is this a user's "Topics Started" page?2499 *2500 * Eg http://example.com/members/joe/forums/topics/.2501 *2502 * @since 1.5.02503 *2504 * @return bool True if the current page is a user's Topics Started page.2505 */2506 function bp_is_user_forums_started() {2507 return (bool) ( bp_is_user_forums() && bp_is_current_action( 'topics' ) );2508 }2509 2510 /**2511 * Is this a user's "Replied To" page?2512 *2513 * Eg http://example.com/members/joe/forums/replies/.2514 *2515 * @since 1.5.02516 *2517 * @return bool True if the current page is a user's Replied To forums page.2518 */2519 function bp_is_user_forums_replied_to() {2520 return (bool) ( bp_is_user_forums() && bp_is_current_action( 'replies' ) );2521 }2522 2523 /**2524 2473 * Is the current page part of a user's Groups page? 2525 2474 * … … 2756 2705 2757 2706 /** 2758 * Is the current page a group's forum page?2759 *2760 * Only applies to legacy bbPress forums.2761 *2762 * @since 1.1.02763 *2764 * @return bool True if the current page is a group forum page.2765 */2766 function bp_is_group_forum() {2767 $retval = false;2768 2769 // At a forum URL.2770 if ( bp_is_single_item() && bp_is_groups_component() && bp_is_current_action( 'forum' ) ) {2771 $retval = true;2772 2773 // If at a forum URL, set back to false if forums are inactive, or not2774 // installed correctly.2775 if ( ! bp_is_active( 'forums' ) || ! bp_forums_is_installed_correctly() ) {2776 $retval = false;2777 }2778 }2779 2780 return $retval;2781 }2782 2783 /**2784 2707 * Is the current page a group's activity page? 2785 2708 * … … 2805 2728 * Is the current page a group forum topic? 2806 2729 * 2807 * Only applies to legacy bbPress (1.x) forums.2808 *2809 2730 * @since 1.1.0 2731 * @since 3.0.0 Required for bbPress 2 integration. 2810 2732 * 2811 2733 * @return bool True if the current page is part of a group forum topic. … … 2818 2740 * Is the current page a group forum topic edit page? 2819 2741 * 2820 * Only applies to legacy bbPress (1.x) forums.2821 *2822 2742 * @since 1.2.0 2743 * @since 3.0.0 Required for bbPress 2 integration. 2823 2744 * 2824 2745 * @return bool True if the current page is part of a group forum topic edit page. … … 3415 3336 if ( bp_is_group_members() ) { 3416 3337 $bp_classes[] = 'group-members'; 3417 }3418 3419 if ( bp_is_group_forum_topic() ) {3420 $bp_classes[] = 'group-forum-topic';3421 }3422 3423 if ( bp_is_group_forum_topic_edit() ) {3424 $bp_classes[] = 'group-forum-topic-edit';3425 }3426 3427 if ( bp_is_group_forum() ) {3428 $bp_classes[] = 'group-forum';3429 3338 } 3430 3339 … … 3526 3435 } elseif ( bp_is_activation_page() ) { 3527 3436 $bp_classes[] = 'bp_activate'; 3528 3529 } elseif ( bp_is_forums_component() && bp_is_directory() ) {3530 $bp_classes[] = 'bp_forum';3531 3437 } 3532 3438
Note: See TracChangeset
for help on using the changeset viewer.