{"id":244,"date":"2023-10-02T11:22:33","date_gmt":"2023-10-02T11:22:33","guid":{"rendered":"https:\/\/themepure.net\/plugins\/puremetafields\/?post_type=docs&#038;p=244"},"modified":"2024-03-18T10:49:55","modified_gmt":"2024-03-18T10:49:55","slug":"select","status":"publish","type":"docs","link":"https:\/\/themepure.net\/plugins\/puremetafields\/docs\/select\/","title":{"rendered":"Select"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"244\" class=\"elementor elementor-244\">\n\t\t\t\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-7ef9fa61 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"7ef9fa61\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-70a086b4\" data-id=\"70a086b4\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-element elementor-element-32d37067 elementor-widget elementor-widget-image\" data-id=\"32d37067\" data-element_type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<style>\/*! elementor - v3.13.3 - 28-05-2023 *\/\n.elementor-widget-image{text-align:center}.elementor-widget-image a{display:inline-block}.elementor-widget-image a img[src$=\".svg\"]{width:48px}.elementor-widget-image img{vertical-align:middle;display:inline-block}<\/style>\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"https:\/\/themepure.net\/plugins\/puremetafields\/wp-content\/uploads\/2023\/10\/select.png\" data-elementor-open-lightbox=\"yes\" data-elementor-lightbox-title=\"select\" data-e-action-hash=\"#elementor-action%3Aaction%3Dlightbox%26settings%3DeyJpZCI6NDEwLCJ1cmwiOiJodHRwczpcL1wvdGhlbWVwdXJlLm5ldFwvcGx1Z2luc1wvcHVyZW1ldGFmaWVsZHNcL3dwLWNvbnRlbnRcL3VwbG9hZHNcLzIwMjNcLzEwXC9zZWxlY3QucG5nIn0%3D\">\n\t\t\t\t\t\t\t<img decoding=\"async\" loading=\"lazy\" width=\"377\" height=\"402\" src=\"https:\/\/themepure.net\/plugins\/puremetafields\/wp-content\/uploads\/2023\/10\/select.png\" class=\"attachment-large size-large wp-image-410\" alt=\"\" \/>\t\t\t\t\t\t\t\t<\/a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-5481c601 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"5481c601\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-6ab72f20\" data-id=\"6ab72f20\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-element elementor-element-7a09a90c elementor-widget elementor-widget-heading\" data-id=\"7a09a90c\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<style>\/*! elementor - v3.13.3 - 28-05-2023 *\/\n.elementor-heading-title{padding:0;margin:0;line-height:1}.elementor-widget-heading .elementor-heading-title[class*=elementor-size-]>a{color:inherit;font-size:inherit;line-height:inherit}.elementor-widget-heading .elementor-heading-title.elementor-size-small{font-size:15px}.elementor-widget-heading .elementor-heading-title.elementor-size-medium{font-size:19px}.elementor-widget-heading .elementor-heading-title.elementor-size-large{font-size:29px}.elementor-widget-heading .elementor-heading-title.elementor-size-xl{font-size:39px}.elementor-widget-heading .elementor-heading-title.elementor-size-xxl{font-size:59px}<\/style><h2 class=\"elementor-heading-title elementor-size-default\">Template Usage<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b9ffd96 elementor-widget elementor-widget-text-editor\" data-id=\"b9ffd96\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<style>\/*! elementor - v3.13.3 - 28-05-2023 *\/\n.elementor-widget-text-editor.elementor-drop-cap-view-stacked .elementor-drop-cap{background-color:#69727d;color:#fff}.elementor-widget-text-editor.elementor-drop-cap-view-framed .elementor-drop-cap{color:#69727d;border:3px solid;background-color:transparent}.elementor-widget-text-editor:not(.elementor-drop-cap-view-default) .elementor-drop-cap{margin-top:8px}.elementor-widget-text-editor:not(.elementor-drop-cap-view-default) .elementor-drop-cap-letter{width:1em;height:1em}.elementor-widget-text-editor .elementor-drop-cap{float:left;text-align:center;line-height:1;font-size:50px}.elementor-widget-text-editor .elementor-drop-cap-letter{display:inline-block}<\/style>\t\t\t\t<p>Specify the <strong>type<\/strong> as <strong>select<\/strong> inside the <strong>array<\/strong> key called type. Please note that you have to give the type otherwise you will get an error!<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-1c40aa04 elementor-widget elementor-widget-text-editor\" data-id=\"1c40aa04\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<pre><br \/><br \/><code>&lt;?php\n\/\/ select field dropdown\narray(\n\n    'label'           =&gt; esc_html__('TP Select Field', 'textdomain'),\n    'id'              =&gt; \"_your_id\",\n    'type'            =&gt; '<strong style=\"color: purple;\">select<\/strong>',\n    'options'         =&gt; array(\n        '1' =&gt; 'one',\n        '2' =&gt; 'two ',\n        '3' =&gt; 'three ',\n        '4' =&gt; 'four ',\n        '5' =&gt; 'five ',\n    ),\n    'placeholder'     =&gt; 'Select an item',\n    'conditional' =&gt; array(),\n    'default' =&gt; '',<br \/>    'multiple' =&gt; false,<br \/><\/code><code>\n)\n?&gt;<\/code><\/pre>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-36df1ff elementor-widget elementor-widget-text-editor\" data-id=\"36df1ff\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p><strong>Notice:\u00a0<\/strong>Please note that the key field called <strong>&#8216;multiple&#8217;\u00a0<\/strong>will be always exist in the array otherwise you will get an warning!<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-821b831 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"821b831\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-a8e4e46\" data-id=\"a8e4e46\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-element elementor-element-ba3def2 elementor-widget elementor-widget-heading\" data-id=\"ba3def2\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Multi Select<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-ee621df elementor-widget elementor-widget-text-editor\" data-id=\"ee621df\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>Specify a key called <strong>multiple\u00a0<\/strong>and set it&#8217;s value to true or 1. it will be understand that the select is multiple.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-01c2eaa elementor-widget elementor-widget-text-editor\" data-id=\"01c2eaa\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<pre><code>&lt;?php\n\/\/ multi select field dropdown\narray(\n\n    'label'           =&gt; esc_html__('TP Select Field', 'textdomain'),\n    'id'              =&gt; \"_your_id\",\n    'type'            =&gt; '<strong style=\"color: purple;\">select<\/strong>',\n    'options'         =&gt; array(\n        '1' =&gt; 'one',\n        '2' =&gt; 'two ',\n        '3' =&gt; 'three ',\n        '4' =&gt; 'four ',\n        '5' =&gt; 'five ',\n    ),\n    'placeholder'     =&gt; 'Select an item',\n    'conditional' =&gt; array(),\n    'default' =&gt; array(),<br \/>    '<strong>multiple<\/strong>' =&gt; true\n)\n?&gt;<\/code><\/pre>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-d722f41 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"d722f41\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-72a8565\" data-id=\"72a8565\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-element elementor-element-159d296 elementor-widget elementor-widget-heading\" data-id=\"159d296\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Multi Select Context<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-467d8e4 elementor-widget elementor-widget-text-editor\" data-id=\"467d8e4\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>Specify a key called <strong>&#8216;context&#8217;\u00a0<\/strong>you can set it either <strong>&#8216;normal&#8217;<\/strong> or <strong>&#8216;select2&#8217;.<\/strong><\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-35a054c elementor-widget elementor-widget-text-editor\" data-id=\"35a054c\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<pre><code>&lt;?php\n\/\/ multi select field dropdown\narray(\n\n    'label'           =&gt; esc_html__('TP Select Field', 'textdomain'),\n    'id'              =&gt; \"_your_id\",\n    'type'            =&gt; '<strong style=\"color: purple;\">select<\/strong>',\n    'options'         =&gt; array(\n        '1' =&gt; 'one',\n        '2' =&gt; 'two ',\n        '3' =&gt; 'three ',\n        '4' =&gt; 'four ',\n        '5' =&gt; 'five ',\n    ),\n    'placeholder'     =&gt; 'Select an item',\n    'conditional' =&gt; array(),\n    'default' =&gt; array(),<br \/>    '<strong>multiple<\/strong>' =&gt; true,<\/code><br \/><code>    <b>'context'  =&gt; 'normal' \/\/ or 'select2'<\/b>\n)\n?&gt;<\/code><\/pre>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-f2772c2 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"f2772c2\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-774cc83\" data-id=\"774cc83\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-element elementor-element-dedce0b elementor-widget elementor-widget-heading\" data-id=\"dedce0b\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">How to fetch the data?<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-545aa9f elementor-widget elementor-widget-text-editor\" data-id=\"545aa9f\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>Use our function called <strong>tpmeta_field(&#8216;_your_id&#8217;) <\/strong>and pass the above array id key to fetch the metadata. Since the function <strong>tpmeta_field(&#8216;_your_id&#8217;) <\/strong>will return the value so you have to <strong>echo<\/strong> the value.\u00a0<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-84db8c1 elementor-widget elementor-widget-text-editor\" data-id=\"84db8c1\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<pre><code>&lt;?php\n$value = function_exists('tpmeta_field')? tpmeta_field('meta_key_id_here') : '';<br \/>echo esc_html($value);\n?&gt;<\/code><\/pre>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-a119f73 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"a119f73\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-5c0fb1c\" data-id=\"5c0fb1c\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-element elementor-element-1bcfdbc elementor-widget elementor-widget-heading\" data-id=\"1bcfdbc\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Multi select data?<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-6b5afc5 elementor-widget elementor-widget-text-editor\" data-id=\"6b5afc5\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>Use our function called <strong>tpmeta_field(&#8216;_your_id&#8217;) <\/strong>and pass the above array id key to fetch the metadata. Since the function <strong>tpmeta_field(&#8216;_your_id&#8217;) <\/strong>will return an array for the multi value.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-c196a76 elementor-widget elementor-widget-text-editor\" data-id=\"c196a76\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<pre><code>&lt;?php\n$value = function_exists('tpmeta_field')? tpmeta_field('meta_key_id_here') : '';<br \/>print_r($value) or use loop;\n?&gt;<\/code><\/pre>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Template Usage Specify the type as select inside the array key called type. Please note that you have to give the type otherwise you will get an error! &lt;?php \/\/ select field dropdown array( &#8216;label&#8217; =&gt; esc_html__(&#8216;TP Select Field&#8217;, &#8216;textdomain&#8217;), &#8216;id&#8217; =&gt; &#8220;_your_id&#8221;, &#8216;type&#8217; =&gt; &#8216;select&#8217;, &#8216;options&#8217; =&gt; array( &#8216;1&#8217; =&gt; &#8216;one&#8217;, &#8216;2&#8217; =&gt; &#8216;two [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":[],"doc_category":[8],"doc_tag":[],"acf":[],"_links":{"self":[{"href":"https:\/\/themepure.net\/plugins\/puremetafields\/wp-json\/wp\/v2\/docs\/244"}],"collection":[{"href":"https:\/\/themepure.net\/plugins\/puremetafields\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/themepure.net\/plugins\/puremetafields\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/themepure.net\/plugins\/puremetafields\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/themepure.net\/plugins\/puremetafields\/wp-json\/wp\/v2\/comments?post=244"}],"version-history":[{"count":28,"href":"https:\/\/themepure.net\/plugins\/puremetafields\/wp-json\/wp\/v2\/docs\/244\/revisions"}],"predecessor-version":[{"id":917,"href":"https:\/\/themepure.net\/plugins\/puremetafields\/wp-json\/wp\/v2\/docs\/244\/revisions\/917"}],"wp:attachment":[{"href":"https:\/\/themepure.net\/plugins\/puremetafields\/wp-json\/wp\/v2\/media?parent=244"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/themepure.net\/plugins\/puremetafields\/wp-json\/wp\/v2\/doc_category?post=244"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/themepure.net\/plugins\/puremetafields\/wp-json\/wp\/v2\/doc_tag?post=244"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}