← All changes
|
classes/views/frm-fields/back-end/generate-options-with-ai.php
+13
-1
6.26
→
trunk
View file →
| @@ -1,5 +1,14 @@ | ||
| 1 | 1 | <?php |
| 2 | +/** | |
| 3 | + * Generate options with AI button. | |
| 4 | + * | |
| 5 | + * @package Formidable | |
| 6 | + * | |
| 7 | + * @var array $args Arguments including 'button_text' and 'show_pill'. | |
| 8 | + * @var array $attributes HTML attributes for the button. | |
| 9 | + */ | |
| 10 | + | |
| 2 | 11 | if ( ! defined( 'ABSPATH' ) ) { |
| 3 | 12 | die( 'You are not allowed to call this page directly.' ); |
| 4 | 13 | } |
| 5 | 14 | ?> |
| @@ -4,6 +13,9 @@ | ||
| 4 | 13 | } |
| 5 | 14 | ?> |
| 6 | 15 | <button <?php FrmAppHelper::array_to_html_params( $attributes, true ); ?>> |
| 7 | 16 | <?php FrmAppHelper::icon_by_class( 'frmfont frm-ai-form-icon frm_svg15', array( 'aria-label' => __( 'Generate options with AI', 'formidable' ) ) ); ?> |
| 8 | - <span><?php esc_html_e( 'Generate with AI', 'formidable' ); ?></span> | |
| 17 | + <span><?php echo esc_html( $args['button_text'] ?? __( 'Generate with AI', 'formidable' ) ); ?></span> | |
| 18 | + <?php if ( isset( $args['show_pill'] ) ) : ?> | |
| 19 | + <?php FrmAppHelper::show_pill_text( __( 'BETA', 'formidable' ) ); ?> | |
| 20 | + <?php endif; ?> | |
| 9 | 21 | </button> |