-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathgf_pll.php
More file actions
37 lines (29 loc) · 996 Bytes
/
gf_pll.php
File metadata and controls
37 lines (29 loc) · 996 Bytes
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
<?php
/*
Plugin Name: Integrate Gravity Forms + Polylang
Plugin URI: https://github.com/pdme/gravity-forms-polylang
Description: Add form titles, descriptions, field labels, etc, to Polylang string translations
Version: 0.2
Author: Philip Ebels
Author URI: https://github.com/pdme
License: GPL2
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/
if(!defined('ABSPATH')) exit;
if(!class_exists('GF_PLL_Initialize')) :
include 'class_GF_PLL.php';
class GF_PLL_Initialize {
public static function register_strings() {
$gf_pll = new GF_PLL();
$gf_pll->register_strings();
}
public static function translate_strings($form) {
$gf_pll = new GF_PLL();
return $gf_pll->translate_strings($form);
}
}
add_action('gform_loaded', array('GF_PLL_Initialize', 'register_strings'));
add_filter('gform_pre_render', array('GF_PLL_Initialize', 'translate_strings'));
add_filter('gform_pre_process', array('GF_PLL_Initialize', 'translate_strings'));
endif;
?>