_x('Select', 'verb', 'acf'), 'edit' => _x('Edit', 'verb', 'acf'), 'update' => _x('Update', 'verb', 'acf'), 'uploadedTo' => __("Uploaded to this post",'acf'), 'default_icon' => wp_mime_type_icon() ); // return return $l10n; } /* * handle_upload_prefilter * * description * * @type function * @date 16/02/2015 * @since 5.1.5 * * @param $post_id (int) * @return $post_id (int) */ function handle_upload_prefilter( $file ) { // bail early if no acf field if( empty($_POST['_acfuploader']) ) { return $file; } // load field $field = acf_get_field( $_POST['_acfuploader'] ); if( !$field ) { return $file; } // get errors $errors = acf_validate_attachment( $file, $field, 'upload' ); // filter for 3rd party customization $errors = apply_filters("acf/upload_prefilter", $errors, $file, $field); $errors = apply_filters("acf/upload_prefilter/type={$field['type']}", $errors, $file, $field ); $errors = apply_filters("acf/upload_prefilter/name={$field['name']}", $errors, $file, $field ); $errors = apply_filters("acf/upload_prefilter/key={$field['key']}", $errors, $file, $field ); // append error if( !empty($errors) ) { $file['error'] = implode("\n", $errors); } // return return $file; } /* * save_files * * This function will save the $_FILES data * * @type function * @date 24/10/2014 * @since 5.0.9 * * @param $post_id (int) * @return $post_id (int) */ function save_files( $post_id = 0 ) { // bail early if no $_FILES data if( empty($_FILES['acf']['name']) ) { return; } // upload files acf_upload_files(); } /* * admin_footer * * description * * @type function * @date 19/02/2015 * @since 5.1.5 * * @param $post_id (int) * @return $post_id (int) */ function admin_footer() { ?> ', $errors); } // return return $response; } } // initialize new acf_media(); ?>