← All changes
|
includes/integrations/elementor/class-convertkit-elementor.php
+4
-4
2.3.1
→
3.4.3
View file →
| @@ -39,9 +39,9 @@ | ||
| 39 | 39 | */ |
| 40 | 40 | public function enqueue_styles() { |
| 41 | 41 | |
| 42 | 42 | // Don't load stylesheets if not in editor mode. |
| 43 | - if ( empty( $_GET['action'] ) || $_GET['action'] !== 'elementor' ) { // phpcs:ignore WordPress.Security.NonceVerification | |
| 43 | + if ( ! filter_has_var( INPUT_GET, 'action' ) || filter_input( INPUT_GET, 'action', FILTER_SANITIZE_FULL_SPECIAL_CHARS ) !== 'elementor' ) { | |
| 44 | 44 | return; |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | // Enqueue styles for block icons. |
| @@ -66,9 +66,9 @@ | ||
| 66 | 66 | |
| 67 | 67 | $elements_manager->add_category( |
| 68 | 68 | 'convertkit', |
| 69 | 69 | array( |
| 70 | - 'title' => __( 'ConvertKit', 'convertkit' ), | |
| 70 | + 'title' => __( 'Kit', 'convertkit' ), | |
| 71 | 71 | 'icon' => 'fa fa-plug', |
| 72 | 72 | ) |
| 73 | 73 | ); |
| 74 | 74 | |
| @@ -86,9 +86,9 @@ | ||
| 86 | 86 | // Get blocks. |
| 87 | 87 | $blocks = convertkit_get_blocks(); |
| 88 | 88 | |
| 89 | 89 | // Bail if no blocks are available. |
| 90 | - if ( ! is_array( $blocks ) || ! count( $blocks ) ) { | |
| 90 | + if ( ! count( $blocks ) ) { | |
| 91 | 91 | return; |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | // Load widget class here, as we know that Elementor is active. |
| @@ -105,9 +105,9 @@ | ||
| 105 | 105 | require_once CONVERTKIT_PLUGIN_PATH . '/includes/integrations/elementor/class-convertkit-elementor-widget-' . $block . '.php'; |
| 106 | 106 | $class_name = 'ConvertKit_Elementor_Widget_' . str_replace( '-', '_', $block ); |
| 107 | 107 | |
| 108 | 108 | // Register Widget, using applicable function depending on the Elementor version. |
| 109 | - if ( method_exists( $widgets_manager, 'register' ) ) { | |
| 109 | + if ( method_exists( $widgets_manager, 'register' ) ) { // @phpstan-ignore-line - older versions of Elementor don't have this method. | |
| 110 | 110 | // Use register() function, available in Elementor 3.5.0. |
| 111 | 111 | // Required per https://developers.elementor.com/docs/managers/registering-widgets/. |
| 112 | 112 | $widgets_manager->register( new $class_name() ); |
| 113 | 113 | } else { |