| @@ -20,9 +20,9 @@ | ||
| 20 | 20 | $polylang, |
| 21 | 21 | array( |
| 22 | 22 | 'module' => 'cpt', |
| 23 | 23 | 'title' => __( 'Custom post types and Taxonomies', 'polylang' ), |
| 24 | - 'description' => __( 'Activate languages and translations management for the custom post types and the taxonomies.', 'polylang' ), | |
| 24 | + 'description' => __( 'Activate the languages and translations management for the custom post types and taxonomies.', 'polylang' ), | |
| 25 | 25 | ) |
| 26 | 26 | ); |
| 27 | 27 | |
| 28 | 28 | $public_post_types = get_post_types( array( 'public' => true, '_builtin' => false ) ); |
| @@ -70,10 +70,10 @@ | ||
| 70 | 70 | $disabled = in_array( $post_type, $this->disabled_post_types ); |
| 71 | 71 | printf( |
| 72 | 72 | '<li><label><input name="post_types[%s]" type="checkbox" value="1" %s %s/> %s</label></li>', |
| 73 | 73 | esc_attr( $post_type ), |
| 74 | - checked( in_array( $post_type, $this->options['post_types'] ) || $disabled, true, false ), | |
| 75 | - disabled( $disabled, true, false ), | |
| 74 | + in_array( $post_type, $this->options['post_types'] ) || $disabled ? 'checked="checked"' : '', | |
| 75 | + $disabled ? 'disabled="disabled"' : '', | |
| 76 | 76 | esc_html( $pt->labels->name ) |
| 77 | 77 | ); |
| 78 | 78 | } |
| 79 | 79 | } |
| @@ -94,10 +94,10 @@ | ||
| 94 | 94 | $disabled = in_array( $taxonomy, $this->disabled_taxonomies ); |
| 95 | 95 | printf( |
| 96 | 96 | '<li><label><input name="taxonomies[%s]" type="checkbox" value="1" %s %s/> %s</label></li>', |
| 97 | 97 | esc_attr( $taxonomy ), |
| 98 | - checked( in_array( $taxonomy, $this->options['taxonomies'] ) || $disabled, true, false ), | |
| 99 | - disabled( $disabled, true, false ), | |
| 98 | + in_array( $taxonomy, $this->options['taxonomies'] ) || $disabled ? 'checked="checked"' : '', | |
| 99 | + $disabled ? 'disabled="disabled"' : '', | |
| 100 | 100 | esc_html( $tax->labels->name ) |
| 101 | 101 | ); |
| 102 | 102 | } |
| 103 | 103 | } |
| @@ -115,10 +115,8 @@ | ||
| 115 | 115 | * |
| 116 | 116 | * @param array $options |
| 117 | 117 | */ |
| 118 | 118 | protected function update( $options ) { |
| 119 | - $newoptions = array(); | |
| 120 | - | |
| 121 | 119 | foreach ( array( 'post_types', 'taxonomies' ) as $key ) { |
| 122 | 120 | $newoptions[ $key ] = empty( $options[ $key ] ) ? array() : array_keys( $options[ $key ], 1 ); |
| 123 | 121 | } |
| 124 | 122 | return $newoptions; // Take care to return only validated options |