ACF_Media::__construct
Constructor.
Method of the class: ACF_Media{}
No Hooks.
Returns
null. Nothing (null).
Usage
$ACF_Media = new ACF_Media(); $ACF_Media->__construct();
Changelog
| Since 5.0.0 | Introduced. |
ACF_Media::__construct() ACF Media:: construct code ACF 6.0.4
public function __construct() {
// Localize media strings.
add_action( 'acf/enqueue_scripts', array( $this, 'enqueue_scripts' ) );
// Save files uploaded from basic `$_FILE` field.
add_action( 'acf/save_post', array( $this, 'save_files' ), 5, 1 );
// Hook into Media Upload to run additional logic.
add_filter( 'wp_handle_upload_prefilter', array( $this, 'handle_upload_prefilter' ), 10, 1 );
// Hook into Media Modal Query to run additional logic.
add_action( 'wp_ajax_query-attachments', array( $this, 'wp_ajax_query_attachments' ), -1 );
}