All Projects → LeadSoftInc → cmb2-tabs

LeadSoftInc / cmb2-tabs

Licence: MIT License
Tabs extension for the CMB2

Programming Languages

PHP
23972 projects - #3 most used programming language
CSS
56736 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to cmb2-tabs

Smart-Inspector
Fluent re-take on Unity Inspector UX. Packed with QoL improvements.
Stars: ✭ 680 (+1346.81%)
Mutual labels:  extension, tabs
want-my-rss
RSS features for Firefox
Stars: ✭ 68 (+44.68%)
Mutual labels:  extension
ssh-python
Python bindings for libssh C library.
Stars: ✭ 19 (-59.57%)
Mutual labels:  extension
FancyTab
No description or website provided.
Stars: ✭ 15 (-68.09%)
Mutual labels:  tabs
AppVeyorExtension
AppVeyor extension for Visual Studio
Stars: ✭ 15 (-68.09%)
Mutual labels:  extension
fx-private-relay-add-on
Companion add-on for Firefox Relay. Keep your email safe from hackers and trackers. Make an email alias with one click, and keep your address to yourself.
Stars: ✭ 24 (-48.94%)
Mutual labels:  extension
sanic-mongodb-extension
MongoDB with μMongo support for Sanic framework
Stars: ✭ 25 (-46.81%)
Mutual labels:  extension
emulator
Run Android emulator and iOS simulator easily from VScode!
Stars: ✭ 60 (+27.66%)
Mutual labels:  extension
vscode-note
a simple note-taking extension for vscode.
Stars: ✭ 29 (-38.3%)
Mutual labels:  extension
Visual-Studio
A Discord Rich Presence extension for both Visual Studio 2017 and 2019.
Stars: ✭ 80 (+70.21%)
Mutual labels:  extension
spree-postal-service
Weight based calculator for Spree Commerce.
Stars: ✭ 21 (-55.32%)
Mutual labels:  extension
vscode-open-in-github
Open the current project or file in github.com.
Stars: ✭ 16 (-65.96%)
Mutual labels:  extension
bana
Set of extensions for Autodesk Maya's Python API.
Stars: ✭ 32 (-31.91%)
Mutual labels:  extension
natural js
Natural-JS : Javascript Front-End Architecture Framework
Stars: ✭ 35 (-25.53%)
Mutual labels:  tabs
Tabdown
Tabdown is an open mark-up language for text tabs & chords.
Stars: ✭ 49 (+4.26%)
Mutual labels:  tabs
vscode-magento-wizard
Helps develop Magento 2 extensions using VSCode
Stars: ✭ 22 (-53.19%)
Mutual labels:  extension
AndrOBD-Plugin
AndrOBD plugin development project
Stars: ✭ 38 (-19.15%)
Mutual labels:  extension
solidus dev support
A collection of tools for developing Solidus extensions.
Stars: ✭ 14 (-70.21%)
Mutual labels:  extension
pg track settings
Small extension to keep track of postgresql settings modification
Stars: ✭ 28 (-40.43%)
Mutual labels:  extension
grubreboot-gnome-shell-extension
gnome-shell extension to add a "Reboot" button to the end-session-dialog, that runs grub-reboot before restart
Stars: ✭ 18 (-61.7%)
Mutual labels:  extension

cmb2-tabs

Extensions the tabs to the library CMB2

Preview

tabs

Changelog

  • 1.2.3 Added license to the project
  • 1.2.2 Support vertical layout
  • 1.2.1 Support for custom attributes for the tabs container
  • 1.0.1 Added support the "options page"
  • 1.0.0 Init

Example metabox

add_filter( 'cmb2_init', 'example_tabs_metaboxes' );
function example_tabs_metaboxes() {
	$box_options = array(
		'id'           => 'example_tabs_metaboxes',
		'title'        => __( 'Example tabs', 'cmb2' ),
		'object_types' => array( 'page' ),
		'show_names'   => true,
	);

	// Setup meta box
	$cmb = new_cmb2_box( $box_options );

	// setting tabs
	$tabs_setting           = array(
		'config' => $box_options,
		//		'layout' => 'vertical', // Default : horizontal
		'tabs'   => array()
	);
	$tabs_setting['tabs'][] = array(
		'id'     => 'tab1',
		'title'  => __( 'Tab 1', 'cmb2' ),
		'fields' => array(
			array(
				'name' => __( 'Title', 'cmb2' ),
				'id'   => 'header_title',
				'type' => 'text'
			),
			array(
				'name' => __( 'Subtitle', 'cmb2' ),
				'id'   => 'header_subtitle',
				'type' => 'text'
			),
			array(
				'name'    => __( 'Background image', 'cmb2' ),
				'id'      => 'header_background',
				'type'    => 'file',
				'options' => array(
					'url' => false
				)
			)
		)
	);
	$tabs_setting['tabs'][] = array(
		'id'     => 'tab2',
		'title'  => __( 'Tab 2', 'cmb2' ),
		'fields' => array(
			array(
				'name' => __( 'Title', 'cmb2' ),
				'id'   => 'review_title',
				'type' => 'text'
			),
			array(
				'name' => __( 'Subtitle', 'cmb2' ),
				'id'   => 'review_subtitle',
				'type' => 'text'
			),
			array(
				'id'      => 'reviews',
				'type'    => 'group',
				'options' => array(
					'group_title'   => __( 'Review {#}', 'cmb2' ),
					'add_button'    => __( 'Add review', 'cmb2' ),
					'remove_button' => __( 'Remove review', 'cmb2' ),
					'sortable'      => false
				),
				'fields'  => array(
					array(
						'name' => __( 'Author name', 'cmb2' ),
						'id'   => 'name',
						'type' => 'text'
					),
					array(
						'name'    => __( 'Author avatar', 'cmb2' ),
						'id'      => 'avatar',
						'type'    => 'file',
						'options' => array(
							'url' => false
						)
					),
					array(
						'name' => __( 'Comment', 'cmb2' ),
						'id'   => 'comment',
						'type' => 'textarea'
					)
				)
			)
		)
	);

	// set tabs
	$cmb->add_field( array(
		'id'   => '__tabs',
		'type' => 'tabs',
		'tabs' => $tabs_setting
	) );
}
Preview

metabox-horizontal metabox-horizontal

Example options page

add_action( 'cmb2_admin_init', 'example_options_page_metabox' );
function example_options_page_metabox() {
	$box_options = array(
		'id'          => 'myprefix_option_metabox',
		'title'       => __( 'Example tabs', 'cmb2' ),
		'show_names'  => true,
		'object_type' => 'options-page',
		'show_on'     => array(
			// These are important, don't remove
			'key'   => 'options-page',
			'value' => array( 'myprefix_options' )
		),
	);

	// Setup meta box
	$cmb = new_cmb2_box( $box_options );

	// setting tabs
	$tabs_setting = array(
		'config' => $box_options,
		//		'layout' => 'vertical', // Default : horizontal
		'tabs'   => array()
	);

	$tabs_setting['tabs'][] = array(
		'id'     => 'tab1',
		'title'  => __( 'Tab 1', 'cmb2' ),
		'fields' => array(
			array(
				'name' => __( 'Title', 'cmb2' ),
				'id'   => 'header_title',
				'type' => 'text'
			),
			array(
				'name' => __( 'Subtitle', 'cmb2' ),
				'id'   => 'header_subtitle',
				'type' => 'text'
			),
			array(
				'name'    => __( 'Background image', 'cmb2' ),
				'id'      => 'header_background',
				'type'    => 'file',
				'options' => array(
					'url' => false
				)
			)
		)
	);
	$tabs_setting['tabs'][] = array(
		'id'     => 'tab2',
		'title'  => __( 'Tab 2', 'cmb2' ),
		'fields' => array(
			array(
				'name' => __( 'Title', 'cmb2' ),
				'id'   => 'review_title',
				'type' => 'text'
			),
			array(
				'name' => __( 'Subtitle', 'cmb2' ),
				'id'   => 'review_subtitle',
				'type' => 'text'
			),
			array(
				'id'      => 'reviews',
				'type'    => 'group',
				'options' => array(
					'group_title'   => __( 'Review {#}', 'cmb2' ),
					'add_button'    => __( 'Add review', 'cmb2' ),
					'remove_button' => __( 'Remove review', 'cmb2' ),
					'sortable'      => false
				),
				'fields'  => array(
					array(
						'name' => __( 'Author name', 'cmb2' ),
						'id'   => 'name',
						'type' => 'text'
					),
					array(
						'name'    => __( 'Author avatar', 'cmb2' ),
						'id'      => 'avatar',
						'type'    => 'file',
						'options' => array(
							'url' => false
						)
					),
					array(
						'name' => __( 'Comment', 'cmb2' ),
						'id'   => 'comment',
						'type' => 'textarea'
					)
				)
			)
		)
	);

	$cmb->add_field( array(
		'id'   => '__tabs',
		'type' => 'tabs',
		'tabs' => $tabs_setting
	) );
}
Preview

options-page-horizontal options-page-vertical

License

cmb2-tabs is an open source project that is licensed under the MIT license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].