{"id":36238,"date":"2015-05-10T17:12:16","date_gmt":"2015-05-10T17:12:16","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/contact-form-7-dynamic-select-extension\/"},"modified":"2018-07-27T13:47:22","modified_gmt":"2018-07-27T13:47:22","slug":"contact-form-7-dynamic-select-extension","status":"closed","type":"plugin","link":"https:\/\/wordpress.org\/plugins\/contact-form-7-dynamic-select-extension\/","author":10176418,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"2.0.3","stable_tag":"2.0.3","tested":"4.9.29","requires":"4.0","requires_php":"","requires_plugins":"","header_name":"Dynamic Select for Contact Form 7","header_author":"John A. Huebner II","header_description":"","assets_banners_color":"","last_updated":"2018-07-27 13:47:22","external_support_url":"","external_repository_url":"","donate_link":"https:\/\/www.paypal.com\/cgi-bin\/webscr?cmd=_donations&business=hube02%40earthlink%2enet&lc=US&item_name=Donation%20for%20WP%20Plugins%20I%20Use&no_note=0&cn=Add%20special%20instructions%20to%20the%20seller%3a&no_shipping=1&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted","header_plugin_uri":"https:\/\/github.com\/Hube2\/contact-form-7-dynamic-select-extension","header_author_uri":"https:\/\/github.com\/Hube2\/","rating":4.7,"author_block_rating":0,"active_installs":1000,"downloads":28056,"num_ratings":0,"support_threads":1,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":[],"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":"1","4":0,"5":"5"},"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0.0","1.0.2","1.1.0","1.1.1","1.1.2","1.1.3","1.2.0","1.2.1","2.0.0","2.0.1","2.0.2","2.0.3"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":"1915912","resolution":"1","location":"plugin"}},"screenshots":{"1":"Create Dynamic Select Field"}},"plugin_section":[74],"plugin_tags":[2845,1152,6609,1506,1864],"plugin_category":[],"plugin_contributors":[83588],"plugin_business_model":[],"class_list":["post-36238","plugin","type-plugin","status-closed","hentry","plugin_section-adopt-me","plugin_tags-adopt-me","plugin_tags-contact-form-7","plugin_tags-drop-down-menu","plugin_tags-dynamic","plugin_tags-select","plugin_contributors-hube2","plugin_committers-hube2"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/contact-form-7-dynamic-select-extension.svg","icon_2x":false,"generated":true},"screenshots":[{"src":"https:\/\/ps.w.org\/contact-form-7-dynamic-select-extension\/trunk\/screenshot-1.png?rev=1915912","caption":"Create Dynamic Select Field"}],"raw_content":"<!--section=description-->\n<p>Addopt this plugin. <a href=\"https:\/\/github.com\/Hube2\/contact-form-7-dynamic-select-extension\">Please see details on Github<\/a>.<\/p>\n\n<p>Create dynamic select fields in contact form 7. Requires Contact Form 7.<\/p>\n\n<p>Field values of dynamic select field are populated by using filters.<\/p>\n\nHow To Use\n\n<p>1) Create a filter to be called from your CF7 Dynamic Select Field.<\/p>\n\n<p>Example Filter:<\/p>\n\n<pre><code>function cf7_dynamic_select_do_example1($choices, $args=array()) {\n    \/\/ this function returns an array of \n    \/\/ label =&gt; value pairs to be used in\n    \/\/ a the select field\n    $choices = array(\n        '-- Make a Selection --' =&gt; '',\n        'Choice 1' =&gt; 'Choice 1',\n        'Choice 2' =&gt; 'Choice 2',\n        'Choice 3' =&gt; 'Choice 3',\n        'Choice 4' =&gt; 'Choice 4',\n        'Choice 5' =&gt; 'Choice 5'\n    );\n    return $choices;\n} \/\/ end function cf7_dynamic_select_do_example1\nadd_filter('wpcf7_dynamic_select_example1', \n             'cf7_dynamic_select_do_example1', 10, 2);\n<\/code><\/pre>\n\n<p>2) Enter the filter name and any arguments into the Filter Field when adding a Dynamic Select Field.\nFor example, if we need to supply a term_id so that the filter can get the posts in a category the\nfilter value entered would look something like this:<\/p>\n\n<pre><code>my-filter term_id=9\n<\/code><\/pre>\n\n<p><strong><em>Do Not Include any extra spaces or quotes arround values, names or the =<\/em><\/strong><\/p>\n\n<p>You can pass any number are arguments to your filter and they will be converted into an array. For example the\nfollowing:<\/p>\n\n<pre><code>my-filter product-type=101 brand=500\n<\/code><\/pre>\n\n<p>This will call the function assocaited with the filter hook 'my-filter' with an arguments the argument array of:\n    $args = array(\n        'product-type' =&gt; 101,\n        'brand'        =&gt; 500\n    )<\/p>\n\n<p>Your filter must return an array. The array must be a list of \"Label\" =&gt; \"Value\" pairs.\nFor more information see the example in cf7-dynamic-select-examples.php included in the plugin folder.<\/p>\n\n<p><a href=\"https:\/\/github.com\/Hube2\/contact-form-7-dynamic-select-extension\">Also on GitHub<\/a><\/p>\n\n<!--section=installation-->\n<ol>\n<li>Upload the files to the plugin folder of your site<\/li>\n<li>Activate it from the Plugins Page<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt>Installation Instructions<\/dt>\n<dd><ol>\n<li>Upload the files to the plugin folder of your site<\/li>\n<li>Activate it from the Plugins Page<\/li>\n<\/ol><\/dd>\n<dt>Why Filters?<\/dt>\n<dd><p>Many other plugins of this type use shortcodes. I'm not a real fan of shortcodes, but that's not the only\nreason.<\/p>\n\n<p>Filters are much more flexible that shortcodes.<\/p>\n\n<p>For example, a shortcode cannot return an array. A shortcode pretty much requires that only a text value is returned.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>2.0.3<\/h4>\n\n<ul>\n<li>correct fatal error called to undefined function when CF7 in not active.<\/li>\n<\/ul>\n\n<h4>2.0.2<\/h4>\n\n<ul>\n<li>corrected to work with CF7 &gt;= 4.8<\/li>\n<\/ul>\n\n<h4>2.0.1<\/h4>\n\n<ul>\n<li>corrected fatal function call error due to update in CF7<\/li>\n<\/ul>\n\n<h4>2.0.0<\/h4>\n\n<ul>\n<li>Replaced depricated CF7 function calls<\/li>\n<\/ul>\n\n<h4>1.2.1<\/h4>\n\n<ul>\n<li>corrected possible fatal error from duplicate function<\/li>\n<\/ul>\n\n<h4>1.2.0<\/h4>\n\n<ul>\n<li>Added default value logic<\/li>\n<li>Corrected Bug: allow multiple not working when inserting new field<\/li>\n<\/ul>\n\n<h4>1.1.3<\/h4>\n\n<ul>\n<li>Corrected PHP notice \"Indirect modification of overloaded element of WPCF7_Validation has no effect\"<\/li>\n<\/ul>\n\n<h4>1.1.2<\/h4>\n\n<ul>\n<li>Fix validation error removing other attributes, thanks pjgalbraith<\/li>\n<li>Changed name of plugin to meet new WP guidelines<\/li>\n<\/ul>\n\n<h4>1.1.1<\/h4>\n\n<ul>\n<li>Corrected a bug, incorrect field type name when creating new field, introduced in 1.1.0<\/li>\n<\/ul>\n\n<h4>1.1.0<\/h4>\n\n<ul>\n<li>Updated tag pane to be completely compatible w\/ CF7 &gt;= V4.2<\/li>\n<li>Backwards compatible w\/ CF7 &lt; V4.2<\/li>\n<\/ul>\n\n<h4>1.0.2<\/h4>\n\n<ul>\n<li>updated to work with CF7 V4.2 (tag pane still needs some work to make it 100% but it can be used and it will still work with previous versions of CF7)<\/li>\n<\/ul>\n\n<h4>1.0.1<\/h4>\n\n<ul>\n<li>Preserve $_GET value - If the value of the field is present in query string, preset the selected values.<\/li>\n<\/ul>\n\n<h4>1.0.0<\/h4>\n\n<ul>\n<li>initial release<\/li>\n<\/ul>","raw_excerpt":"Add Dynamic Select Fields in Contact Form 7.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/36238","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=36238"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/hube2"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=36238"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=36238"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=36238"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=36238"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=36238"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=36238"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}