BP_Attachment::script_data()

Build script datas for the Uploader UI.

Description

Override this method from your child class to build the script datas.

Return

(array) The javascript localization data.

Source

File: bp-core/classes/class-bp-attachment.php

	public function script_data() {
		$script_data = array(
			'action'            => $this->action,
			'file_data_name'    => $this->file_input,
			'max_file_size'     => $this->original_max_filesize,
			'feedback_messages' => array(
				1 => __( 'Sorry, uploading the file failed.', 'buddyboss' ),
				2 => __( 'File successfully uploaded.', 'buddyboss' ),
			),
		);

		return $script_data;
	}

Changelog

Changelog
Version Description
BuddyPress 2.3.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.