BP_REST_Members_Details_Endpoint::bp_rest_nav_has_count( array $nav )

Checks if the nav item has a count attribute.

Description

Parameters

$nav

(Required) Navigation array.

Return

(bool)

Source

File: bp-members/classes/class-bp-rest-members-details-endpoint.php

677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
public function bp_rest_nav_has_count( $nav ) {
    $count = false;
 
    if ( ! empty( $nav['primary'] ) ) {
        $count = (bool) strpos( $nav['name'], '="count"' );
    }
 
    /**
     * Filter to edit whether the nav has a count attribute.
     *
     * @param bool  $value    True if the nav has a count attribute. False otherwise
     * @param array $nav_item The current nav item array.
     */
    return (bool) apply_filters( 'bp_rest_nouveau_nav_has_count', false !== $count, $nav );
}

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.