| @@ -106,34 +106,10 @@ | ||
| 106 | 106 | // Return Legacy Form HTML. |
| 107 | 107 | return $api->get_form_html( $id ); |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | - // If the form's format is not an inline form, add the inline script before the closing </body> tag. | |
| 111 | - // This prevents a modal form's overlay being constrained by the WordPress Theme's styles, | |
| 112 | - // and accidentally embedding the same non-inline form twice, which would result in e.g. the same modal form | |
| 113 | - // displaying twice. | |
| 114 | - if ( $this->resources[ $id ]['format'] !== 'inline' ) { | |
| 115 | - add_filter( | |
| 116 | - 'convertkit_output_scripts_footer', | |
| 117 | - function( $scripts ) use ( $id ) { | |
| 118 | - | |
| 119 | - $scripts[] = array( | |
| 120 | - 'async' => true, | |
| 121 | - 'data-uid' => $this->resources[ $id ]['uid'], | |
| 122 | - 'src' => $this->resources[ $id ]['embed_js'], | |
| 123 | - ); | |
| 124 | - | |
| 125 | - return $scripts; | |
| 126 | - | |
| 127 | - } | |
| 128 | - ); | |
| 129 | - | |
| 130 | - // Don't return a script for output, as it'll be output in the site's footer. | |
| 131 | - return ''; | |
| 132 | - } | |
| 133 | - | |
| 134 | - // If here, return Form <script> embed now, as we want the inline form to display at this specific point of the content. | |
| 135 | - 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>'; | |
| 136 | 112 | |
| 137 | 113 | } |
| 138 | 114 | |
| 139 | 115 | } |