FAQ — Pure Metafields Documentation

Docs/FAQ

Frequently Asked Questions

The questions that come up most, plus the handful of things that trip people up — and the fix.

What is Pure Metafields?

Pure Metafields (package tpmeta) is a WordPress plugin by ThemePure for building custom metaboxes, theme option panels, custom post types and taxonomies — visually in the admin or in code. Option panel values are stored as theme_mods; metabox values are stored as post_meta.

My option value comes back empty

You're likely using the wrong helper. Option panels read with tpmeta_get_option() / get_theme_mod(); metaboxes read with tpmeta_field(); user-profile fields read with plain get_user_meta(). Also confirm the field ID matches the storage key exactly.

A switch is always "on" in PHP

A legacy switch stores the string 'false', which is truthy. Set the field's data_type to boolean so it reads back as a real bool — then if ( tpmeta_get_option('id') ) behaves correctly. See Best Practices.

A conditional field won't hide

The controller and the dependent field must live in the same section (options) or the same metabox. Values are compared as strings for == / !=; use > / < only on numeric fields. See Dynamic Data.

My repeater value is a JSON string

Read it through tpmeta_get_repeater_rows() (options) or tpmeta_field() (metabox) — both decode to an array of rows. Don't json_decode() the raw meta yourself.

The panel disappeared from the Customizer

Re-open Panel Settings, confirm Customizer integration is ticked, and save. The flag must stay on for the panel to keep mirroring — see Integrations → Options Pages.

My coded panel's menu never appears

Panels register on init (priority 5). Make sure your set_args() / set_section() calls run on init, and that the current user has the manage_options capability.

How do I loop a repeater field?

Use tpmeta_get_repeater_rows('field_id') for option panels, or tpmeta_field() for metabox repeaters. Both return an array of row objects ready for a foreach, with sub-field defaults merged in.

How do I export and import data between sites?

Go to Pure Fields → Export / Import. Export all or selected data types (metafields, post types, taxonomies, options); option exports include the saved theme_mod values. On the target site, paste or upload the JSON to recreate definitions and re-apply values. See Move Data Between Sites.

How do I migrate from Kirki or Redux?

In Pure Fields → Option Builder, click the Kirki or Redux import button, paste your existing PHP, review the parsed preview, then import. It becomes an editable Pure Meta panel you can save and bake to PHP. See Migrate from Kirki / Redux.

What is the difference between Bake to PHP and Export/Import?

Bake to PHP generates a committable PHP file that registers a panel through the TPMeta_Options API — for shipping in a theme or plugin. Export/Import moves a live configuration, including saved values, between running sites as JSON.

Pure Metafields admin screen: helpdocs
Help & Docs ships in the plugin. Pure Fields → Help & Docs is a Developer Quick Reference with copy-paste snippets for metafields, option panels, the visual builder, Customizer and user meta.