logo
logo
logo
  • Home
  • Documentation
  • Support
Get PMF Free

Tabs

Getting Started

  • What is metafields?
  • Where to use it?
  • Some common use cases for metafields include
  • What about our plugin?

Installations

  • Automatic install from wordpress dashboard
  • Manual install from wordpess dashbaord
  • Install Using FTP

Configs

  • How to use or add?
  • How to print or display or fetch the data?
  • Usage

Fields

  • Text
  • Textarea
  • Switch
  • Tabs
  • Checkbox
  • Select
  • Image
  • Gallery
  • Datepicker
  • Colorpicker
  • Repeater

Go Pro

  • What is included in pro version?
  • Go Pro

FAQs

  • What is a meta box in WordPress?
  • Why do I need a meta box plugin?
  • Can I create multiple meta boxes?
  • Home
  • Docs
  • Fields
  • Tabs

Tabs

Template Usage #

You have to specify the type as tabs inside the array key called type. Please specify that which button value will be active by default. Use the default key inside the array.

<?php
// multiple buttons group field like multiple radio buttons tabs
array(

    'label'   => 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()
)
?>

How to fetch the data? #

Use our function called tpmeta_field(‘_your_id’) and pass the above array id key to fetch the metadata. Since the function tpmeta_field(‘_your_id’) will return the value so you have to echo the value. 

<?php
$value = function_exists('tpmeta_field')? tpmeta_field('meta_key_id_here') : '';
echo esc_html($value); ?>
What are your Feelings
Share This Article :
  • Facebook
  • Twitter
  • LinkedIn
  • Pinterest
Still stuck? How can we help?

How can we help?

Updated on October 3, 2023
SwitchCheckbox

Powered by BetterDocs

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Table of Contents
  • Template Usage
  • How to fetch the data?

Copyright © 2023 Pure Metafields. All Rights Reserved