The Pure Metafields Plugin is a powerful tool designed to enhance the functionality and flexibility of your WordPress website. With this plugin, you can easily create and manage custom meta boxes, adding extra fields and data to your posts, pages, and custom post types. Key Features ✅ Custom Meta Boxes: Create unlimited custom meta boxes with ease. Define the title,....
The Pure Metafields Plugin is a powerful tool designed to enhance the functionality and flexibility of your WordPress website. With this plugin, you can easily create and manage custom meta boxes, adding extra fields and data to your posts, pages, and custom post types.
Key Features
✅ Custom Meta Boxes: Create unlimited custom meta boxes with ease. Define the title, placement, and priority of each meta box to suit your needs.
✅ Flexible Field Types: The plugin offers a wide range of field types to choose from, including text, textarea, select, checkbox, radio buttons, date picker, and more. Customize the field options and validation rules effortlessly.
✅ Repeatable Fields: Enable the ability to repeat fields, allowing users to add multiple instances of the same field dynamically. Perfect for scenarios where you need to capture multiple sets of data.
✅ Conditional Logic: Set up conditional logic to show or hide fields based on the value of other fields. This feature adds versatility and improves the user experience of your forms.
✅ Built-in Validation: Ensure data accuracy by implementing validation rules for your fields. You can define required fields, validate input formats, and customize error messages effortlessly.
✅ Save and Retrieve Meta Data: The plugin provides simple functions to save and retrieve meta data, allowing you to access and utilize the stored information in your themes or plugins.
✅ Integration with WordPress API: Seamlessly integrate with the WordPress API and extend its functionalities. Hook into actions and filters to manipulate meta data and create dynamic interactions.
Live Docs
Add Metabox Fields
Text Fields
'Text Field',
'id' => "_your_id",
'type' => 'text', // specify the type field
'placeholder' => '',
'default' => '', // do not remove default key
)
// textarea field for large text
array(
'label' => 'Textarea Field',
'id' => "_your_id",
'type' => 'textarea', // specify the type field
'placeholder' => 'Type...',
'default' => '',
'conditional' => array()
)
?>
Image and Gallery Field
esc_html__( 'Your Title', 'textdomain' ),
'id' => "_your_id",
'type' => 'image', // specify the type field
'default' => '',
'conditional' => array()
)
// Gallery field for multiple images upload
array(
'label' => esc_html__( 'Your Title', '' ),
'id' => "_your_id",
'type' => 'gallery', // specify the type field
'default' => '',
'conditional' => array()
)
?>
Switch Field
esc_html__( 'Your Title', 'textdomain' ),
'id' => "_your_id",
'type' => 'switch',
'default' => 'off',
'conditional' => array()
)
?>
Group Button
esc_html__( 'Group Buttons Tab', '' ),
'id' => "_your_id",
'desc' => '',
'type' => 'tabs',
'choices' => array(
'button_1' => 'Button 1',
'button_2' => 'Button 2',
'button_3' => 'Button 3',
),
'default' => 'button_1',
'conditional' => array()
)
?>
Select Field
esc_html__('TP Select Field', 'textdomain'),
'id' => "_your_id",
'type' => 'select',
'options' => array(
'1' => 'one',
'2' => 'two ',
'3' => 'three ',
'4' => 'four ',
'5' => 'five ',
),
'placeholder' => 'Select an item',
'conditional' => array(),
'default' => ''
)
?>
Datepicker Field
'Datepicker',
'id' => "_your_id",
'type' => 'datepicker',
'placeholder' => '',
'default' => '',
'conditional' => array()
)
?>
Colorpicker
'Colorpicker',
'id' => "_your_id",
'type' => 'colorpicker',
'placeholder' => '',
'default' => '',
'conditional' => array()
)
?>
Select any post type posts
esc_html__('TP Posts Select', 'textdomain'),
'id' => "_your_id",
'type' => 'select_posts',
'post_type' => 'post', // specify the post type you want to fetch
'placeholder' => 'Select a post',
'conditional' => array(),
'default' => ''
)
?>
Repeater
In the above code example where fields array paste the repeater array inside fields array
esc_html__(‘Field Title’, ‘textdomain’),
‘id’ => “_your_id”,
‘type’ => ‘repeater’, // specify the type “repeater” (case sensitive)
‘conditional’ => array(),
‘default’ => array(),
‘fields’ => array(
array(
‘label’ => esc_html__(‘Your Title’, ‘textdomain’),
‘id’ => “_your_id”,
‘type’ => ‘select’,
‘options’ => array(
‘footer_1’ => ‘Footer 1’,
‘footer_2’ => ‘Footer 2’,
‘footer_3’ => ‘Footer 3’
),
‘placeholder’ => ‘Select a footer’,
‘conditional’ => array(),
‘default’ => ‘footer_1’,
),
array(
‘label’ => esc_html__(‘Select Footer Style’, ‘textdomain’),
‘id’ => “_footer_style_2”,
‘type’ => ‘select’,
‘options’ => array(
‘footer_1’ => ‘Footer 1’,
‘footer_2’ => ‘Footer 2’,
‘footer_3’ => ‘Footer 3’
),
‘placeholder’ => ‘Select a footer’,
‘conditional’ => array(),
‘default’ => ‘footer_1’,
‘bind’ => “_footer_template_2” // bind the key to be control with conditions
),
array(
‘label’ => esc_html__(‘Select Footer Template’, ‘textdomain’),
‘id’ => “_footer_template_2”,
‘type’ => ‘select_posts’,
‘placeholder’ => ‘Select a template’,
‘post_type’ => ‘tp-footer’,
‘conditional’ => array(
“_footer_style_2”, “==”, “footer_2″ // First parameter will be the id of control field and so on
),
‘default’ => ”,
)
)
)
?>
Conditional Field
'Text Field',
'id' => "_your_id",
'type' => 'text',
'placeholder' => '',
'default' => '',
'conditional' => array(
"_id_of_any_field", "any operator", "value_of_that_field"
)
)
array(
'label' => 'Text Field',
'id' => "_your_id",
'type' => 'text',
'placeholder' => '',
'default' => '',
'conditional' => array(
"_field_id", "==", "_field_value"
)
)
?>
For bind with post format
$prefix . '_post_meta_gallery_box',
'title' => esc_html__( 'Post Meta Gallery', 'donafund' ),
'post_type'=> 'post',
'context' => 'normal',
'priority' => 'core',
'fields' => array(
array(
'label' => esc_html__( 'Gallery Format', 'textdomain' ),
'id' => "{$prefix}_gallery_5",
'type' => 'gallery',
'default' => '',
'conditional' => array(),
),
),
'post_format' => 'gallery' // if u want to bind with post formats
);
$meta_boxes[] = array(
'metabox_id' => $prefix . '_post_meta_audio_box',
'title' => esc_html__( 'Post Meta Audio', 'donafund' ),
'post_type'=> 'post',
'context' => 'normal',
'priority' => 'core',
'fields' => array(
array(
'label' => esc_html__( 'Audio Format', 'donafund' ),
'id' => "{$prefix}_audio_format",
'type' => 'text',
'placeholder' => esc_html__( 'Audio url here', 'donafund' ),
'default' => '',
'conditional' => array()
),
),
'post_format' => 'audio' // if u want to bind with post formats
);
$meta_boxes[] = array(
'metabox_id' => $prefix . '_post_meta_video_box',
'title' => esc_html__( 'Post Meta Video', 'donafund' ),
'post_type'=> 'post',
'context' => 'normal',
'priority' => 'core',
'fields' => array(
array(
'label' => esc_html__( 'Video Format', 'donafund' ),
'id' => "{$prefix}_video_format",
'type' => 'text',
'placeholder' => esc_html__( 'Video url here', 'donafund' ),
'default' => '',
'conditional' => array()
),
),
'post_format' => 'video' // if u want to bind with post formats
);
return $meta_boxes;
}
?>
Get the meta value for current post
Get the meta value for specific post
Get gallery images
";
echo $single_image_src['alt'] ."
";
}
?>
Get single image
Get Repeater Data
Access Single Image and Gallery Images Inside Repeater
Be Part of the Conversation with WordPress Enthusiasts
Using Pure Metafields? Great, join the conversation now!
Let’s talk about overall quality, ease of use, stellar support, unbeatable value, and the amazing experience Pure Metafields brings to you.