| @@ -53,39 +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 array | |
| 62 | - */ | |
| 63 | - public function get_non_inline() { | |
| 64 | - | |
| 65 | - return $this->get_by( 'format', array( 'modal', 'slide in', 'sticky bar' ) ); | |
| 66 | - | |
| 67 | - } | |
| 68 | - | |
| 69 | - | |
| 70 | - /** | |
| 71 | - * Returns whether any non-inline forms exist in the options table. | |
| 72 | - * | |
| 73 | - * @since 2.2.4 | |
| 74 | - * | |
| 75 | - * @return bool | |
| 76 | - */ | |
| 77 | - public function non_inline_exist() { | |
| 78 | - | |
| 79 | - if ( ! $this->get_non_inline() ) { | |
| 80 | - return false; | |
| 81 | - } | |
| 82 | - | |
| 83 | - return true; | |
| 84 | - | |
| 85 | - } | |
| 86 | - | |
| 87 | - /** | |
| 88 | 57 | * Returns the HTML/JS markup for the given Form ID. |
| 89 | 58 | * |
| 90 | 59 | * Legacy Forms will return HTML. |
| 91 | 60 | * Current Forms will return a <script> embed string. |
| @@ -137,34 +106,10 @@ | ||
| 137 | 106 | // Return Legacy Form HTML. |
| 138 | 107 | return $api->get_form_html( $id ); |
| 139 | 108 | } |
| 140 | 109 | |
| 141 | - // If the form's format is not an inline form, add the inline script before the closing </body> tag. | |
| 142 | - // This prevents a modal form's overlay being constrained by the WordPress Theme's styles, | |
| 143 | - // and accidentally embedding the same non-inline form twice, which would result in e.g. the same modal form | |
| 144 | - // displaying twice. | |
| 145 | - if ( $this->resources[ $id ]['format'] !== 'inline' ) { | |
| 146 | - add_filter( | |
| 147 | - 'convertkit_output_scripts_footer', | |
| 148 | - function( $scripts ) use ( $id ) { | |
| 149 | - | |
| 150 | - $scripts[] = array( | |
| 151 | - 'async' => true, | |
| 152 | - 'data-uid' => $this->resources[ $id ]['uid'], | |
| 153 | - 'src' => $this->resources[ $id ]['embed_js'], | |
| 154 | - ); | |
| 155 | - | |
| 156 | - return $scripts; | |
| 157 | - | |
| 158 | - } | |
| 159 | - ); | |
| 160 | - | |
| 161 | - // Don't return a script for output, as it'll be output in the site's footer. | |
| 162 | - return ''; | |
| 163 | - } | |
| 164 | - | |
| 165 | - // If here, return Form <script> embed now, as we want the inline form to display at this specific point of the content. | |
| 166 | - 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>'; | |
| 167 | 112 | |
| 168 | 113 | } |
| 169 | 114 | |
| 170 | 115 | } |