bp_document_get_file_parts( [type] $post_id )

Handles the actual rename process

Description

Parameters

$post_id

([type]) (Required)

Return

(void)

Source

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

function bp_document_get_file_parts( $post_id ) {
	preg_match( '~([^/]+)\.([^\.]+)$~', get_attached_file( $post_id ), $file_parts ); // extract current filename and extension
	return array(
		'filename'  => $file_parts[1],
		'extension' => $file_parts[2],
	);
}

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.