| @@ -18,9 +18,9 @@ | ||
| 18 | 18 | |
| 19 | 19 | /** |
| 20 | 20 | * The list of post types to show in the form. |
| 21 | 21 | * |
| 22 | - * @var array | |
| 22 | + * @var string[] | |
| 23 | 23 | */ |
| 24 | 24 | private $post_types; |
| 25 | 25 | |
| 26 | 26 | /** |
| @@ -25,9 +25,9 @@ | ||
| 25 | 25 | |
| 26 | 26 | /** |
| 27 | 27 | * The list of post types to disable in the form. |
| 28 | 28 | * |
| 29 | - * @var array | |
| 29 | + * @var string[] | |
| 30 | 30 | */ |
| 31 | 31 | private $disabled_post_types; |
| 32 | 32 | |
| 33 | 33 | /** |
| @@ -32,9 +32,9 @@ | ||
| 32 | 32 | |
| 33 | 33 | /** |
| 34 | 34 | * The list of taxonomies to show in the form. |
| 35 | 35 | * |
| 36 | - * @var array | |
| 36 | + * @var string[] | |
| 37 | 37 | */ |
| 38 | 38 | private $taxonomies; |
| 39 | 39 | |
| 40 | 40 | /** |
| @@ -39,9 +39,9 @@ | ||
| 39 | 39 | |
| 40 | 40 | /** |
| 41 | 41 | * The list of taxonomies to disable in the form. |
| 42 | 42 | * |
| 43 | - * @var array | |
| 43 | + * @var string[] | |
| 44 | 44 | */ |
| 45 | 45 | private $disabled_taxonomies; |
| 46 | 46 | |
| 47 | 47 | /** |
| @@ -106,11 +106,18 @@ | ||
| 106 | 106 | $disabled = in_array( $post_type, $this->disabled_post_types ); |
| 107 | 107 | printf( |
| 108 | 108 | '<li><label><input name="post_types[%s]" type="checkbox" value="1" %s %s/> %s</label></li>', |
| 109 | 109 | esc_attr( $post_type ), |
| 110 | - checked( in_array( $post_type, $this->options['post_types'] ) || $disabled, true, false ), | |
| 110 | + checked( $disabled || in_array( $post_type, $this->options['post_types'], true ), true, false ), | |
| 111 | 111 | disabled( $disabled, true, false ), |
| 112 | - esc_html( $pt->labels->name ) | |
| 112 | + esc_html( | |
| 113 | + sprintf( | |
| 114 | + /* translators: 1 is a post type or taxonomy label, 2 is a post type or taxonomy key. */ | |
| 115 | + _x( '%1$s (%2$s)', 'content type setting choice', 'polylang' ), | |
| 116 | + $pt->labels->name, | |
| 117 | + $pt->name | |
| 118 | + ) | |
| 119 | + ) | |
| 113 | 120 | ); |
| 114 | 121 | } |
| 115 | 122 | } |
| 116 | 123 | ?> |
| @@ -130,11 +137,18 @@ | ||
| 130 | 137 | $disabled = in_array( $taxonomy, $this->disabled_taxonomies ); |
| 131 | 138 | printf( |
| 132 | 139 | '<li><label><input name="taxonomies[%s]" type="checkbox" value="1" %s %s/> %s</label></li>', |
| 133 | 140 | esc_attr( $taxonomy ), |
| 134 | - checked( in_array( $taxonomy, $this->options['taxonomies'] ) || $disabled, true, false ), | |
| 141 | + checked( $disabled || in_array( $taxonomy, $this->options['taxonomies'], true ), true, false ), | |
| 135 | 142 | disabled( $disabled, true, false ), |
| 136 | - esc_html( $tax->labels->name ) | |
| 143 | + esc_html( | |
| 144 | + sprintf( | |
| 145 | + /* translators: 1 is a post type or taxonomy label, 2 is a post type or taxonomy key. */ | |
| 146 | + _x( '%1$s (%2$s)', 'content type setting choice', 'polylang' ), | |
| 147 | + $tax->labels->name, | |
| 148 | + $tax->name | |
| 149 | + ) | |
| 150 | + ) | |
| 137 | 151 | ); |
| 138 | 152 | } |
| 139 | 153 | } |
| 140 | 154 | ?> |