PluginProbe
TablePress – Tables in WordPress made easy / 3.0
TablePress – Tables in WordPress made easy v3.0
3.3.4 3.3.3 3.3.2 3.3.1 trunk 1.12 1.14 1.9.2 2.0.4 2.1.7 2.1.8 2.2 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.3 2.3.1 2.3.2 2.4 2.4.1 2.4.2 2.4.3 2.4.4 All 44 releases
← All changes | controllers/template-tag-functions.php +15 -24 1.143.0 View file →
@@ -1,7 +1,7 @@
1 1 <?php
2 2 /**
3 - * Frontend Template Tag functions, only available when the Frontend Controller is loaded
3 + * Frontend Template Tag functions, only available when the Frontend Controller is loaded.
4 4 *
5 5 * @package TablePress
6 6 * @subpackage Frontend Template Tag functions
7 7 * @author Tobias Bäthge
@@ -8,71 +8,62 @@
8 8 * @since 1.0.0
9 9 */
10 10
11 11 /**
12 - * Add template tag function for "table" Shortcode to be used anywhere in the template, returns the table HTML.
12 + * Provides template tag functionality for the "table" Shortcode, to be used anywhere in the template, returns the table HTML.
13 13 *
14 - * This function provides a possibility to show a table anywhere in a WordPress template,
15 - * which is needed for any region of a theme that can not use Shortcodes.
16 - *
17 14 * @since 1.0.0
18 15 *
19 - * @param string|array $table_query Query string like list or array of parameters for Shortcode "table" rendering.
16 + * @param string|array<string, mixed> $table_query Query-string-like list or array of parameters for Shortcode "table" rendering.
20 17 * @return string HTML of the rendered table.
21 18 */
22 -function tablepress_get_table( $table_query ) {
19 +function tablepress_get_table( /* string|array */ $table_query ): string {
23 20 if ( is_array( $table_query ) ) {
24 21 $atts = $table_query;
25 22 } else {
26 23 parse_str( (string) $table_query, $atts );
27 24 }
28 - return TablePress::$controller->shortcode_table( $atts );
25 + return TablePress::$controller->shortcode_table( $atts ); // @phpstan-ignore argument.type
29 26 }
30 27
31 28 /**
32 - * Add template tag function for "table" Shortcode to be used anywhere in the template, echoes the table HTML.
29 + * Provides template tag functionality for the "table" Shortcode, to be used anywhere in the template, echoes the table HTML.
33 30 *
34 - * This function provides a possibility to show a table anywhere in a WordPress template,
35 - * which is needed for any region of a theme that can not use Shortcodes.
36 - *
37 31 * @since 1.0.0
38 32 *
39 33 * @see tablepress_get_table()
40 34 *
41 - * @param string|array $table_query Query string like list or array of parameters for Shortcode "table" rendering.
35 + * @param string|array<string, mixed> $table_query Query-string-like list or array of parameters for Shortcode "table" rendering.
42 36 */
43 -function tablepress_print_table( $table_query ) {
37 +function tablepress_print_table( /* string|array */ $table_query ): void {
44 38 echo tablepress_get_table( $table_query );
45 39 }
46 40
47 41 /**
48 - * Add template tag function for "table-info" Shortcode to be used anywhere in the template, returns the info.
42 + * Provides template tag functionality for the "table-info" Shortcode, to be used anywhere in the template, returns the info.
49 43 *
50 44 * @since 1.0.0
51 45 *
52 - * @param string|array $table_query Query string like list or array of parameters for Shortcode "table-info" rendering.
46 + * @param string|array<string, mixed> $table_query Query-string-like list or array of parameters for Shortcode "table-info" rendering.
53 47 * @return string Desired table information.
54 48 */
55 -function tablepress_get_table_info( $table_query ) {
49 +function tablepress_get_table_info( /* string|array */ $table_query ): string {
56 50 if ( is_array( $table_query ) ) {
57 51 $atts = $table_query;
58 52 } else {
59 53 parse_str( (string) $table_query, $atts );
60 54 }
61 - return TablePress::$controller->shortcode_table_info( $atts );
55 + return TablePress::$controller->shortcode_table_info( $atts ); // @phpstan-ignore argument.type
62 56 }
63 57
64 58 /**
65 - * Add template tag function for "table-info" Shortcode to be used anywhere in the template, echoes the info.
59 + * Provides template tag functionality for the "table-info" Shortcode, to be used anywhere in the template, echoes the info.
66 60 *
67 - * This function provides a possibility to show table info data anywhere in a WordPress template,
68 - * which is needed for any region of a theme that can not use Shortcodes.
69 - *
70 61 * @since 1.0.0
71 62 *
72 63 * @see tablepress_get_table_info()
73 64 *
74 - * @param string|array $table_query Query string like list or array of parameters for Shortcode "table-info" rendering.
65 + * @param string|array<string, mixed> $table_query Query-string-like list or array of parameters for Shortcode "table-info" rendering.
75 66 */
76 -function tablepress_print_table_info( $table_query ) {
67 +function tablepress_print_table_info( /* string|array */ $table_query ): void {
77 68 echo tablepress_get_table_info( $table_query );
78 69 }