PluginProbe
Polylang / 3.1
Polylang v3.1
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 | settings/table-languages.php +23 -21 2.83.1 View file →
@@ -29,13 +29,14 @@
29 29 );
30 30 }
31 31
32 32 /**
33 - * Generates content for a single row of the table
33 + * Generates content for a single row of the table.
34 34 *
35 35 * @since 1.8
36 36 *
37 - * @param object $item The current item
37 + * @param PLL_Language $item The language item.
38 + * @return void
38 39 */
39 40 public function single_row( $item ) {
40 41 /**
41 42 * Filter the list of classes assigned a row in the languages list table
@@ -41,10 +42,10 @@
41 42 * Filter the list of classes assigned a row in the languages list table
42 43 *
43 44 * @since 1.8
44 45 *
45 - * @param array $classes list of class names
46 - * @param object $item the current item
46 + * @param array $classes The list of class names.
47 + * @param PLL_Language $item The language item.
47 48 */
48 49 $classes = apply_filters( 'pll_languages_row_classes', array(), $item );
49 50 echo '<tr' . ( empty( $classes ) ? '>' : ' class="' . esc_attr( implode( ' ', $classes ) ) . '">' );
50 51 $this->single_row_columns( $item );
@@ -51,15 +52,15 @@
51 52 echo '</tr>';
52 53 }
53 54
54 55 /**
55 - * Displays the item information in a column ( default case )
56 + * Displays the item information in a column ( default case ).
56 57 *
57 58 * @since 0.1
58 59 *
59 - * @param object $item
60 - * @param string $column_name
61 - * @return string
60 + * @param PLL_Language $item The language item.
61 + * @param string $column_name The column name.
62 + * @return string|int
62 63 */
63 64 public function column_default( $item, $column_name ) {
64 65 switch ( $column_name ) {
65 66 case 'locale':
@@ -70,9 +71,9 @@
70 71 case 'count':
71 72 return (int) $item->$column_name;
72 73
73 74 default:
74 - return $item->$column_name; // flag
75 + return $item->$column_name; // Flag.
75 76 }
76 77 }
77 78
78 79 /**
@@ -80,9 +81,9 @@
80 81 * Displays the edit and delete action links
81 82 *
82 83 * @since 0.1
83 84 *
84 - * @param object $item
85 + * @param PLL_Language $item The language item.
85 86 * @return string
86 87 */
87 88 public function column_name( $item ) {
88 89 return sprintf(
@@ -98,9 +99,9 @@
98 99 * Displays the 'make default' action link
99 100 *
100 101 * @since 1.8
101 102 *
102 - * @param object $item
103 + * @param PLL_Language $item The language item.
103 104 * @return string
104 105 */
105 106 public function column_default_lang( $item ) {
106 107 $options = get_option( 'polylang' );
@@ -116,14 +117,14 @@
116 117 esc_html( sprintf( __( 'Choose %s as default language', 'polylang' ), $item->name ) )
117 118 );
118 119
119 120 /**
120 - * Filter the default language row action in the languages list table
121 + * Filters the default language row action in the languages list table.
121 122 *
122 123 * @since 1.8
123 124 *
124 - * @param string $s html markup of the action
125 - * @param object $item
125 + * @param string $s The html markup of the action.
126 + * @param PLL_Language $item The language item.
126 127 */
127 128 $s = apply_filters( 'pll_default_lang_row_action', $s, $item );
128 129 } else {
129 130 $s = sprintf(
@@ -140,9 +141,9 @@
140 141 * Gets the list of columns
141 142 *
142 143 * @since 0.1
143 144 *
144 - * @return array the list of column titles
145 + * @return string[] The list of column titles.
145 146 */
146 147 public function get_columns() {
147 148 return array(
148 149 'name' => esc_html__( 'Full name', 'polylang' ),
@@ -187,11 +188,11 @@
187 188 * Generates and display row actions links for the list table.
188 189 *
189 190 * @since 1.8
190 191 *
191 - * @param object $item The item being acted upon.
192 - * @param string $column_name Current column name.
193 - * @param string $primary Primary column name.
192 + * @param PLL_Language $item The language item being acted upon.
193 + * @param string $column_name Current column name.
194 + * @param string $primary Primary column name.
194 195 * @return string The row actions output.
195 196 */
196 197 protected function handle_row_actions( $item, $column_name, $primary ) {
197 198 if ( $primary !== $column_name ) {
@@ -214,14 +215,14 @@
214 215 ),
215 216 );
216 217
217 218 /**
218 - * Filter the list of row actions in the languages list table
219 + * Filters the list of row actions in the languages list table.
219 220 *
220 221 * @since 1.8
221 222 *
222 - * @param array $actions list of html markup actions
223 - * @param object $item
223 + * @param array $actions A list of html markup actions.
224 + * @param PLL_Language $item The language item.
224 225 */
225 226 $actions = apply_filters( 'pll_languages_row_actions', $actions, $item );
226 227
227 228 return $this->row_actions( $actions );
@@ -253,8 +254,9 @@
253 254 *
254 255 * @since 0.1
255 256 *
256 257 * @param array $data
258 + * @return void
257 259 */
258 260 public function prepare_items( $data = array() ) {
259 261 $per_page = $this->get_items_per_page( 'pll_lang_per_page' );
260 262 $this->_column_headers = array( $this->get_columns(), array(), $this->get_sortable_columns() );