Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/23/2022 10:22:42 AM (2 years ago)
Author:
imath
Message:

Fix a typo error in the function name to get an attachment's mime type

Deprecate "bp_attachements_get_mime_type()" which name contains a typo error in favor of bp_attachments_get_mime_type().

Fixes #8769

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/bp-core-attachments.php

    r13315 r13371  
    16531653 * Returns a file's mime type.
    16541654 *
    1655  * @since 10.2.0
     1655 * @since 11.0.0
    16561656 *
    16571657 * @param string $file Absolute path of a file or directory.
     
    16591659 *                      The mime type of a file or 'directory' for a directory.
    16601660 */
    1661 function bp_attachements_get_mime_type( $file = '' ) {
     1661function bp_attachments_get_mime_type( $file = '' ) {
    16621662    $file_type = wp_check_filetype( $file, wp_get_mime_types() );
    16631663    $file_mime = $file_type['type'];
     
    16811681function bp_attachments_get_file_object( SplFileInfo $file ) {
    16821682    $path      = $file->getPathname();
    1683     $mime_type = bp_attachements_get_mime_type( $path );
     1683    $mime_type = bp_attachments_get_mime_type( $path );
    16841684
    16851685    // Mime type not supported by WordPress.
     
    16941694    $_file->size               = $file->getSize();
    16951695    $_file->type               = $file->getType();
    1696     $_file->mime_type          = bp_attachements_get_mime_type( $_file->path );
     1696    $_file->mime_type          = bp_attachments_get_mime_type( $_file->path );
    16971697    $_file->last_modified      = $file->getMTime();
    16981698    $_file->latest_access_date = $file->getATime();
Note: See TracChangeset for help on using the changeset viewer.