mustardBees / cmb_field_map

Google Maps field type for Custom Metaboxes and Fields for WordPress
120 stars 49 forks source link

Option for not passing values to post #18

Closed lmartins closed 9 years ago

lmartins commented 9 years ago

I added cmb_field_map to pages, where to goal was to have the option for some pages to show a map. The pages in question are not known beforehand so I need a way to check if the be rendered or not. Since once attached to pages all pages will have coordinates information (when saving), are you planning on adding a switch to control this?

I can easily do it with another cmb2 field for hiding the information in the front-end, but im just wondering if there's a cleaner approach to that.

Thanks.

mustardBees commented 9 years ago

CMB2 provides a number of built-in display options.

You could choose to only show your meta box on certain page IDs. What I tend to use is the page template option. For example, I display a meta box for pages which have the contact page template selected.

Let me know if I've misunderstood what you're trying to achieve!