Skip to content

Instantly share code, notes, and snippets.

@mototeam
Created December 10, 2014 16:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mototeam/1288fe335852623e75b6 to your computer and use it in GitHub Desktop.
Save mototeam/1288fe335852623e75b6 to your computer and use it in GitHub Desktop.
MotoPress Vertical Tabs
<?php
/**
* Plugin Name: MotoPress Vertical Tabs
* Plugin URI: http://www.getmotopress.com/
* Description: Add vertical style to Tabs widget
* Version: 0.1
* Author: MotoPress Team
* Author URI: http://www.getmotopress.com/
* License: GPL2 or later
*/
function mp_vertical_tabs_example($motopressCELibrary) {
$tabsObj = &$motopressCELibrary->getObject('mp_tabs');
if ($tabsObj) {
$styleClasses = &$tabsObj->getStyle('mp_style_classes');
$styleClasses['predefined'] = array(
'type' => array(
'label' => 'Style',
'values' => array(
'vertical' => array(
'class' => 'mpd-tabs-vertical',
'label' => 'Vertical',
),
)
)
);
// remove default selector
unset($styleClasses['selector']);
}
}
add_action('mp_library', 'mp_vertical_tabs_example', 10, 1);
/** add this styles to your theme
.motopress-tabs-obj.mpd-tabs-vertical ul {
float: left;
}
.motopress-tabs-obj.ui-tabs.motopress-tabs-basic.mpd-tabs-vertical .ui-tabs-nav li{
float: none !important;
}
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment