| @@ -61,8 +61,16 @@ | ||
| 61 | 61 | $version = $script_asset['version']; |
| 62 | 62 | } |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | + /* | |
| 66 | + * Register the `react-jsx-runtime` polyfill, if it is not already registered. | |
| 67 | + * This is needed as a polyfill for WP < 6.6, and can be removed once WP 6.6 is the minimum requirement for TablePress. | |
| 68 | + */ | |
| 69 | + if ( ! wp_script_is( 'react-jsx-runtime', 'registered' ) ) { | |
| 70 | + wp_register_script( 'react-jsx-runtime', plugins_url( 'admin/js/react-jsx-runtime.min.js', TABLEPRESS__FILE__ ), array( 'react' ), TablePress::version, true ); | |
| 71 | + } | |
| 72 | + | |
| 65 | 73 | /** |
| 66 | 74 | * Filters the dependencies of a TablePress script file. |
| 67 | 75 | * |
| 68 | 76 | * @since 2.0.0 |
| @@ -108,9 +116,9 @@ | ||
| 108 | 116 | public function _admin_footer_text( /* string */ $content ): string { |
| 109 | 117 | // Don't use a type hint in the method declaration as many WordPress plugins use the `admin_footer_text` filter in the wrong way. |
| 110 | 118 | |
| 111 | 119 | // Protect against other plugins not returning a string in their filter callbacks. |
| 112 | - if ( ! is_string( $content ) ) { | |
| 120 | + if ( ! is_string( $content ) ) { // @phpstan-ignore function.alreadyNarrowedType (The `is_string()` check is needed as the input is coming from a filter hook.) | |
| 113 | 121 | $content = ''; |
| 114 | 122 | } |
| 115 | 123 | |
| 116 | 124 | $content .= ' • ' . sprintf( __( 'Thank you for using <a href="%s">TablePress</a>.', 'tablepress' ), 'https://tablepress.org/' ); |