PluginProbe
Polylang / 2.3.6
Polylang v2.3.6
3.8.9 3.8.8 3.8.7 3.8.6 3.8.5 3.8.4 3.8.3 2.7 2.7.0.1 2.7.1 2.7.2 2.7.3 2.7.4 2.8 2.8.1 2.8.2 2.8.3 2.8.4 2.9 2.9.1 2.9.2 3.0 3.0.1 3.0.2 3.0.3 All 233 releases
← All changes | modules/sync/settings-sync.php +14 -17 2.7.12.3.6 View file →
@@ -7,9 +7,9 @@
7 7 */
8 8 class PLL_Settings_Sync extends PLL_Settings_Module {
9 9
10 10 /**
11 - * Constructor
11 + * constructor
12 12 *
13 13 * @since 1.8
14 14 *
15 15 * @param object $polylang polylang object
@@ -14,20 +14,17 @@
14 14 *
15 15 * @param object $polylang polylang object
16 16 */
17 17 public function __construct( &$polylang ) {
18 - parent::__construct(
19 - $polylang,
20 - array(
21 - 'module' => 'sync',
22 - 'title' => __( 'Synchronization', 'polylang' ),
23 - 'description' => __( 'The synchronization options allow to maintain exact same values (or translations in the case of taxonomies and page parent) of meta content between the translations of a post or page.', 'polylang' ),
24 - )
25 - );
18 + parent::__construct( $polylang, array(
19 + 'module' => 'sync',
20 + 'title' => __( 'Synchronization', 'polylang' ),
21 + 'description' => __( 'The synchronization options allow to maintain exact same values (or translations in the case of taxonomies and page parent) of meta content between the translations of a post or page.', 'polylang' ),
22 + ) );
26 23 }
27 24
28 25 /**
29 - * Deactivates the module
26 + * deactivates the module
30 27 *
31 28 * @since 1.8
32 29 */
33 30 public function deactivate() {
@@ -35,9 +32,9 @@
35 32 update_option( 'polylang', $this->options );
36 33 }
37 34
38 35 /**
39 - * Displays the settings form
36 + * displays the settings form
40 37 *
41 38 * @since 1.8
42 39 */
43 40 protected function form() {
@@ -47,9 +44,9 @@
47 44 foreach ( self::list_metas_to_sync() as $key => $str ) {
48 45 printf(
49 46 '<li><label><input name="sync[%s]" type="checkbox" value="1" %s /> %s</label></li>',
50 47 esc_attr( $key ),
51 - checked( in_array( $key, $this->options['sync'] ), true, false ),
48 + in_array( $key, $this->options['sync'] ) ? 'checked="checked"' : '',
52 49 esc_html( $str )
53 50 );
54 51 }
55 52 ?>
@@ -57,9 +54,9 @@
57 54 <?php
58 55 }
59 56
60 57 /**
61 - * Sanitizes the settings before saving
58 + * sanitizes the settings before saving
62 59 *
63 60 * @since 1.8
64 61 *
65 62 * @param array $options
@@ -64,14 +61,14 @@
64 61 *
65 62 * @param array $options
66 63 */
67 64 protected function update( $options ) {
68 - $newoptions = array( 'sync' => empty( $options['sync'] ) ? array() : array_keys( $options['sync'], 1 ) );
65 + $newoptions['sync'] = empty( $options['sync'] ) ? array() : array_keys( $options['sync'], 1 );
69 66 return $newoptions; // take care to return only validated options
70 67 }
71 68
72 69 /**
73 - * Get the row actions
70 + * get the row actions
74 71 *
75 72 * @since 1.8
76 73 *
77 74 * @return array
@@ -80,15 +77,15 @@
80 77 return empty( $this->options['sync'] ) ? array( 'configure' ) : array( 'configure', 'deactivate' );
81 78 }
82 79
83 80 /**
84 - * List the post metas to synchronize
81 + * list the post metas to synchronize
85 82 *
86 83 * @since 1.0
87 84 *
88 85 * @return array
89 86 */
90 - public static function list_metas_to_sync() {
87 + static public function list_metas_to_sync() {
91 88 return array(
92 89 'taxonomies' => __( 'Taxonomies', 'polylang' ),
93 90 'post_meta' => __( 'Custom fields', 'polylang' ),
94 91 'comment_status' => __( 'Comment status', 'polylang' ),