-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathrepeater2-for-gravity-forms.php
69 lines (58 loc) · 2.42 KB
/
repeater2-for-gravity-forms.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?php
/**
* Plugin Name: Repeater2 for Gravity Forms
* Plugin URI: https://getbutterfly.com/gravity-forms-repeater-plugin/
* Description: A Gravity Forms add-on that allows specified groups of fields to be repeated by the user.
* Version: 2.1.1
* Author: Ciprian Popescu
* Author URI: http://getbutterfly.com/
* GitHub Plugin URI: wolffe/repeater2-for-gravity-forms
* GitHub Branch: master
* License: GNU General Public License v3 or later
* License URI: https://www.gnu.org/licenses/gpl-3.0.html
*/
define( 'GF_REPEATER_VERSION', '2.1.1' );
define( 'GF_REPEATER_PATH', basename( __DIR__ ) . '/' . basename( __FILE__ ) );
if ( class_exists( 'GFForms' ) ) {
GFForms::include_addon_framework();
class GFRepeater extends GFAddOn {
protected $_version = GF_REPEATER_VERSION;
protected $_min_gravityforms_version = '2.5';
protected $_slug = 'repeater2addon';
protected $_path = GF_REPEATER_PATH;
protected $_full_path = __FILE__;
protected $_title = 'Gravity Forms Repeater Add-On';
protected $_short_title = 'Repeater Add-On';
public function scripts() {
$scripts = [
[
'handle' => 'gf_repeater2_js_admin',
'src' => $this->get_base_url() . '/js/gf-repeater2-admin.js',
'version' => $this->_version,
'deps' => [ 'jquery' ],
'in_footer' => false,
'callback' => [ $this, 'localize_scripts' ],
'strings' => [ 'page' => rgget( 'page' ) ],
'enqueue' => [
[
'admin_page' => [ 'form_editor', 'entry_view', 'entry_detail' ]
],
],
],
];
return array_merge( parent::scripts(), $scripts );
}
public function init_admin() {
parent::init_admin();
GF_Field_Repeater2::init_admin();
GF_Field_Repeater2_End::init_admin();
}
public function init_frontend() {
parent::init_frontend();
GF_Field_Repeater2::init_frontend();
}
}
new GFRepeater();
require_once 'class-gf-field-repeater2.php';
require_once 'class-gf-field-repeater2-end.php';
}