← All changes
|
includes/block-formatters/class-convertkit-block-formatter-form-link.php
+7
-2
2.2.9
→
3.4.4
View file →
| @@ -73,9 +73,9 @@ | ||
| 73 | 73 | */ |
| 74 | 74 | public function get_overview() { |
| 75 | 75 | |
| 76 | 76 | return array( |
| 77 | - 'title' => __( 'ConvertKit Form Trigger', 'convertkit' ), | |
| 77 | + 'title' => __( 'Kit Form Trigger', 'convertkit' ), | |
| 78 | 78 | 'description' => __( 'Displays a modal, sticky bar or slide in form to display when the link is pressed.', 'convertkit' ), |
| 79 | 79 | 'icon' => 'resources/backend/images/block-icon-formtrigger.svg', |
| 80 | 80 | |
| 81 | 81 | // Gutenberg: Block Icon in Editor. |
| @@ -122,9 +122,14 @@ | ||
| 122 | 122 | $forms_data = array(); |
| 123 | 123 | if ( $this->forms->exist() ) { |
| 124 | 124 | foreach ( $this->forms->get_non_inline() as $form ) { |
| 125 | 125 | // Add this form's necessary to the attribute arrays. |
| 126 | - $forms[ absint( $form['id'] ) ] = sanitize_text_field( $form['name'] ); | |
| 126 | + // Legacy forms don't include a `format` key, so define them as inline. | |
| 127 | + $forms[ absint( $form['id'] ) ] = sprintf( | |
| 128 | + '%s [%s]', | |
| 129 | + sanitize_text_field( $form['name'] ), | |
| 130 | + ( ! empty( $form['format'] ) ? sanitize_text_field( $form['format'] ) : 'inline' ) | |
| 131 | + ); | |
| 127 | 132 | $forms_data[ absint( $form['id'] ) ] = array( |
| 128 | 133 | 'data-id' => sanitize_text_field( $form['id'] ), |
| 129 | 134 | 'data-formkit-toggle' => sanitize_text_field( $form['uid'] ), |
| 130 | 135 | 'href' => $form['embed_url'], |