bp_get_document_date()

Return the document date created.

Description

Return

(string) The document date created.

Source

File: bp-document/bp-document-template.php

2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
function bp_get_document_date() {
    global $document_template, $document_folder_template;
 
    if ( isset( $document_template ) && isset( $document_template->document ) && isset( $document_template->document->date_modified ) && (int) strtotime( $document_template->document->date_modified ) > 0 ) {
        $date = $document_template->document->date_modified;
    } elseif ( isset( $document_template ) && isset( $document_template->document ) && isset( $document_template->document->date_created ) && (int) strtotime( $document_template->document->date_created ) > 0 ) {
        $date = $document_template->document->date_created;
    } elseif ( isset( $document_folder_template ) && isset( $document_folder_template->folder ) && isset( $document_folder_template->folder->date_modified ) && (int) strtotime( $document_folder_template->folder->date_modified ) > 0 ) {
        $date = $document_folder_template->folder->date_modified;
    } elseif ( isset( $document_folder_template ) && isset( $document_folder_template->folder ) && isset( $document_folder_template->folder->date_created ) && (int) strtotime( $document_folder_template->folder->date_created ) > 0 ) {
        $date = $document_folder_template->folder->date_created;
    }
 
    $date = date_i18n( bp_get_option( 'date_format' ), strtotime( $date ) );
 
    /**
     * Filters the document date modified being displayed.
     *
     * @since BuddyBoss 1.4.0
     *
     * @param string The date modified.
     */
    return apply_filters( 'bp_get_document_date', $date );
}

Changelog

Changelog
Version Description
BuddyBoss 1.4.0 Introduced.

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.