PluginProbe
Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages / 2.0.0
Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages v2.0.0
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/class-convertkit-resource-forms.php +2 -65 2.3.02.0.0 View file →
@@ -53,47 +53,8 @@
53 53
54 54 }
55 55
56 56 /**
57 - * Returns all non-inline forms based on the sort order.
58 - *
59 - * @since 2.2.4
60 - *
61 - * @return bool|array
62 - */
63 - public function get_non_inline() {
64 -
65 - // If the ConvertKit WordPress Libraries are < 1.3.6 (e.g. loaded by an outdated
66 - // addon), or a WordPress site updates this Plugin before other ConvertKit Plugins,
67 - // get_by() won't be available and will cause an E_ERROR, crashing the site.
68 - // @see https://wordpress.org/support/topic/error-1795/.
69 - if ( ! method_exists( $this, 'get_by' ) ) {
70 - return false;
71 - }
72 -
73 - return $this->get_by( 'format', array( 'modal', 'slide in', 'sticky bar' ) );
74 -
75 - }
76 -
77 -
78 - /**
79 - * Returns whether any non-inline forms exist in the options table.
80 - *
81 - * @since 2.2.4
82 - *
83 - * @return bool
84 - */
85 - public function non_inline_exist() {
86 -
87 - if ( ! $this->get_non_inline() ) {
88 - return false;
89 - }
90 -
91 - return true;
92 -
93 - }
94 -
95 - /**
96 57 * Returns the HTML/JS markup for the given Form ID.
97 58 *
98 59 * Legacy Forms will return HTML.
99 60 * Current Forms will return a <script> embed string.
@@ -145,34 +106,10 @@
145 106 // Return Legacy Form HTML.
146 107 return $api->get_form_html( $id );
147 108 }
148 109
149 - // If the form's format is not an inline form, add the inline script before the closing </body> tag.
150 - // This prevents a modal form's overlay being constrained by the WordPress Theme's styles,
151 - // and accidentally embedding the same non-inline form twice, which would result in e.g. the same modal form
152 - // displaying twice.
153 - if ( $this->resources[ $id ]['format'] !== 'inline' ) {
154 - add_filter(
155 - 'convertkit_output_scripts_footer',
156 - function ( $scripts ) use ( $id ) {
157 -
158 - $scripts[] = array(
159 - 'async' => true,
160 - 'data-uid' => $this->resources[ $id ]['uid'],
161 - 'src' => $this->resources[ $id ]['embed_js'],
162 - );
163 -
164 - return $scripts;
165 -
166 - }
167 - );
168 -
169 - // Don't return a script for output, as it'll be output in the site's footer.
170 - return '';
171 - }
172 -
173 - // If here, return Form <script> embed now, as we want the inline form to display at this specific point of the content.
174 - return '<script async data-uid="' . esc_attr( $this->resources[ $id ]['uid'] ) . '" src="' . esc_url( $this->resources[ $id ]['embed_js'] ) . '"></script>';
110 + // If here, return Form <script> embed.
111 + return '<script async data-uid="' . $this->resources[ $id ]['uid'] . '" src="' . $this->resources[ $id ]['embed_js'] . '"></script>';
175 112
176 113 }
177 114
178 115 }