{"id":19052336,"date":"2026-10-22T21:48:21","date_gmt":"2026-10-22T21:48:21","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/wpuf-form-settings-become-empty-after-adding-new-fields-undefined-array\/"},"modified":"2026-10-22T21:56:08","modified_gmt":"2026-10-22T21:56:08","slug":"wpuf-form-settings-become-empty-after-adding-new-fields-undefined-array","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/wpuf-form-settings-become-empty-after-adding-new-fields-undefined-array\/","title":{"rendered":"WPUF form settings become empty after adding new fields \u2014 Undefined array"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><strong>Title: WPUF form settings become empty after adding new fields \u2014 Undefined array key <\/strong><code><strong>submit_text<\/strong><\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Environment<\/strong><\/p>\n\n\n\n<ul>\n<li>WordPress running locally on WAMP<\/li>\n\n\n\n<li>PHP version: [insert your PHP version]<\/li>\n\n\n\n<li>WP User Frontend (WPUF): [insert your plugin version]<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Problem<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When I use an existing WPUF form, it works correctly. However, after adding new fields to a form, I encounter this PHP warning:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Warning: Undefined array key \"submit_text\" in\nwp-content\/plugins\/wp-user-frontend\/includes\/Frontend_Render_Form.php on line 76<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The stack trace points to <code>Frontend_Render_Form-&gt;submit_button()<\/code>, called while rendering a form using the <code>[wpuf_form id=\"109\"]<\/code> shortcode.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Database investigation<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I checked the <code>wpuf_form_settings<\/code> post metadata for two forms:<\/p>\n\n\n\n<ul>\n<li>Form ID 109 (<code>SubmitPost<\/code>): <code>a:0:{}<\/code> \u2014 an empty settings array.<\/li>\n\n\n\n<li>Form ID 145 (<code>Sample Form<\/code>): a populated settings array containing <code>submit_text<\/code> and <code>update_text<\/code>, among other settings.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The existing Sample Form works correctly. The problem returns after adding new fields.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I have already entered the submit-button text in the form settings, so the warning does not appear to be caused simply by leaving that field blank.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Expected behaviour<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Adding new fields should not cause the form&#8217;s settings to become empty or result in undefined array key warnings when the form is rendered.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Request<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Could the development team investigate whether adding fields causes WPUF to lose or fail to save the form settings? The renderer should also handle missing settings safely, but I would appreciate clarification of why the settings array becomes empty in the first place.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I can provide the full stack trace and relevant database query results if needed.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">( ! ) Warning: Undefined array key &#8220;submit_text&#8221; in C:\\VirtualHosts\\ClientsManagement\\wp-content\\plugins\\wp-user-frontend\\includes\\Frontend_Render_Form.php on line <em>76<\/em> Call Stack #TimeMemoryFunctionLocation 10.0009376600{main}( )&#8230;\\index.php<strong>:<\/strong>0 20.0015377928require( &#8216;C:\\VirtualHosts\\ClientsManagement\\wp-blog-header.php )&#8230;\\index.php<strong>:<\/strong>17 35.767997301200require_once( &#8216;C:\\VirtualHosts\\ClientsManagement\\wp-includes\\template-loader.php )&#8230;\\wp-blog-header.php<strong>:<\/strong>19 46.071898358776include( &#8216;C:\\VirtualHosts\\ClientsManagement\\wp-content\\themes\\louis\\page.php )&#8230;\\template-loader.php<strong>:<\/strong>132 58.2323110097208get_template_part( $slug = &#8216;inc\/partials\/content&#8217;, $name = &#8216;page&#8217;, $args = ??? )&#8230;\\page.php<strong>:<\/strong>16 68.2343110098128locate_template( $template_names = [0 =&gt; &#8216;inc\/partials\/content-page.php&#8217;, 1 =&gt; &#8216;inc\/partials\/content.php&#8217;], $load = TRUE, $load_once = FALSE, $args = [] )&#8230;\\general-template.php<strong>:<\/strong>206 78.2346110098256load_template( $_template_file = &#8216;C:\\\\VirtualHosts\\\\ClientsManagement\/wp-content\/themes\/Louis\/inc\/partials\/content-page.php&#8217;, $load_once = FALSE, $args = [] )&#8230;\\template.php<strong>:<\/strong>815 88.2352110100712require( &#8216;C:\\VirtualHosts\\ClientsManagement\\wp-content\\themes\\louis\\inc\\partials\\content-page.php )&#8230;\\template.php<strong>:<\/strong>882 98.2447110216048the_content( $more_link_text = ???, $strip_teaser = ??? )&#8230;\\content-page.php<strong>:<\/strong>16 108.2460110216080apply_filters( $hook_name = &#8216;the_content&#8217;, $value = &#8221; )&#8230;\\post-template.php<strong>:<\/strong>256 118.2461110216544WP_Hook-&gt;apply_filters( $value = &#8221;, $args = [0 =&gt; &#8221;] )&#8230;\\plugin.php<strong>:<\/strong>206 128.2548110194776WeDevs\\Wpuf\\Frontend\\Form_Preview-&gt;the_content( $content = &#8221; )&#8230;\\class-wp-hook.php<strong>:<\/strong>353 138.2553110195096do_shortcode( $content = &#8216;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Your selected form is no longer available.&#8217;, $ignore_html = ??? )&#8230;\\Form_Preview.php<strong>:<\/strong>98 148.2555110199032<a href=\"http:\/\/www.php.net\/function.preg-replace-callback\">preg_replace_callback<\/a>( $pattern = &#8216;\/\\\\[(\\\\[?)(wpuf_form)(?![\\\\w-])([^\\\\]\\\\\/]*(?:\\\\\/(?!\\\\])[^\\\\]\\\\\/]*)*?)(?:(\\\\\/)\\\\]|\\\\](?:([^\\\\[]*+(?:\\\\[(?!\\\\\/\\\\2\\\\])[^\\\\[]*+)*+)\\\\[\\\\\/\\\\2\\\\])?)(\\\\]?)\/&#8217;, $callback = &#8216;do_shortcode_tag&#8217;, $subject = &#8216;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Your selected form is no longer available.&#8217; )&#8230;\\shortcodes.php<strong>:<\/strong>273 158.2557110199504do_shortcode_tag( $m = [0 =&gt; &#8216;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Your selected form is no longer available.&#8217;, 1 =&gt; &#8221;, 2 =&gt; &#8216;wpuf_form&#8217;, 3 =&gt; &#8216; id=&#8221;145&#8243;&#8216;, 4 =&gt; &#8221;, 5 =&gt; &#8221;, 6 =&gt; &#8221;] )&#8230;\\shortcodes.php<strong>:<\/strong>273 168.2560110200416WeDevs\\Wpuf\\Frontend\\Frontend_Form-&gt;add_post_shortcode( $atts = [&#8216;id&#8217; =&gt; &#8216;145&#8217;], &#8221;, &#8216;wpuf_form&#8217; )&#8230;\\shortcodes.php<strong>:<\/strong>434 178.2760110343592WeDevs\\Wpuf\\Frontend_Render_Form-&gt;render_form( $form_id = &#8216;145&#8217;, $post_id = NULL, $atts = [&#8216;id&#8217; =&gt; &#8216;145&#8217;], $form = class WeDevs\\Wpuf\\Admin\\Forms\\Form { public $id = &#8216;145&#8217;; public $form_fields = []; public $data = class WP_Post { public $ID = 145; public $post_author = &#8216;1&#8217;; public $post_date = &#8216;2019-05-20 17:18:25&#8217;; public $post_date_gmt = &#8216;2019-05-20 17:18:25&#8217;; public $post_content = &#8221;; public $post_title = &#8216;SampleForm&#8217;; public $post_excerpt = &#8221;; public $post_status = &#8216;publish&#8217;; public $comment_status = &#8216;closed&#8217;; public $ping_status = &#8216;closed&#8217;; public $post_password = &#8221;; public $post_name = &#8216;sample-form-2&#8217;; public $to_ping = &#8221;; public $pinged = &#8221;; public $post_modified = &#8216;2026-10-22 21:52:19&#8217;; public $post_modified_gmt = &#8216;2026-10-22 21:52:19&#8217;; public $post_content_filtered = &#8221;; public $post_parent = 0; public $guid = &#8216;http:\/\/clientsmanagement\/wpuf_forms\/sample-form-2\/&#8217;; public $menu_order = 0; public $post_type = &#8216;wpuf_forms&#8217;; public $post_mime_type = &#8221;; public $comment_count = &#8216;0&#8217;; public $filter = &#8216;raw&#8217; } } )&#8230;\\Frontend_Form.php<strong>:<\/strong>396 188.3995111509336WeDevs\\Wpuf\\Frontend_Render_Form-&gt;submit_button( $form_id = &#8216;145&#8217;, $form_settings = [], $post_id = NULL )&#8230;\\Frontend_Render_Form.php<strong>:<\/strong>361 &#8221; \/&gt;<\/p>\n","protected":false},"template":"","class_list":["post-19052336","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/19052336","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":2,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/19052336\/revisions"}],"predecessor-version":[{"id":19052341,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/19052336\/revisions\/19052341"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=19052336"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}