Skip to:
Content

bbPress.org

Ticket #2284: users-template-tags.patch

File users-template-tags.patch, 993 bytes (added by alex-ye, 8 years ago)
  • template-tags.php

    # This patch file was generated by NetBeans IDE
    # Following Index: paths are relative to: includes\users
    # It uses platform neutral UTF-8 encoding and \n newlines.
    # Above lines and this line are ignored by the patching process.
     
    7575         *
    7676         * @since bbPress (r2574)
    7777         *
    78          * @uses bbp_get_user_id() To get the current user id
     78         * @uses bbpress() To get the current user object
    7979         * @uses apply_filters() Calls 'bbp_get_current_user_id' with the id
    8080         * @return int Current user id
    8181         */
    8282        function bbp_get_current_user_id() {
    83                 return apply_filters( 'bbp_get_current_user_id', bbp_get_user_id( 0, false, true ) );
     83                $current_user = bbpress()->current_user;
     84                $current_user_id = ( !empty( $current_user->ID ) ) ? $current_user->ID : 0;
     85                return apply_filters( 'bbp_get_current_user_id', $current_user_id, $current_user );
    8486        }
    8587
    8688/**