PluginProbe
Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages / 3.4.4
Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages v3.4.4
3.4.4 3.4.3 3.4.2 3.4.1 3.4.0 3.3.9 3.3.8 3.3.7 3.3.6 3.3.5 3.3.4 3.3.3 3.3.2 3.3.1 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.2.7 2.2.8 2.2.9 2.3.0 All 197 releases
← All changes | includes/integrations/woocommerce/class-convertkit-woocommerce-product-form.php +5 -26 2.2.2 → 3.4.4 View file →
@@ -6,9 +6,9 @@
6 6 * @author ConvertKit
7 7 */
8 8
9 9 /**
10 - * Registers ConvertKit Forms on WooCommerce Products
10 + * Outputs ConvertKit Forms on WooCommerce Products.
11 11 *
12 12 * @package ConvertKit
13 13 * @author ConvertKit
14 14 */
@@ -20,39 +20,18 @@
20 20 * @since 1.9.6
21 21 */
22 22 public function __construct() {
23 23
24 - add_filter( 'convertkit_get_supported_post_types', array( $this, 'register_post_type_support' ) );
25 24 add_action( 'convertkit_output_output_form', array( $this, 'output_form' ) );
26 25
27 26 }
28 27
29 28 /**
30 - * Register ConvertKit Form support for WooCommerce Products.
29 + * Output the ConvertKit Form after the Product's Summary, as `the_content` isn't a reliable
30 + * hook to use for output when viewing a WooCommerce Product.
31 31 *
32 32 * @since 1.9.6
33 - *
34 - * @param array $post_types Supported Post Types.
35 - * @return array $post_types Supported Post Types
36 33 */
37 - public function register_post_type_support( $post_types ) {
38 -
39 - // Bail if WooCommerce isn't active.
40 - if ( ! $this->is_active() ) {
41 - return $post_types;
42 - }
43 -
44 - // Register WooCommerce Product support.
45 - $post_types[] = 'product';
46 - return $post_types;
47 -
48 - }
49 -
50 - /**
51 - * Output the ConvertKit Form after the Product's Summary.
52 - *
53 - * @since 1.9.6
54 - */
55 34 public function output_form() {
56 35
57 36 // Bail if WooCommerce isn't active.
58 37 if ( ! $this->is_active() ) {
@@ -79,9 +58,9 @@
79 58 */
80 59 public function append_form_to_product_summary() {
81 60
82 61 // Output is already escaped in append_form_to_content().
83 - echo WP_ConvertKit()->get_class( 'output' )->append_form_to_content( '' ); // phpcs:ignore WordPress.Security.EscapeOutput
62 + echo WP_ConvertKit()->get_class( 'output' )->append_form_to_content( '' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
84 63
85 64 }
86 65
87 66 /**
@@ -101,9 +80,9 @@
101 80
102 81 // Bootstrap.
103 82 add_action(
104 83 'convertkit_initialize_global',
105 - function() {
84 + function () {
106 85
107 86 new ConvertKit_WooCommerce_Product_Form();
108 87
109 88 }