{"id":2115,"date":"2023-12-10T11:34:00","date_gmt":"2023-12-10T11:34:00","guid":{"rendered":"https:\/\/wpshortcode.org\/?p=2115"},"modified":"2023-12-10T11:34:00","modified_gmt":"2023-12-10T11:34:00","slug":"advanced-forms","status":"publish","type":"post","link":"https:\/\/wpshortcode.org\/advanced-forms\/","title":{"rendered":"Advanced Forms for ACF Shortcode"},"content":{"rendered":"\n        \n        <p class=\"wp-block-paragraph\">Below, you&#8217;ll find a detailed guide on how to add the <strong>Advanced Forms for ACF Shortcode<\/strong> to your WordPress website, including its <strong>parameters<\/strong>, <strong>examples<\/strong>, and <strong>PHP function code<\/strong>. Additionally, we&#8217;ll assist you with common issues that might cause the Advanced Forms for ACF Plugin shortcode not to show or not to work correctly.<\/p>\n        \n\n        \n        <p class=\"wp-block-paragraph\">Before starting, here is an overview of the Advanced Forms for ACF Plugin and the shortcodes it provides:<\/p>\n        \n        \n        <p>            <div class=\"plugin-info-box\">\n        <div class=\"top-main\">\n            <!-- SVG Image -->\n            <div class=\"plugin-image\">\n                <img decoding=\"async\" src=\"https:\/\/ps.w.org\/advanced-forms\/assets\/icon-128x128.png?rev=1894251\" alt=\"Plugin Icon\" \/>\n            <\/div>\n            \n            <div class=\"plugin-descriptive-part\">\n                <!-- Plugin Name with Link -->\n\n                    <a class=\"plugin-title\" href=\"https:\/\/wordpress.org\/plugins\/advanced-forms\" target=\"_blank\" rel=\"noopener\">\n                        Advanced Forms for ACF                    <\/a>\n\n\n                <!-- Plugin Description -->\n                <p class=\"plugin-description\">\n                    &quot;Advanced Forms for ACF is a WordPress plugin designed to simplify your work by creating versatile, customizable forms. Its user-friendly interface makes form building a breeze.&quot;                <\/p>\n            <\/div>\n        <\/div>\n\n        <!-- Rating and Additional Info -->\n        <div class=\"plugin-meta\">\n            <span class=\"plugin-rating\">\n                <span class='stars'>\u2605\u2605\u2605\u2605\u2605<\/span> (41)\n            <\/span>\n            <span class=\"plugin-active-installs\">\n                <strong>Active Installs<\/strong>: 3000+\n            <\/span>\n            <span class=\"plugin-tested\">\n                <strong>Tested with<\/strong>: 6.2.3            <\/span>\n            <span class=\"plugin-php-version\">\n                <strong>PHP Version<\/strong>: 7.0            <\/span>\n        <\/div>\n\n        <!-- List of Included Shortcodes -->\n        <div class=\"plugin-shortcodes\">\n            <strong>Included Shortcodes:<\/strong>\n            <ul>\n                <li>[advanced_form]<\/li>            <\/ul>\n        <\/div>\n    <\/div>\n    <\/p>\n\n            <div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n            \n            \n            \n            <h2 class=\"wp-block-heading\">Advanced Forms for ACF [advanced_form] Shortcode<\/h2>\n            \n            \n            \n            <p class=\"wp-block-paragraph\">The &#8216;advanced_form&#8217; shortcode is used to render a specific form on your WordPress site. \n\n\n\nIt accepts a &#8216;form&#8217; attribute that identifies the form to be displayed. The form&#8217;s ID or key is used as the identifier. The shortcode then calls the &#8216;render&#8217; function to display the form, and the output is returned.<\/p>\n            \n\n            \n            <p class=\"wp-block-paragraph\"><strong>Shortcode<\/strong>: <code>[advanced_form]<\/code><\/p>\n            \n            \n            \n            <div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n            \n                <h3 class=\"wp-block-heading\">Parameters<\/h3>\n                \n                \n                \n                <p class=\"wp-block-paragraph\">Here is a list of all possible advanced_form shortcode parameters and attributes:<\/p>\n                \n                \n                <ul>\n<li><code>form<\/code> &#8211; Specifies the unique key or ID of the form to be displayed<\/li>\n<li><code>atts<\/code> &#8211; Holds additional attributes to customize the form display<\/li>\n<\/ul>\n    \n                \n                <div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n                \n                <h3 class=\"wp-block-heading\">Examples and Usage<\/h3>\n                \n \n            <p><strong>Basic example<\/strong> &#8211; Utilizes the shortcode to display a specific form by referencing its ID or key.<\/p>\n\n<pre class=\"wp-block-code\"><code>[advanced_form form=1 \/]<\/code><\/pre>\n\n\n<p><strong>Advanced examples<\/strong><\/p>\n\n<p>Example 1 &#8211; Uses the shortcode to display a form by referencing its ID or key, while also passing additional attributes. These attributes can be used to further customize the form&#8217;s behavior and appearance.<\/p>\n\n<pre class=\"wp-block-code\"><code>[advanced_form form=1 att1=value1 att2=value2 \/]<\/code><\/pre>\n\n\n<p>Example 2 &#8211; Utilizes the shortcode to display a contact form by referencing both ID and title. The form will first try to load by ID, but if not found, it will try to load by title. This is useful in cases where form IDs may change due to migration or other factors.<\/p>\n\n<pre class=\"wp-block-code\"><code>[advanced_form form=\"Contact Us\" \/]<\/code><\/pre>\n\n\n<p>Example 3 &#8211; Uses the shortcode to display a form by referencing its ID, while also passing an array of attributes. This allows for more complex customizations and can be particularly useful when working with forms that have a large number of fields.<\/p>\n\n<pre class=\"wp-block-code\"><code>[advanced_form form=1 atts=\"array('att1' => 'value1', 'att2' => 'value2')\" \/]<\/code><\/pre>\n\n\n            \n            <div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n            \n            <h3 class=\"wp-block-heading\">PHP Function Code<\/h3>\n            \n            \n            \n            <p class=\"wp-block-paragraph\">In case you have difficulties debugging what causing issues with <code>[advanced_form]<\/code> shortcode, check below the related PHP functions code.<\/p>\n            \n                    \n                    <p class=\"wp-block-paragraph\"><strong>Shortcode line<\/strong>:<\/p>\n                    \n        \n                    \n                    <pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">add_shortcode( 'advanced_form', array( $this, 'form_shortcode' ) );<\/code><\/pre>\n                    \n                    \n                    <p class=\"wp-block-paragraph\"><strong>Shortcode PHP function<\/strong>:<\/p>\n                    \n            \n                    <div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; light: false; title: ; toolbar: true; notranslate\" title=\"\">\n                    function form_shortcode( $atts ) {\n\t\tif ( isset( $atts&#91;&#039;form&#039;] ) ) {\n\n\t\t\t$form_id_or_key = $atts&#91;&#039;form&#039;];\n\t\t\tunset( $atts&#91;&#039;form&#039;] );\n\n\t\t\tob_start();\n\n\t\t\t$this-&gt;render( $form_id_or_key, $atts );\n\n\t\t\t$output = ob_get_clean();\n\n\t\t\treturn $output;\n\t\t}\n\t}\n                    <\/pre><\/div>\n                    \n                    <p class=\"wp-block-paragraph\"><strong>Code file location<\/strong>:<\/p>\n                    \n                    \n                    \n                    <pre class=\"wp-block-code\"><code>advanced-forms\/advanced-forms\/core\/forms\/forms-rendering.php<\/code><\/pre>\n                    \n        <div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n        \n        \n        \n        <h2 class=\"wp-block-heading\">Conclusion<\/h2>\n        \n        \n        \n        <p class=\"wp-block-paragraph\">Now that you&#8217;ve learned how to embed the <strong>Advanced Forms for ACF Plugin shortcode<\/strong>, understood the parameters, and seen code examples, it&#8217;s easy to use and debug any issue that might cause it to &#8216;not work&#8217;. If you still have difficulties with it, don&#8217;t hesitate to leave a comment below.<\/p>\n        ","protected":false},"excerpt":{"rendered":"<p>Below, you&#8217;ll find a detailed guide on how to add the Advanced Forms for ACF Shortcode to your WordPress website, including its parameters, examples, and PHP function code. Additionally, we&#8217;ll assist you with common issues that might cause the Advanced Forms for ACF Plugin shortcode not to show or not to work correctly. Before starting, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"name":"Advanced Forms for ACF","slug":"","version":"1.9.3.2","author":"<a href=\"http:\/\/hookturn.io\">Phil Kurth (Hookturn)<\/a>","icons":"https:\/\/ps.w.org\/advanced-forms\/assets\/icon-128x128.png?rev=1894251","plugin_tags":"{\"acf\":\"acf\",\"acf-form\":\"acf form\",\"advanced-custom-fields\":\"advanced custom fields\",\"contact-form\":\"contact form\",\"form-builder\":\"form builder\"}","author_profile":"https:\/\/profiles.wordpress.org\/philkurth\/","requires":"5.4.0","tested":"6.2.3","requires_php":"7.0","rating":100,"num_ratings":41,"active_installs":3000,"downloaded":80502,"last_updated":"2023-07-26 12:41pm GMT","added":"2016-11-13","homepage":"https:\/\/wordpress.org\/plugins\/advanced-forms\/","short_description":"Flexible and developer-friendly forms using the power of Advanced Custom Fields","description":"\"Advanced Forms for ACF is a WordPress plugin designed to simplify your work by creating versatile, customizable forms. Its user-friendly interface makes form building a breeze.\"","shortcodes":"[\"advanced_form\"]","footnotes":""},"categories":[1],"tags":[],"class_list":["post-2115","post","type-post","status-publish","format-standard","hentry","category-plugins"],"_links":{"self":[{"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/posts\/2115","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/comments?post=2115"}],"version-history":[{"count":1,"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/posts\/2115\/revisions"}],"predecessor-version":[{"id":2620,"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/posts\/2115\/revisions\/2620"}],"wp:attachment":[{"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/media?parent=2115"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/categories?post=2115"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/tags?post=2115"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}