Version Description
- Included print stylesheet as a separate file
Download this release
Release Info
Developer | numeeja |
Plugin | Tabby Responsive Tabs |
Version | 1.2.2 |
Comparing to | |
See all releases |
Code changes from version 1.2.1 to 1.2.2
- css/tabby-print.css +29 -0
- css/tabby.css +13 -37
- readme.txt +26 -16
- tabby-responsive-tabs.php +35 -13
css/tabby-print.css
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
@media print {
|
2 |
+
|
3 |
+
.noprint,
|
4 |
+
.responsive-tabs .responsive-tabs__list {
|
5 |
+
display: none;
|
6 |
+
}
|
7 |
+
|
8 |
+
.responsive-tabs h2.tabtitle {
|
9 |
+
display: block!important;
|
10 |
+
}
|
11 |
+
|
12 |
+
.responsive-tabs .responsive-tabs__heading {
|
13 |
+
background: none;
|
14 |
+
border: none;
|
15 |
+
display: block;
|
16 |
+
font-size: 22px;
|
17 |
+
font-weight: bold;
|
18 |
+
text-transform: inherit;
|
19 |
+
margin: 0!important;
|
20 |
+
padding: 10px 0 0;
|
21 |
+
}
|
22 |
+
|
23 |
+
.responsive-tabs .responsive-tabs__panel {
|
24 |
+
display: block!important;
|
25 |
+
background: none;
|
26 |
+
border: none;
|
27 |
+
padding: 0;
|
28 |
+
}
|
29 |
+
}
|
css/tabby.css
CHANGED
@@ -38,7 +38,7 @@
|
|
38 |
.responsive-tabs ul.responsive-tabs__list {
|
39 |
font-size: 18px;
|
40 |
line-height: 18px;
|
41 |
-
margin: 20px 0 0 12px;
|
42 |
padding: 0;
|
43 |
}
|
44 |
|
@@ -76,7 +76,7 @@
|
|
76 |
background: transparent;
|
77 |
}
|
78 |
|
79 |
-
.responsive-tabs .responsive-tabs__list__item--active,
|
80 |
.responsive-tabs .responsive-tabs__list__item--active:hover {
|
81 |
background: #fff;
|
82 |
border-color: #ddd;
|
@@ -87,7 +87,7 @@
|
|
87 |
top: 1px;
|
88 |
}
|
89 |
|
90 |
-
.responsive-tabs .responsive-tabs__panel {
|
91 |
background: #fff;
|
92 |
border: 1px solid #ddd;
|
93 |
border-top: 1px solid #ddd;
|
@@ -103,10 +103,10 @@
|
|
103 |
word-wrap: break-word;
|
104 |
}
|
105 |
|
106 |
-
.responsive-tabs .responsive-tabs__panel:after {
|
107 |
content: "";
|
108 |
-
display: block;
|
109 |
-
height: 0;
|
110 |
clear: both;
|
111 |
}
|
112 |
|
@@ -122,16 +122,16 @@
|
|
122 |
.responsive-tabs .responsive-tabs__list {
|
123 |
display: none;
|
124 |
}
|
125 |
-
|
126 |
.responsive-tabs .responsive-tabs__heading {
|
127 |
display: block;
|
128 |
cursor: pointer;
|
129 |
}
|
130 |
|
131 |
-
.responsive-tabs-wrapper {
|
132 |
border-top: 1px solid #ccc;
|
133 |
}
|
134 |
-
|
135 |
.responsive-tabs .responsive-tabs__heading {
|
136 |
background: #fff;
|
137 |
border: 1px solid #ccc;
|
@@ -160,16 +160,16 @@
|
|
160 |
position: absolute;
|
161 |
right: 20px;
|
162 |
top: 20px;
|
163 |
-
height: 0;
|
164 |
-
width: 0;
|
165 |
}
|
166 |
|
167 |
.responsive-tabs .responsive-tabs__heading:hover {
|
168 |
background: #eee;
|
169 |
color: #777;
|
170 |
}
|
171 |
-
|
172 |
-
.responsive-tabs .responsive-tabs__heading:hover:after {
|
173 |
border-top: 6px solid #777;
|
174 |
}
|
175 |
|
@@ -197,28 +197,4 @@
|
|
197 |
padding: 0 20px;
|
198 |
padding-top: 20px;
|
199 |
}
|
200 |
-
}
|
201 |
-
|
202 |
-
@media print {
|
203 |
-
.responsive-tabs .responsive-tabs__list {
|
204 |
-
display: none;
|
205 |
-
}
|
206 |
-
|
207 |
-
.responsive-tabs .responsive-tabs__heading {
|
208 |
-
background: none;
|
209 |
-
border: none;
|
210 |
-
display: block;
|
211 |
-
font-size: 22px;
|
212 |
-
font-weight: bold;
|
213 |
-
text-transform: inherit;
|
214 |
-
margin: 0!important;
|
215 |
-
padding: 10px 0 0;
|
216 |
-
}
|
217 |
-
|
218 |
-
.responsive-tabs .responsive-tabs__panel {
|
219 |
-
display: block!important;
|
220 |
-
background: none;
|
221 |
-
border: none;
|
222 |
-
padding: 0;
|
223 |
-
}
|
224 |
}
|
38 |
.responsive-tabs ul.responsive-tabs__list {
|
39 |
font-size: 18px;
|
40 |
line-height: 18px;
|
41 |
+
margin: 20px 0 0 12px;
|
42 |
padding: 0;
|
43 |
}
|
44 |
|
76 |
background: transparent;
|
77 |
}
|
78 |
|
79 |
+
.responsive-tabs .responsive-tabs__list__item--active,
|
80 |
.responsive-tabs .responsive-tabs__list__item--active:hover {
|
81 |
background: #fff;
|
82 |
border-color: #ddd;
|
87 |
top: 1px;
|
88 |
}
|
89 |
|
90 |
+
.responsive-tabs .responsive-tabs__panel {
|
91 |
background: #fff;
|
92 |
border: 1px solid #ddd;
|
93 |
border-top: 1px solid #ddd;
|
103 |
word-wrap: break-word;
|
104 |
}
|
105 |
|
106 |
+
.responsive-tabs .responsive-tabs__panel:after {
|
107 |
content: "";
|
108 |
+
display: block;
|
109 |
+
height: 0;
|
110 |
clear: both;
|
111 |
}
|
112 |
|
122 |
.responsive-tabs .responsive-tabs__list {
|
123 |
display: none;
|
124 |
}
|
125 |
+
|
126 |
.responsive-tabs .responsive-tabs__heading {
|
127 |
display: block;
|
128 |
cursor: pointer;
|
129 |
}
|
130 |
|
131 |
+
.responsive-tabs-wrapper {
|
132 |
border-top: 1px solid #ccc;
|
133 |
}
|
134 |
+
|
135 |
.responsive-tabs .responsive-tabs__heading {
|
136 |
background: #fff;
|
137 |
border: 1px solid #ccc;
|
160 |
position: absolute;
|
161 |
right: 20px;
|
162 |
top: 20px;
|
163 |
+
height: 0;
|
164 |
+
width: 0;
|
165 |
}
|
166 |
|
167 |
.responsive-tabs .responsive-tabs__heading:hover {
|
168 |
background: #eee;
|
169 |
color: #777;
|
170 |
}
|
171 |
+
|
172 |
+
.responsive-tabs .responsive-tabs__heading:hover:after {
|
173 |
border-top: 6px solid #777;
|
174 |
}
|
175 |
|
197 |
padding: 0 20px;
|
198 |
padding-top: 20px;
|
199 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
200 |
}
|
readme.txt
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
=== Tabby Responsive Tabs ===
|
2 |
Contributors: numeeja
|
3 |
Donate link: http://cubecolour.co.uk/wp
|
4 |
-
Tags:
|
5 |
Requires at least: 3.7
|
6 |
-
Tested up to: 4.
|
7 |
-
Stable tag: 1.2.
|
8 |
License: GPLv2 / MIT
|
9 |
|
10 |
Create responsive tabs inside your posts, pages or custom post content by adding simple shortcodes inside the post editor.
|
@@ -25,6 +25,9 @@ The Tabby Responsive Tabs plugin is designed to be an easy and lightweight way t
|
|
25 |
|
26 |
> The [Tabby Link to Tab](http://cubecolour.co.uk/downloads/tabby-link-to-tab/ "Tabby Link to Tab") add-on provides a simple shortcode to create links to specific tabs which can appear anywhere on the same page as the tabgroup without the page needing to reload.
|
27 |
|
|
|
|
|
|
|
28 |
= Usage: =
|
29 |
|
30 |
There are two shortcodes which should both be used `[tabby]` and `[tabbyending]`
|
@@ -42,8 +45,6 @@ Add a `[tabbyending]` shortcode after the content of the last tab in a tabgroup.
|
|
42 |
|
43 |
`
|
44 |
|
45 |
-
|
46 |
-
|
47 |
[tabby title="First Tab"]
|
48 |
|
49 |
Tabby ipsum dolor sit amet, kitty sunbathe dolor, feed me.
|
@@ -58,8 +59,6 @@ sleep in the sink climb the curtains attack, give me fish.
|
|
58 |
|
59 |
[tabbyending]
|
60 |
|
61 |
-
|
62 |
-
|
63 |
`
|
64 |
|
65 |
*note: To prevent stray paragraph tags being introduced by WordPress's wpautop filter, ensure that you leave a blank line above and below each tabby shortcode and the tabbyending.*
|
@@ -96,7 +95,7 @@ The markup required to show an icon alongside a tab title can be added by using
|
|
96 |
[tabby title="My Tab" icon="cog"]
|
97 |
|
98 |
`
|
99 |
-
This adds a pseudo element before the tab
|
100 |
|
101 |
The [Tabby Responsive Tabs Customiser](http://cubecolour.co.uk/tabby-responsive-tabs-customiser/ "Tabby Responsive Tabs Customiser") plugin can be used to add the Font Awesome files required to display the icons in the tab titles.
|
102 |
|
@@ -141,8 +140,8 @@ You can receive free support for the plugin if you have problems getting it work
|
|
141 |
|
142 |
If you require a greater level of support than can be provided on the plugin support forum on WordPress.org - eg you prefer not to post the url or you require CSS support to fit specific requirements for your site, you can request non-free support via the [paid email support form for cubecolour plugins](http://cubecolour.co.uk/premium-support/ "paid email support form for cubecolour plugins") form.
|
143 |
|
144 |
-
= How can I
|
145 |
-
These
|
146 |
|
147 |
|
148 |
= Pasted-in shortcodes aren't working or the tabs have a 'stepped' appearance =
|
@@ -150,15 +149,15 @@ If you are copying & pasting the example shortcodes into the visual editor and t
|
|
150 |
|
151 |
= Where is the plugin's admin page? =
|
152 |
|
153 |
-
There isn't one. This is a lightweight plugin with no options. If you want to be able to
|
154 |
|
155 |
-
= Does
|
156 |
|
157 |
Yes - it should work with any well-coded responsive theme.
|
158 |
|
159 |
= Does it work with non-responsive Themes? =
|
160 |
|
161 |
-
The plugin should also work with non-responsive Themes, however this is not really recommended; if you are using a non-responsive theme the tabs
|
162 |
|
163 |
= Does it work with a multisite installation of WordPress? =
|
164 |
|
@@ -173,7 +172,7 @@ If you prefer to use a settings page in your WordPress admin to set a custom tab
|
|
173 |
|
174 |
= Can I change the responsive breakpoint from the default 767px? =
|
175 |
|
176 |
-
Yes, you
|
177 |
|
178 |
This value can also be set using the Tabby Responsive Tabs Customiser plugin's admin panel.
|
179 |
|
@@ -250,7 +249,7 @@ If you like Tabby Responsive Tabs, you may like some of my other plugins in the
|
|
250 |
|
251 |
= Who or what is cubecolour? =
|
252 |
|
253 |
-
My name is Michael Atkins. Cubecolour is the name of my web design and development business in South London where I work with businesses, organisations and individuals to build and support their websites using WordPress. I enjoy attending local WordCamps and WordPress meetups. I have used WordPress since 2007 and I am a moderator on the WordPress.org forums. When I'm not sitting in front of my MacBook I can usually be found playing bass or ukulele.
|
254 |
|
255 |
= Why do you spell the word 'color' incorrectly? =
|
256 |
|
@@ -280,7 +279,6 @@ For more details please see: [Tabby Link to Tab plugin](http://cubecolour.co.uk/
|
|
280 |
|
281 |
These cost 19GBP each for use on a single site. A developer option for each is also available or 99GBP which can be used on all the sites you own or control.
|
282 |
|
283 |
-
|
284 |
== Other Notes ==
|
285 |
|
286 |
The plugin is licenced under [GNU GPLv2](http://opensource.org/licenses/GPL-2.0 "GNU GPLv2"), however as the original responsive tabs script was [hosted at codepen as a public pen](http://blog.codepen.io/legal/licensing/ "hosted at codepen as a public pen"), the GPL compatible [MIT license](http://opensource.org/licenses/MIT "MIT license") applies to that component.
|
@@ -293,6 +291,10 @@ The plugin is licenced under [GNU GPLv2](http://opensource.org/licenses/GPL-2.0
|
|
293 |
|
294 |
== Changelog ==
|
295 |
|
|
|
|
|
|
|
|
|
296 |
= 1.2.1 =
|
297 |
|
298 |
* Added index.php to prevent the content of plugin directories being viewed if the site has not had directory browsing disallowed.
|
@@ -332,6 +334,14 @@ The plugin is licenced under [GNU GPLv2](http://opensource.org/licenses/GPL-2.0
|
|
332 |
|
333 |
== Upgrade Notice ==
|
334 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
335 |
= 1.2.0 =
|
336 |
|
337 |
* Added print styles to default stylesheet
|
1 |
=== Tabby Responsive Tabs ===
|
2 |
Contributors: numeeja
|
3 |
Donate link: http://cubecolour.co.uk/wp
|
4 |
+
Tags: tabs, tab, responsive, accordion, shortcode
|
5 |
Requires at least: 3.7
|
6 |
+
Tested up to: 4.4
|
7 |
+
Stable tag: 1.2.2
|
8 |
License: GPLv2 / MIT
|
9 |
|
10 |
Create responsive tabs inside your posts, pages or custom post content by adding simple shortcodes inside the post editor.
|
25 |
|
26 |
> The [Tabby Link to Tab](http://cubecolour.co.uk/downloads/tabby-link-to-tab/ "Tabby Link to Tab") add-on provides a simple shortcode to create links to specific tabs which can appear anywhere on the same page as the tabgroup without the page needing to reload.
|
27 |
|
28 |
+
> The [Tabby Tab to URL Link](http://cubecolour.co.uk/downloads/tabby-tab-to-url-link/ "Tabby Tab to URL Link") add-on enables you to set one or more of your tabs to act as a link to any URL.
|
29 |
+
|
30 |
+
> The [Tabby Load Accordion Closed](http://cubecolour.co.uk/downloads/tabby-load-accordion-closed/ "Tabby Load Accordion Closed") add-on changes the default behaviour when the tabs are displayed as an accordion so no accordion sections are open when the page initially loads.
|
31 |
= Usage: =
|
32 |
|
33 |
There are two shortcodes which should both be used `[tabby]` and `[tabbyending]`
|
45 |
|
46 |
`
|
47 |
|
|
|
|
|
48 |
[tabby title="First Tab"]
|
49 |
|
50 |
Tabby ipsum dolor sit amet, kitty sunbathe dolor, feed me.
|
59 |
|
60 |
[tabbyending]
|
61 |
|
|
|
|
|
62 |
`
|
63 |
|
64 |
*note: To prevent stray paragraph tags being introduced by WordPress's wpautop filter, ensure that you leave a blank line above and below each tabby shortcode and the tabbyending.*
|
95 |
[tabby title="My Tab" icon="cog"]
|
96 |
|
97 |
`
|
98 |
+
This adds a pseudo element before the tab title with the classes "fa" and "fa-cog". Other icon font sets can be used if you ensure the CSS rules target the classes added by the plugin.
|
99 |
|
100 |
The [Tabby Responsive Tabs Customiser](http://cubecolour.co.uk/tabby-responsive-tabs-customiser/ "Tabby Responsive Tabs Customiser") plugin can be used to add the Font Awesome files required to display the icons in the tab titles.
|
101 |
|
140 |
|
141 |
If you require a greater level of support than can be provided on the plugin support forum on WordPress.org - eg you prefer not to post the url or you require CSS support to fit specific requirements for your site, you can request non-free support via the [paid email support form for cubecolour plugins](http://cubecolour.co.uk/premium-support/ "paid email support form for cubecolour plugins") form.
|
142 |
|
143 |
+
= How can I remove extra paragraph tags which appear at the beginning or end of the tab content? =
|
144 |
+
These extra tags are often be added by WordPress's wpautop function. It is recommended to leave a blank line before and after each tabby shortcode to prevent these from appearing.
|
145 |
|
146 |
|
147 |
= Pasted-in shortcodes aren't working or the tabs have a 'stepped' appearance =
|
149 |
|
150 |
= Where is the plugin's admin page? =
|
151 |
|
152 |
+
There isn't one. This is a lightweight plugin with no options. If you want to be able to customise your tabs using an admin page, the [Tabby Responsive Tabs Customiser plugin](http://cubecolour.co.uk/tabby-responsive-tabs-customiser/ "Tabby Responsive Tabs Customiser plugin") is available.
|
153 |
|
154 |
+
= Does this plugin work with responsive Themes? =
|
155 |
|
156 |
Yes - it should work with any well-coded responsive theme.
|
157 |
|
158 |
= Does it work with non-responsive Themes? =
|
159 |
|
160 |
+
The plugin should also work with non-responsive Themes, however this is not really recommended; if you are using a non-responsive theme the tabs may not switch to an accordion display on a mobile device.
|
161 |
|
162 |
= Does it work with a multisite installation of WordPress? =
|
163 |
|
172 |
|
173 |
= Can I change the responsive breakpoint from the default 767px? =
|
174 |
|
175 |
+
Yes, you can see where that is set in the plugin's CSS. Refer to the answer above about using custom css to use a custom value.
|
176 |
|
177 |
This value can also be set using the Tabby Responsive Tabs Customiser plugin's admin panel.
|
178 |
|
249 |
|
250 |
= Who or what is cubecolour? =
|
251 |
|
252 |
+
My name is Michael Atkins. Cubecolour is the name of my web design and development business in South London where I work with businesses, organisations and individuals to build and support their websites using WordPress. I enjoy attending local WordCamps and WordPress meetups. I have used WordPress since 2007 and I am a moderator on the WordPress.org support forums. When I'm not sitting in front of my MacBook I can usually be found playing bass or ukulele.
|
253 |
|
254 |
= Why do you spell the word 'color' incorrectly? =
|
255 |
|
279 |
|
280 |
These cost 19GBP each for use on a single site. A developer option for each is also available or 99GBP which can be used on all the sites you own or control.
|
281 |
|
|
|
282 |
== Other Notes ==
|
283 |
|
284 |
The plugin is licenced under [GNU GPLv2](http://opensource.org/licenses/GPL-2.0 "GNU GPLv2"), however as the original responsive tabs script was [hosted at codepen as a public pen](http://blog.codepen.io/legal/licensing/ "hosted at codepen as a public pen"), the GPL compatible [MIT license](http://opensource.org/licenses/MIT "MIT license") applies to that component.
|
291 |
|
292 |
== Changelog ==
|
293 |
|
294 |
+
= 1.2.2 =
|
295 |
+
|
296 |
+
* Included print stylesheet as a separate file
|
297 |
+
|
298 |
= 1.2.1 =
|
299 |
|
300 |
* Added index.php to prevent the content of plugin directories being viewed if the site has not had directory browsing disallowed.
|
334 |
|
335 |
== Upgrade Notice ==
|
336 |
|
337 |
+
= 1.2.2 =
|
338 |
+
|
339 |
+
* Included print stylesheet as a separate file
|
340 |
+
|
341 |
+
= 1.2.1 =
|
342 |
+
|
343 |
+
* Added index.php to prevent the content of plugin directories being viewed if the site has not had directory browsing disallowed.
|
344 |
+
|
345 |
= 1.2.0 =
|
346 |
|
347 |
* Added print styles to default stylesheet
|
tabby-responsive-tabs.php
CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Tabby Responsive Tabs
|
|
4 |
Plugin URI: http://cubecolour.co.uk/tabby-responsive-tabs
|
5 |
Description: Create responsive tabs inside your posts, pages or custom post types by adding simple shortcodes. An easy to use admin page can be added to customise the tab styles with the optional Tabby Responsive Tabs Customiser add-on plugin.
|
6 |
Author: cubecolour
|
7 |
-
Version: 1.2.
|
8 |
Author URI: http://cubecolour.co.uk
|
9 |
|
10 |
Tabby Responsive Tabs WordPress plugin Copyright 2013-2015 Michael Atkins
|
@@ -116,16 +116,27 @@ function cc_tabby_meta_links( $links, $file ) {
|
|
116 |
// Alternatively use the tabby responsive tabs customiser plugin
|
117 |
// available from from http:cubecolour.co.uk/tabby-responsive-tabs-customiser
|
118 |
//
|
119 |
-
// Note: wp_print_styles has been deprecated since WP v3.3, so in a future version of this plugin this
|
120 |
-
// add_action( 'wp_enqueue_scripts', 'cc_tabby_css'
|
|
|
|
|
|
|
121 |
// ==============================================
|
122 |
|
|
|
123 |
function cc_tabby_css() {
|
124 |
-
|
125 |
}
|
126 |
|
127 |
add_action('wp_print_styles', 'cc_tabby_css', 30);
|
128 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
129 |
// ==============================================
|
130 |
// Trigger the script if it has not already been triggered on the page
|
131 |
// ==============================================
|
@@ -148,17 +159,17 @@ function cc_tabbytrigger() {
|
|
148 |
|
149 |
function cc_shortcode_tabby( $atts, $content = null ) {
|
150 |
|
151 |
-
// initialise $firsttab flag so we can tell whether we are building the first tab
|
152 |
|
153 |
-
global $reset_firsttab_flag;
|
154 |
-
static $firsttab = TRUE;
|
155 |
|
156 |
-
if ($GLOBALS["reset_firsttab_flag"] === TRUE) {
|
157 |
-
|
158 |
-
|
159 |
-
}
|
160 |
|
161 |
-
// extract title & whether open
|
162 |
extract(shortcode_atts(array(
|
163 |
"title" => '',
|
164 |
"open" => '',
|
@@ -178,6 +189,10 @@ if ($GLOBALS["reset_firsttab_flag"] === TRUE) {
|
|
178 |
// Set Tab Panel Class - add active class if the open attribute is set or the target url parameter matches the dashed version of the tab title
|
179 |
$tabcontentclass = "tabcontent";
|
180 |
|
|
|
|
|
|
|
|
|
181 |
if ( ( $open ) || ( isset( $urltarget ) && ( $urltarget == $tabtarget ) ) ) {
|
182 |
$tabcontentclass .= " responsive-tabs__panel--active";
|
183 |
}
|
@@ -213,6 +228,13 @@ add_shortcode('tabby', 'cc_shortcode_tabby');
|
|
213 |
|
214 |
function cc_shortcode_tabbyending( $atts, $content = null ) {
|
215 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
216 |
wp_enqueue_script('tabby', plugins_url('js/tabby.js', __FILE__), array('jquery'), cc_tabby_plugin_version(), true);
|
217 |
|
218 |
add_action('wp_footer', 'cc_tabbytrigger', 20);
|
@@ -225,4 +247,4 @@ function cc_shortcode_tabbyending( $atts, $content = null ) {
|
|
225 |
return '</div></div>';
|
226 |
}
|
227 |
|
228 |
-
add_shortcode('tabbyending', 'cc_shortcode_tabbyending');
|
4 |
Plugin URI: http://cubecolour.co.uk/tabby-responsive-tabs
|
5 |
Description: Create responsive tabs inside your posts, pages or custom post types by adding simple shortcodes. An easy to use admin page can be added to customise the tab styles with the optional Tabby Responsive Tabs Customiser add-on plugin.
|
6 |
Author: cubecolour
|
7 |
+
Version: 1.2.2
|
8 |
Author URI: http://cubecolour.co.uk
|
9 |
|
10 |
Tabby Responsive Tabs WordPress plugin Copyright 2013-2015 Michael Atkins
|
116 |
// Alternatively use the tabby responsive tabs customiser plugin
|
117 |
// available from from http:cubecolour.co.uk/tabby-responsive-tabs-customiser
|
118 |
//
|
119 |
+
// Note: wp_print_styles has been deprecated since WP v3.3, so in a future version of this plugin this may be replaced with:
|
120 |
+
// add_action( 'wp_enqueue_scripts', 'cc_tabby_css' );
|
121 |
+
// However not breaking backwards compatibility for existing users is currently more important
|
122 |
+
|
123 |
+
// Print styles now added separately and only to pages with at least one tab group
|
124 |
// ==============================================
|
125 |
|
126 |
+
//Screen Styles
|
127 |
function cc_tabby_css() {
|
128 |
+
wp_register_style( 'tabby', plugins_url( '/css/tabby.css' , __FILE__ ), '', cc_tabby_plugin_version() );
|
129 |
}
|
130 |
|
131 |
add_action('wp_print_styles', 'cc_tabby_css', 30);
|
132 |
|
133 |
+
//Print Styles
|
134 |
+
function cc_tabby_register_print_css() {
|
135 |
+
wp_register_style( 'tabby-print', plugins_url( '/css/tabby-print.css' , __FILE__ ), '', cc_tabby_plugin_version() );
|
136 |
+
}
|
137 |
+
|
138 |
+
add_action('wp_enqueue_scripts', 'cc_tabby_register_print_css');
|
139 |
+
|
140 |
// ==============================================
|
141 |
// Trigger the script if it has not already been triggered on the page
|
142 |
// ==============================================
|
159 |
|
160 |
function cc_shortcode_tabby( $atts, $content = null ) {
|
161 |
|
162 |
+
// initialise $firsttab flag so we can tell whether we are building the first tab
|
163 |
|
164 |
+
global $reset_firsttab_flag;
|
165 |
+
static $firsttab = TRUE;
|
166 |
|
167 |
+
if ($GLOBALS["reset_firsttab_flag"] === TRUE) {
|
168 |
+
$firsttab = TRUE;
|
169 |
+
$GLOBALS["reset_firsttab_flag"] = FALSE;
|
170 |
+
}
|
171 |
|
172 |
+
// extract title & whether open
|
173 |
extract(shortcode_atts(array(
|
174 |
"title" => '',
|
175 |
"open" => '',
|
189 |
// Set Tab Panel Class - add active class if the open attribute is set or the target url parameter matches the dashed version of the tab title
|
190 |
$tabcontentclass = "tabcontent";
|
191 |
|
192 |
+
if ( isset( $class ) ) {
|
193 |
+
$tabcontentclass .= " " . $class . "-content";
|
194 |
+
}
|
195 |
+
|
196 |
if ( ( $open ) || ( isset( $urltarget ) && ( $urltarget == $tabtarget ) ) ) {
|
197 |
$tabcontentclass .= " responsive-tabs__panel--active";
|
198 |
}
|
228 |
|
229 |
function cc_shortcode_tabbyending( $atts, $content = null ) {
|
230 |
|
231 |
+
// add screen & print-only styles
|
232 |
+
if ( wp_style_is( 'tabby', $list = 'registered' ) ) {
|
233 |
+
wp_enqueue_style( 'tabby' );
|
234 |
+
}
|
235 |
+
|
236 |
+
wp_enqueue_style( 'tabby-print' );
|
237 |
+
|
238 |
wp_enqueue_script('tabby', plugins_url('js/tabby.js', __FILE__), array('jquery'), cc_tabby_plugin_version(), true);
|
239 |
|
240 |
add_action('wp_footer', 'cc_tabbytrigger', 20);
|
247 |
return '</div></div>';
|
248 |
}
|
249 |
|
250 |
+
add_shortcode('tabbyending', 'cc_shortcode_tabbyending');
|