forked from michaeldozark/acf-gravity-forms
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathacf-gravity-forms.php
More file actions
49 lines (40 loc) · 1.19 KB
/
acf-gravity-forms.php
File metadata and controls
49 lines (40 loc) · 1.19 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
/**
* Plugin Name: Advanced Custom Fields: Gravity Forms
* Plugin URI: PLUGIN_URL
* Description: Adds Gravity Forms Field Type to Advanced Custom Fields
* Version: 0.1.0
* Author: Michael Dozark
* Author URI: http://www.michaeldozark.com/
* License: GPL2
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/
if ( ! defined( 'ABSPATH' ) ) exit; // exit if accessed directly
/**
* set text domain
*
* @see https://developer.wordpress.org/reference/functions/load_plugin_textdomain/
*/
load_plugin_textdomain( 'acf-gravity-forms', false, dirname( plugin_basename(__FILE__) ) . '/lang/' );
add_action( 'plugins_loaded', 'acf_gravity_forms' );
/**
* Initialize the plugin
*
* @since 0.1.0
*/
function acf_gravity_forms() {
/**
* Only load plugin if Gravity Forms is also loaded
*/
if ( class_exists( 'GFAPI' ) ) {
add_action( 'acf/include_field_types', 'include_field_types_gravity_forms' );
} // if ( class_exists( 'GFAPI' ) )
}
/**
* Include field type for ACF5
*
* @param int $version Current ACF version number. $version = 5 and can be ignored until ACF6 exists
*/
function include_field_types_gravity_forms( $version ) {
include_once('acf-gravity-forms-v5.php');
}