{"id":843,"date":"2023-10-15T03:35:10","date_gmt":"2023-10-15T03:35:10","guid":{"rendered":"https:\/\/themepure.net\/plugins\/puremetafields\/?post_type=docs&#038;p=843"},"modified":"2023-10-15T08:18:57","modified_gmt":"2023-10-15T08:18:57","slug":"checkbox","status":"publish","type":"docs","link":"https:\/\/themepure.net\/plugins\/puremetafields\/docs\/checkbox\/","title":{"rendered":"Checkbox"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"843\" class=\"elementor elementor-843\">\n\t\t\t\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-a94fe7e elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"a94fe7e\" 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-951cb4f\" data-id=\"951cb4f\" 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-1084485 elementor-widget elementor-widget-image\" data-id=\"1084485\" 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\/checkbox-2.png\" data-elementor-open-lightbox=\"yes\" data-elementor-lightbox-title=\"checkbox-2\" data-e-action-hash=\"#elementor-action%3Aaction%3Dlightbox%26settings%3DeyJpZCI6ODgxLCJ1cmwiOiJodHRwczpcL1wvdGhlbWVwdXJlLm5ldFwvcGx1Z2luc1wvcHVyZW1ldGFmaWVsZHNcL3dwLWNvbnRlbnRcL3VwbG9hZHNcLzIwMjNcLzEwXC9jaGVja2JveC0yLnBuZyJ9\">\n\t\t\t\t\t\t\t<img decoding=\"async\" loading=\"lazy\" width=\"450\" height=\"202\" src=\"https:\/\/themepure.net\/plugins\/puremetafields\/wp-content\/uploads\/2023\/10\/checkbox-2.png\" class=\"attachment-full size-full wp-image-881\" 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-c6487a4 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"c6487a4\" 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-c2ea5fe\" data-id=\"c2ea5fe\" 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-d979e1b elementor-widget elementor-widget-heading\" data-id=\"d979e1b\" 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-6a5fe0e elementor-widget elementor-widget-text-editor\" data-id=\"6a5fe0e\" 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>You have to specify the <strong>type<\/strong> inside the <strong>array<\/strong> key called type. The type must be as &#8216;<strong>checkbox<\/strong>&#8216;. Don&#8217;t misspell the word. The default key will be an array of values which have to be matched with the keys of <strong>options<\/strong> field.<\/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-7dbb059 elementor-widget elementor-widget-text-editor\" data-id=\"7dbb059\" 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<\/code><\/pre><pre>array(\n    'label'   =&gt; esc_html__( 'Files Included', 'pure' ),\n    'id'      =&gt; \"{$prefix}_files_options\",\n    'type'    =&gt; '<b>checkbox<\/b>',\n    'default' =&gt; array(\n        'wordpress',\n        'react',\n        'html',\n        'psd',\n        'vue'\n    ),\n    'options' =&gt; array(\n        'wordpress' =&gt; 'Wordpress File Included?',\n        'react'     =&gt; 'React File Included?',\n        'html'\t\t=&gt; 'HTML File Included?',\n        'psd'\t\t=&gt; 'PSD Included?',\n        'vue'\t\t=&gt; 'Vue JS File Included?'\n    )\n)<\/pre><pre><code>?&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-9ba7ae5 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"9ba7ae5\" 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-c6cde16\" data-id=\"c6cde16\" 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-e993856 elementor-widget elementor-widget-heading\" data-id=\"e993856\" 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-93c05c0 elementor-widget elementor-widget-text-editor\" data-id=\"93c05c0\" 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 so you can check with <strong>isset()<\/strong> function. Check if the key exist in the array.<\/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-6216bde elementor-widget elementor-widget-text-editor\" data-id=\"6216bde\" 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 isset($value['options_key'])? \/\/code : \/\/another code;<\/code><br \/><code>\/\/or you can use if<br \/>if(isset($value['options_key'])){<br \/>    \/\/ code <br \/>}\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 You have to specify the type inside the array key called type. The type must be as &#8216;checkbox&#8216;. Don&#8217;t misspell the word. The default key will be an array of values which have to be matched with the keys of options field. &lt;?php array( &#8216;label&#8217; =&gt; esc_html__( &#8216;Files Included&#8217;, &#8216;pure&#8217; ), &#8216;id&#8217; =&gt; [&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\/843"}],"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=843"}],"version-history":[{"count":19,"href":"https:\/\/themepure.net\/plugins\/puremetafields\/wp-json\/wp\/v2\/docs\/843\/revisions"}],"predecessor-version":[{"id":890,"href":"https:\/\/themepure.net\/plugins\/puremetafields\/wp-json\/wp\/v2\/docs\/843\/revisions\/890"}],"wp:attachment":[{"href":"https:\/\/themepure.net\/plugins\/puremetafields\/wp-json\/wp\/v2\/media?parent=843"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/themepure.net\/plugins\/puremetafields\/wp-json\/wp\/v2\/doc_category?post=843"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/themepure.net\/plugins\/puremetafields\/wp-json\/wp\/v2\/doc_tag?post=843"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}