forked from getdave/advanced-custom-fields-file-picker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathacf-file_picker.php
executable file
·29 lines (22 loc) · 956 Bytes
/
acf-file_picker.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
/*
Plugin Name: Advanced Custom Fields: File Picker
Plugin URI: https://github.com/getdave/advanced-custom-fields-file-picker
Description: Creates a new field type which allows you to pick files from a directory. Typically useful for picking SVG icons.
Version: 1.1.0
Author: David Smith + Arnaud Lapiere
Author URI: www.aheadcreative.co.uk
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/
// 1. set text domain
// Reference: https://codex.wordpress.org/Function_Reference/load_plugin_textdomain
load_plugin_textdomain( 'acf-file_picker', false, dirname( plugin_basename(__FILE__) ) . '/lang/' );
// 2. Include field type for ACF5
// $version = 5 and can be ignored until ACF6 exists
add_action('acf/include_field_types', function ( $version ) {
require_once('classes/acf-file_picker-v5.php');
// create field
new ACFFilePicker\Field();
});
add_action('acf/register_fields', 'register_fields_file_picker');