|
15 | 15 | * @global string $hook_suffix |
16 | 16 | * |
17 | 17 | * @param string $class_name The type of the list table, which is the class name. |
18 | | - * @param array $args Optional. Arguments to pass to the class. Accepts 'screen'. |
19 | | - * @return WP_List_Table|false List table object on success, false if the class does not exist. |
| 18 | + * @param array $args { |
| 19 | + * Optional. Arguments to pass to the class. |
| 20 | + * |
| 21 | + * @type string $plural Plural value used for labels and the objects being listed. |
| 22 | + * This affects things such as CSS class-names and nonces used |
| 23 | + * in the list table, e.g. 'posts'. Default empty. |
| 24 | + * @type string $singular Singular label for an object being listed, e.g. 'post'. |
| 25 | + * Default empty. |
| 26 | + * @type bool $ajax Whether the list table supports Ajax. This includes loading |
| 27 | + * and sorting data, for example. If true, the class will call |
| 28 | + * the _js_vars() method in the footer to provide variables |
| 29 | + * to any scripts handling Ajax events. Default false. |
| 30 | + * @type string|WP_Screen|null $screen String containing the hook name used to determine the current |
| 31 | + * screen, or a `WP_Screen` instance. If left null, the current |
| 32 | + * screen will be automatically set. Default null. |
| 33 | + * } |
| 34 | + * @return WP_List_Table|false List table object of the type given in `$class_name` |
| 35 | + * on success, false if the class does not exist. |
| 36 | + * |
| 37 | + * @phpstan-template T of WP_List_Table |
| 38 | + * @phpstan-param class-string<T> $class_name |
| 39 | + * @phpstan-return T|false |
20 | 40 | */ |
21 | 41 | function _get_list_table( $class_name, $args = array() ) { |
22 | 42 | $core_classes = array( |
@@ -64,6 +84,9 @@ function _get_list_table( $class_name, $args = array() ) { |
64 | 84 | * |
65 | 85 | * @param string $class_name The list table class to use. |
66 | 86 | * @param array $args An array containing _get_list_table() arguments. |
| 87 | + * |
| 88 | + * @phpstan-template T of WP_List_Table |
| 89 | + * @phpstan-param class-string<T> $class_name |
67 | 90 | */ |
68 | 91 | $custom_class_name = apply_filters( 'wp_list_table_class_name', $class_name, $args ); |
69 | 92 |
|
|
0 commit comments