JFIF $ d d 7 * Z qn )ZP 0 !1 A "#a$2Qr D8 a Ri [f \m I ykI w0 c u F c Rı?lO7 к _f˓ [C $殷WF< _W ԣ s Kc ëI zyQy /_LK ℂ ;C",p F A : /] =H ~ , l s / 9 ć: [=/#f ; ) x { ٛE Q )~ = 𘙲r*2~ a _V = ' ku m F D } KYYC )( { * g& f `툪 r y ` = ^ c J. I ]( * `wq 1dđ #̩ ͑ 0 ; H ] u 搂 @:~ ו K L N s h } O I R* 8 :2 ! lD JV o ( 3 = M ( z Ȱ+i *N A r6K n S l ) ! J J Ӂ* % ݉?|D } d5: eP0 R; {$X' x F @ .ÊB {,WJ uQ ɲRI ;9 Q E琯 6 2fT .DU J ;*c P A\IL Nj! J ۱+ O\ ͔ ] ޒ S J ȧ c%A N ol ՎprU L Zԛe r E2= X D Xg VQeӓ k y P7 U* o m Q I s ,K `) 6\G3t?pgjr m ۛجw luGt f h 9uyP 0D;Uڽ"OXl i f $ ) &|ML 0 Z rm1 [ H XP l P R0 'G=i 2N +0 e 2 ]] 9 VT P O 7 h(F * 癈 ' = Q VZD F,d ߬ ~ T X G[ `le 69C R(!S2! P < 0 x < !1AQ "Raq 02Br #S CTb ? Ζ "]mH5WR 7 k.ۛ ! } Q~ + yԏ z |@ T20 S~ K e k *zF f^2X *( @ 8 r ? C I uI|֓>^Ex LgNU Y+{.R Ѫ τV YT D I 6 2 '8Y2 7'\T P.6 d &˦ @V q i |8 -O Ε ] ʔ U= T L 8= ;6c | !qfF3 a ů& ~$ l} 'NW U s$U k^S V : U#6w + +s &r+n ڐ { @ 29gL u " T Ù M=6 (^ "7 r}=6Yݾ lC u hquymp Ǧ G jhs ǜNl ɻ} o 7 #S6 a w 4 ! OS r D 5 7 % | ?x> L | / nD 6?/8 w # [ ) L 7 +6〼T A T g ! %5 Mm Z /c -{1_Je "| ^$ 'O & ޱմ < H vNqϡQ$ < 6 &Nݛ ֨tǻN (9 n ru~'όN sMG& ,uH Kw *Ī 5@ u6 BԒ i YN * f 0 _ GhKW u lT <nj- 0{ M L~ | /a v\ E = ?1 \ɟuq Ђ Y O a K ޡP q $ H8o Q˼EV ~ k 0 h' L Pp M -M" m^ !6l nմ 쮝C U T . ! :vMǨb h ډ Vc r @~p # !1QAa q ? AL0L x LU 4 d ; x " 16ad0 7.\ߋ 0 = P l v/ " c A Ay A|2pO8"d MV #1] = \ " ˡ ] k v I9 d ۓ & q ) ǐq E ꞅ v "P )q X &Q З non]я u ג./ ; gZ$ M QР 2M ]h ni 0 P $ێ 3CɏGjώy : m c # S_ l@ '_ \m|C 2`K _ 1 cIvGc $? PCQ S+D ? K aײ k Fr b 8 ύ NEدg ĝ U 3 6 #Ik+ v { v i ( ވ ? a e) X xy/*@Q Ǽ Ծ ) $ IWO l c G; !i k{ gOŀ L ('x T rb $ w) R $ & N1E td U3Uȉ1p M"N* (DNy d96.(jQ) X 5 c QɎMy W ? Q *!R > 6=7)Xj 5`J ] e 8%t ! + ' ! 1Q 5 !1 AQaq ё #2 "0BRb ? G t^ ## .l lQ T $ v , ,m 㵜5u bV =sY+ @d { N ! dn O < .- B; _w J t 6;Q Jd. Q c%p{ 1 ,sND dF H I0 Гo X ш e黅X ۢ F :)[ F G X ƹ / w _c MeD ,ʡc c . W D tA $ j@ : ) - #u c1< @ۗ9F ) KJ- hpP] _ x [ q B lb p ʖ w q " LFGd ƶ * s +ډ_Zc " ? % t[I P 6 J ]# =ɺ V v v CGs Gh1 > )6 |e y ? L ӣ m,4 G W Ui ` ] uJVo VDG< SB 6ϏQ @ TiU l y O U 0 kfV ~ ~}S Z @ *WU Ui ## ; s /[ = ! 7}" W N ] ' (L ! ~ y5 g9T̅J kbM' +s :S +B) v @ M j e C f j E 0 Y\Qn z G 1 д~ W o{T 9?` Rm yhsy3 !HAD ] m c1 ~ 2 L S u7x T ;j$ `} 4-> L# vzŏ I L S ֭ T { r jGK C ; b pU= - ` Bs K. S F w4 M q] Z dH S 0 ) tLg
<?php
// phpcs:disable Generic.Commenting.DocComment.MissingShort
/** @noinspection PhpIllegalPsrClassPathInspection */
/** @noinspection AutoloadingIssuesInspection */
// phpcs:enable Generic.Commenting.DocComment.MissingShort
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
use WPForms\Admin\Forms\Tags;
use WPForms\Integrations\AiMcp\AiMcp;
/**
* Settings management panel.
*
* @since 1.0.0
*/
class WPForms_Builder_Panel_Settings extends WPForms_Builder_Panel {
/**
* All systems go.
*
* @since 1.0.0
*/
public function init() {
// Define panel information.
$this->name = esc_html__( 'Settings', 'wpforms-lite' );
$this->slug = 'settings';
$this->icon = 'fa-sliders';
$this->order = 10;
$this->sidebar = true;
/**
* Filters the form data for the form builder.
*
* @since 1.9.0
*
* @param array $form_data Form data.
*/
$this->form_data = apply_filters( 'wpforms_builder_panel_settings_init_form_data', $this->form_data );
}
/**
* Output the Settings panel sidebar.
*
* @since 1.0.0
*/
public function panel_sidebar() {
// Sidebar contents are not valid unless we have a form.
if ( ! $this->form ) {
return;
}
$sections = [
'general' => esc_html__( 'General', 'wpforms-lite' ),
'anti_spam' => esc_html__( 'Spam Protection and Security', 'wpforms-lite' ),
'confirmation' => esc_html__( 'Confirmations', 'wpforms-lite' ),
'notifications' => esc_html__( 'Notifications', 'wpforms-lite' ),
'themes' => esc_html__( 'Themes', 'wpforms-lite' ),
];
/**
* Filters builder settings sections.
*
* @since 1.1.9
*
* @param array $sections Sections.
* @param array $form_data Form data.
*
* @return array
*/
$sections = (array) apply_filters( 'wpforms_builder_settings_sections', $sections, $this->form_data ); // phpcs:ignore WPForms.PHP.ValidateHooks.InvalidHookName
foreach ( $sections as $slug => $section ) {
$this->panel_sidebar_section( $section, $slug );
}
}
/**
* Enqueue assets.
*
* @since 1.7.5
*/
public function enqueues() {
$min = wpforms_get_min_suffix();
wp_enqueue_script(
'wpforms-builder-settings',
WPFORMS_PLUGIN_URL . "assets/js/admin/builder/settings{$min}.js",
[ 'wpforms-builder' ],
WPFORMS_VERSION,
true
);
wp_localize_script(
'wpforms-builder-settings',
'wpforms_builder_settings',
[
'choicesjs_config' => $this->get_choicesjs_config(),
'all_tags_choices' => Tags::get_all_tags_choices(),
]
);
}
/**
* Get Choices.js configuration.
*
* @since 1.7.5
*
* @return array
*/
private function get_choicesjs_config(): array {
$config = Tags::get_choicesjs_config();
$config['noResultsText'] = esc_html__( 'Press Enter or "," key to add new tag', 'wpforms-lite' );
return $config;
}
/**
* Output the Settings panel primary content.
*
* @since 1.0.0
*/
public function panel_content() {
// Check if there is a form created.
if ( ! $this->form ) {
echo '<div class="wpforms-alert wpforms-alert-info">';
echo wp_kses(
__( 'You need to <a href="#" class="wpforms-panel-switch" data-panel="setup">setup your form</a> before you can manage the settings.', 'wpforms-lite' ),
[
'a' => [
'href' => [],
'class' => [],
'data-panel' => [],
],
]
);
echo '</div>';
return;
}
/*
* General.
*/
echo '<div class="wpforms-panel-content-section wpforms-panel-content-section-general">';
echo '<div class="wpforms-panel-content-section-title">';
esc_html_e( 'General', 'wpforms-lite' );
echo '</div>';
wpforms_panel_field(
'text',
'settings',
'form_title',
$this->form_data,
esc_html__( 'Form Name', 'wpforms-lite' ),
[
'default' => $this->form->post_title,
]
);
wpforms_panel_field(
'textarea',
'settings',
'form_desc',
$this->form_data,
esc_html__( 'Form Description', 'wpforms-lite' ),
[
'tooltip' => esc_html__( 'Enter descriptive text or instructions to help your users understand the requirements of your form.', 'wpforms-lite' ),
'input_class' => 'wpforms-smart-tags-enabled',
'data' => [
'type' => 'all',
'fields' => '',
],
]
);
if ( $this->form->post_type === 'wpforms-template' ) {
wpforms_panel_field(
'textarea',
'settings',
'template_description',
$this->form_data,
esc_html__( 'Template Description', 'wpforms-lite' ),
[
'tooltip' => esc_html__( 'Describe the use case for your template. Only displayed internally.', 'wpforms-lite' ),
]
);
}
$this->general_setting_tags();
wpforms_panel_field(
'text',
'settings',
'submit_text',
$this->form_data,
esc_html__( 'Submit Button Text', 'wpforms-lite' ),
[
'default' => esc_html__( 'Submit', 'wpforms-lite' ),
]
);
wpforms_panel_field(
'text',
'settings',
'submit_text_processing',
$this->form_data,
esc_html__( 'Submit Button Processing Text', 'wpforms-lite' ),
[
'tooltip' => esc_html__( 'Enter the submit button text you would like the button display while the form submit is processing.', 'wpforms-lite' ),
]
);
/**
* Fires after the main General settings fields, before the Advanced group.
*
* @since 2.0.1
*
* @param WPForms_Builder_Panel_Settings $settings Current settings.
*/
do_action( 'wpforms_form_settings_general_main_after', $this ); // phpcs:ignore WPForms.PHP.ValidateHooks.InvalidHookName
$this->general_setting_advanced();
$this->ai_mcp_section();
echo '</div>';
/*
* Notifications.
*/
echo '<div class="wpforms-panel-content-section wpforms-panel-content-section-notifications" data-panel="notifications">';
/**
* Output notifications.
*
* @since 1.6.7.3
*
* @param WPForms_Builder_Panel_Settings $settings Current settings.
*/
do_action( 'wpforms_form_settings_notifications', $this ); // phpcs:ignore WPForms.PHP.ValidateHooks.InvalidHookName
echo '</div>';
/*
* Confirmations.
*/
echo '<div class="wpforms-panel-content-section wpforms-panel-content-section-confirmation" data-panel="confirmations">';
/**
* Output confirmations.
*
* @since 1.6.7.3
*
* @param WPForms_Builder_Panel_Settings $settings Current settings.
*/
do_action( 'wpforms_form_settings_confirmations', $this ); // phpcs:ignore WPForms.PHP.ValidateHooks.InvalidHookName
echo '</div>';
/**
* Output custom panels.
*
* @since 1.6.7.3
*
* @param WPForms_Builder_Panel_Settings $settings Current settings.
*/
do_action( 'wpforms_form_settings_panel_content', $this ); // phpcs:ignore WPForms.PHP.ValidateHooks.InvalidHookName
}
/**
* Output the Tags setting.
*
* @since 1.7.5
*/
private function general_setting_tags() {
$form_tags = [];
if ( ! empty( $this->form_data['settings']['form_tags'] ) ) {
$form_tags = get_terms(
[
'taxonomy' => WPForms_Form_Handler::TAGS_TAXONOMY,
'name' => $this->form_data['settings']['form_tags'],
'hide_empty' => false,
]
);
$form_tags = is_wp_error( $form_tags ) ? [] : (array) $form_tags;
}
$tags_value = wp_list_pluck( $form_tags, 'term_id' );
$tags_options = wp_list_pluck( $form_tags, 'name', 'term_id' );
wpforms_panel_field(
'select',
'settings',
'form_tags',
$this->form_data,
esc_html__( 'Tags', 'wpforms-lite' ),
[
'options' => $tags_options,
'value' => $tags_value,
'multiple' => true,
'tooltip' => esc_html__( 'Mark form with the tags. To create a new tag, simply type it and press Enter.', 'wpforms-lite' ),
]
);
}
/**
* Output the *CAPTCHA settings.
*
* @since 1.6.8
*
* @noinspection HtmlUnknownTarget
*/
private function general_setting_advanced() {
ob_start();
wpforms_panel_field(
'text',
'settings',
'form_class',
$this->form_data,
esc_html__( 'Form CSS Class', 'wpforms-lite' ),
[
'tooltip' => esc_html__( 'Enter CSS class names for the form wrapper. Multiple class names should be separated with spaces.', 'wpforms-lite' ),
]
);
wpforms_panel_field(
'text',
'settings',
'submit_class',
$this->form_data,
esc_html__( 'Submit Button CSS Class', 'wpforms-lite' ),
[
'tooltip' => esc_html__( 'Enter CSS class names for the form submit button. Multiple names should be separated with spaces.', 'wpforms-lite' ),
]
);
wpforms_panel_field(
'toggle',
'settings',
'dynamic_population',
$this->form_data,
esc_html__( 'Enable Prefill by URL', 'wpforms-lite' ),
[
'tooltip' => sprintf(
'<a href="%1$s" target="_blank" rel="noopener noreferrer">%2$s</a>',
wpforms_utm_link( 'https://wpforms.com/developers/how-to-enable-dynamic-field-population/', 'Builder Settings', 'Prefill by URL Tooltip' ),
esc_html__( 'How to use Prefill by URL', 'wpforms-lite' )
),
]
);
wpforms_panel_field(
'toggle',
'settings',
'ajax_submit',
$this->form_data,
esc_html__( 'Enable AJAX form submission', 'wpforms-lite' ),
[
'tooltip' => esc_html__( 'Enables form submission without page reload.', 'wpforms-lite' ),
]
);
/**
* Fires after general settings.
*
* @since 1.0.2
*
* @param WPForms_Builder_Panel_Settings $settings Current settings.
*/
do_action( 'wpforms_form_settings_general', $this ); // phpcs:ignore WPForms.PHP.ValidateHooks.InvalidHookName
// Wrap advanced settings to the unfoldable group.
wpforms_panel_fields_group(
ob_get_clean(),
[
'borders' => [ 'top' ],
'unfoldable' => true,
'group' => 'settings_advanced',
'title' => esc_html__( 'Advanced', 'wpforms-lite' ),
'title_attr' => __( 'Toggle Advanced Settings', 'wpforms-lite' ),
]
);
}
/**
* Output the AI MCP section.
*
* Promotes the WordPress Abilities API + WPForms MCP bridge and exposes the write-access
* toggle inside the builder, mirroring the Tools → AI MCP tab. The toggle input is
* intentionally name-less, so it never enters the serialized form state and cannot be
* picked up by the form save / undo-redo flow — it is a site setting, not form data.
*
* @since 1.10.2.1
*/
private function ai_mcp_section() {
// Without the Abilities API (WP 6.9+) no WPForms ability registers, so the toggle would gate nothing.
if ( ! wpforms_current_user_can() || ! function_exists( 'wp_register_ability' ) ) {
return;
}
$inner = wpforms_render(
'admin/tools/ai-mcp',
AiMcp::get_template_data( 'wpforms-ai-mcp-page-builder' ),
true
);
// Open by default for the initial release; a later release will ship it collapsed.
wpforms_panel_fields_group(
$inner,
[
'borders' => [ 'top' ],
'unfoldable' => true,
'group' => 'settings_ai_mcp',
'title' => esc_html__( 'AI MCP', 'wpforms-lite' ),
'title_attr' => __( 'Toggle AI MCP Settings', 'wpforms-lite' ),
'title_badge' => '<span class="wpforms-badge wpforms-badge-sm wpforms-badge-inline wpforms-badge-rounded wpforms-badge-green">' . esc_html__( 'New', 'wpforms-lite' ) . '</span>',
'default' => 'opened',
]
);
}
}
new WPForms_Builder_Panel_Settings();