{"id":248,"date":"2023-10-02T11:22:57","date_gmt":"2023-10-02T11:22:57","guid":{"rendered":"https:\/\/themepure.net\/plugins\/puremetafields\/?post_type=docs&#038;p=248"},"modified":"2023-10-03T05:46:24","modified_gmt":"2023-10-03T05:46:24","slug":"gallery","status":"publish","type":"docs","link":"https:\/\/themepure.net\/plugins\/puremetafields\/docs\/gallery\/","title":{"rendered":"Gallery"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"248\" class=\"elementor elementor-248\">\n\t\t\t\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-29421b6b elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"29421b6b\" 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-4a811883\" data-id=\"4a811883\" 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-383a8224 elementor-widget elementor-widget-image\" data-id=\"383a8224\" 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\/gallery.png\" data-elementor-open-lightbox=\"yes\" data-elementor-lightbox-title=\"gallery\" data-e-action-hash=\"#elementor-action%3Aaction%3Dlightbox%26settings%3DeyJpZCI6NDA3LCJ1cmwiOiJodHRwczpcL1wvdGhlbWVwdXJlLm5ldFwvcGx1Z2luc1wvcHVyZW1ldGFmaWVsZHNcL3dwLWNvbnRlbnRcL3VwbG9hZHNcLzIwMjNcLzEwXC9nYWxsZXJ5LnBuZyJ9\">\n\t\t\t\t\t\t\t<img decoding=\"async\" loading=\"lazy\" width=\"395\" height=\"263\" src=\"https:\/\/themepure.net\/plugins\/puremetafields\/wp-content\/uploads\/2023\/10\/gallery.png\" class=\"attachment-large size-large wp-image-407\" 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-11f85608 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"11f85608\" 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-200a3b52\" data-id=\"200a3b52\" 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-12b4af62 elementor-widget elementor-widget-heading\" data-id=\"12b4af62\" 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-e78b826 elementor-widget elementor-widget-text-editor\" data-id=\"e78b826\" 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>image<\/strong> inside the <strong>array<\/strong> key called type.<\/p><p><strong>Note: the type should be lowercase string otherwise you will get error!<\/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-1238b084 elementor-widget elementor-widget-text-editor\" data-id=\"1238b084\" 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\/\/ Gallery field for multiple images upload\narray(\n\n    'label'    =&gt; esc_html__( 'Your Title', '' ),\n    'id'      =&gt; \"_your_id\",\n    'type'    =&gt; 'gallery', \/\/ specify the type field\n    'default' =&gt; '',\n    'conditional' =&gt; array()\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-1c3daf6 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"1c3daf6\" 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-ebd2797\" data-id=\"ebd2797\" 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-ebf3f83 elementor-widget elementor-widget-heading\" data-id=\"ebf3f83\" 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-3132586 elementor-widget elementor-widget-text-editor\" data-id=\"3132586\" 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 <code>tpmeta_gallery_field('_your_id')<\/code><strong>\u00a0<\/strong>and pass the above array id key to fetch the metadata. Since the function <code>tpmeta_gallery_field('_your_id')<\/code>will return the value as array of images so you have to <strong>echo<\/strong> the value inside a <strong>loop<\/strong>.\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-61a5877 elementor-widget elementor-widget-text-editor\" data-id=\"61a5877\" 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$tp_gallery_images = function_exists('tpmeta_gallery_field') ? tpmeta_gallery_field('gallery_meta_key') : ''; \/\/tpmeta_gallery_field($string_ids, $size)\n\nforeach($tp_gallery_images as $single_image_src){\n    echo $single_image_src['url'] .\"&lt;br&gt;\";\n    echo $single_image_src['alt'] .\"&lt;br&gt;\";\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\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Template Usage Specify the type as image inside the array key called type. Note: the type should be lowercase string otherwise you will get error! &lt;?php \/\/ Gallery field for multiple images upload array( &#8216;label&#8217; =&gt; esc_html__( &#8216;Your Title&#8217;, &#8221; ), &#8216;id&#8217; =&gt; &#8220;_your_id&#8221;, &#8216;type&#8217; =&gt; &#8216;gallery&#8217;, \/\/ specify the type field &#8216;default&#8217; =&gt; &#8221;, [&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\/248"}],"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=248"}],"version-history":[{"count":7,"href":"https:\/\/themepure.net\/plugins\/puremetafields\/wp-json\/wp\/v2\/docs\/248\/revisions"}],"predecessor-version":[{"id":514,"href":"https:\/\/themepure.net\/plugins\/puremetafields\/wp-json\/wp\/v2\/docs\/248\/revisions\/514"}],"wp:attachment":[{"href":"https:\/\/themepure.net\/plugins\/puremetafields\/wp-json\/wp\/v2\/media?parent=248"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/themepure.net\/plugins\/puremetafields\/wp-json\/wp\/v2\/doc_category?post=248"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/themepure.net\/plugins\/puremetafields\/wp-json\/wp\/v2\/doc_tag?post=248"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}