Accordion Shortcodes - Version 2.3.2

Version Description

  • Now compatible up to WordPress 4.7
  • FIXED: Accordion titles now truly accessible via keyboard control
Download this release

Release Info

Developer philbuchanan
Plugin Icon 128x128 Accordion Shortcodes
Version 2.3.2
Comparing to
See all releases

Code changes from version 2.3.1 to 2.3.2

Files changed (2) hide show
  1. accordion-shortcodes.php +3 -3
  2. readme.txt +54 -6
accordion-shortcodes.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Plugin Name: Accordion Shortcodes
4
  * Description: Shortcodes for creating responsive accordion drop-downs.
5
- * Version: 2.3.1
6
  * Author: Phil Buchanan
7
  * Author URI: http://philbuchanan.com
8
  */
@@ -17,7 +17,7 @@ class Accordion_Shortcodes {
17
  /**
18
  * Current plugin version number
19
  */
20
- private $plugin_version = '2.3.1';
21
 
22
 
23
 
@@ -292,7 +292,7 @@ class Accordion_Shortcodes {
292
 
293
  $ids = $this->get_accordion_id($id);
294
 
295
- $accordion_title = sprintf('<%1$s id="%3$s" class="accordion-title%5$s" role="tab" aria-controls="%4$s" aria-selected="false" aria-expanded="false"%6$s>%2$s</%1$s>',
296
  $tag ? $this->check_html_tag($tag) : $this->title_tag,
297
  $title ? $title : '<span style="color:red;">' . __('Please enter a title attribute', 'accordion_shortcodes') . '</span>',
298
  $ids['title'],
2
  /**
3
  * Plugin Name: Accordion Shortcodes
4
  * Description: Shortcodes for creating responsive accordion drop-downs.
5
+ * Version: 2.3.2
6
  * Author: Phil Buchanan
7
  * Author URI: http://philbuchanan.com
8
  */
17
  /**
18
  * Current plugin version number
19
  */
20
+ private $plugin_version = '2.3.2';
21
 
22
 
23
 
292
 
293
  $ids = $this->get_accordion_id($id);
294
 
295
+ $accordion_title = sprintf('<%1$s id="%3$s" class="accordion-title%5$s" role="tab" aria-controls="%4$s" aria-selected="false" aria-expanded="false" aria-multiselectable="true" tabindex="0" %6$s>%2$s</%1$s>',
296
  $tag ? $this->check_html_tag($tag) : $this->title_tag,
297
  $title ? $title : '<span style="color:red;">' . __('Please enter a title attribute', 'accordion_shortcodes') . '</span>',
298
  $ids['title'],
readme.txt CHANGED
@@ -4,8 +4,8 @@ Author URI: http://philbuchanan.com/
4
  Donate Link: http://philbuchanan.com/
5
  Tags: accordion, accordions, shortcodes, responsive accordions, accordions plugin, jquery accordions, accordions short-code, accordions plugin wordpress, accordions plugin jquery
6
  Requires at least: 3.3
7
- Tested up to: 4.6
8
- Stable tag: 2.3.1
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -15,7 +15,7 @@ Shortcodes for creating responsive accordion drop-downs.
15
 
16
  Accordion Shortcodes is a simple plugin that adds a few shortcodes for adding accordion drop-downs to your pages.
17
 
18
- The accordions should blend seamlessly with your theme. However, you may want to be able to edit your themes main stylesheet in order to [add some custom styling (CSS)](http://wordpress.org/plugins/accordion-shortcodes/other_notes/#Other-Notes).
19
 
20
  = Features =
21
 
@@ -76,13 +76,13 @@ There are a few [advances settings](http://wordpress.org/plugins/accordion-short
76
  1. Upload the 'accordion-shortcodes' folder to the '/wp-content/plugins/' directory.
77
  2. Activate the plugin through the Plugins menu in WordPress.
78
  3. Add the shortcodes to your content.
79
- 4. Add some [CSS](http://wordpress.org/plugins/accordion-shortcodes/other_notes/#Other-Notes) to your themes stylesheet to make the accordion look the way you want.
80
 
81
  == Frequently Asked Questions ==
82
 
83
  = Why isn't the JavaScript file loading on my site? =
84
 
85
- This is most likely caused by a poorly coded theme. This plugin makes use of the `wp_footer()` function to load the JavaScript file and it's dependancy (jQuery). Check your theme to ensure that the `wp_footer()` function is being called right before the closing `</body>` tag in your themes footer.php file.
86
 
87
  = How can I change the look of the accordion? =
88
 
@@ -96,6 +96,47 @@ Absolutely! You can use any of the WordPress format settings and headings as wel
96
 
97
  You cannot, however nest an accordion within another accordion. This is a limitation of how WordPress processes shortcodes.
98
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
99
  == Other Notes ==
100
 
101
  = Sample CSS =
@@ -198,6 +239,10 @@ For bug reports or feature requests or if you'd like to contribute to the plugin
198
  3. The Accordion Item shortcode insertion dialog box
199
 
200
  == Changelog ==
 
 
 
 
201
  = 2.3.1 =
202
  * Now compatible up to WordPress 4.6
203
  * FIXED: A bug with a deprecated function in jQuery
@@ -251,6 +296,9 @@ FIXED: A bug where setting both scroll and openfirst would scroll the window wit
251
  * FIXED: A few incredibly small bugs/annoyances
252
 
253
  == Upgrade Notice ==
 
 
 
254
  = 2.3.1 =
255
  Fixed a minor bug that could cause warnings in the developer console. Also now compatible up to WordPress 4.6.
256
 
@@ -273,7 +321,7 @@ Fixes a bug where the content editor would break in custom post types.
273
  Fixes a bug introduced in v2.2 when using the scroll and openfirst setting together.
274
 
275
  = 2.2 =
276
- Drastically improved accessibility. New 'read' class added to opened accordion items. Compatibility mode added for themes with the same accordion shortcode names. WordPress 4.2 compatibility.
277
 
278
  = 2.1.1 =
279
  Fixes a few minor issues accidentally introduced in the 2.1 update.
4
  Donate Link: http://philbuchanan.com/
5
  Tags: accordion, accordions, shortcodes, responsive accordions, accordions plugin, jquery accordions, accordions short-code, accordions plugin wordpress, accordions plugin jquery
6
  Requires at least: 3.3
7
+ Tested up to: 4.7
8
+ Stable tag: 2.3.2
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
15
 
16
  Accordion Shortcodes is a simple plugin that adds a few shortcodes for adding accordion drop-downs to your pages.
17
 
18
+ The accordions should blend seamlessly with your theme. However, you may want to be able to edit your theme's main stylesheet in order to [add some custom styling (CSS)](http://wordpress.org/plugins/accordion-shortcodes/other_notes/#Other-Notes).
19
 
20
  = Features =
21
 
76
  1. Upload the 'accordion-shortcodes' folder to the '/wp-content/plugins/' directory.
77
  2. Activate the plugin through the Plugins menu in WordPress.
78
  3. Add the shortcodes to your content.
79
+ 4. Add some [CSS](http://wordpress.org/plugins/accordion-shortcodes/other_notes/#Other-Notes) to your theme's stylesheet to make the accordion look the way you want.
80
 
81
  == Frequently Asked Questions ==
82
 
83
  = Why isn't the JavaScript file loading on my site? =
84
 
85
+ This is most likely caused by a poorly coded theme. This plugin makes use of the `wp_footer()` function to load the JavaScript file and it's dependancy (jQuery). Check your theme to ensure that the `wp_footer()` function is being called right before the closing `</body>` tag in your theme's footer.php file.
86
 
87
  = How can I change the look of the accordion? =
88
 
96
 
97
  You cannot, however nest an accordion within another accordion. This is a limitation of how WordPress processes shortcodes.
98
 
99
+ = How do I accommodate fixed position headers if I'm using `scroll`? =
100
+
101
+ The scroll setting accepts numeric values as well. So, instead of setting `[accordion scroll="true"]`, you can define a pixel offset for the final scroll position like this: `[accordion scroll="50"]`. Set the numeric value to the pixel height of your fixed header.
102
+
103
+ = Is it possible to open/close all accordions with a single button click? =
104
+
105
+ Yes! Although you will need to know some simple code to get it working.
106
+
107
+ In your theme, you'll need to have a Javascript file with the following code:
108
+
109
+ `$('.js-open-everything').click(function() {
110
+ $.each($('.accordion-title'), function(index, value) {
111
+ if (!$(this).hasClass('open')) {
112
+ $(this).trigger('click');
113
+ }
114
+ });
115
+ });`
116
+
117
+ Then, you can add a button to your page:
118
+
119
+ `<button class="js-open-everything">Open Everything</button>`
120
+
121
+ = I have a lot of extra space showing around my accordions (and other shortcodes). How can I remove it? =
122
+
123
+ WordPress automatically adds paragraphs and line breaks to content formatted in the editor, so if your shortcodes aren't formatted just right, you'll see a lot of extra spacing. Putting this function in your theme's functions.php file should fix it:
124
+
125
+ `/**
126
+ * Fixes empty <p> and <br> tags showing before and after shortcodes in the
127
+ * output content.
128
+ */
129
+ function pb_the_content_shortcode_fix($content) {
130
+ $array = array(
131
+ '<p>[' => '[',
132
+ ']</p>' => ']',
133
+ ']<br />' => ']',
134
+ ']<br>' => ']'
135
+ );
136
+ return strtr($content, $array);
137
+ }
138
+ add_filter('the_content', 'pb_the_content_shortcode_fix');`
139
+
140
  == Other Notes ==
141
 
142
  = Sample CSS =
239
  3. The Accordion Item shortcode insertion dialog box
240
 
241
  == Changelog ==
242
+ = 2.3.2 =
243
+ * Now compatible up to WordPress 4.7
244
+ * FIXED: Accordion titles now truly accessible via keyboard control
245
+
246
  = 2.3.1 =
247
  * Now compatible up to WordPress 4.6
248
  * FIXED: A bug with a deprecated function in jQuery
296
  * FIXED: A few incredibly small bugs/annoyances
297
 
298
  == Upgrade Notice ==
299
+ = 2.3.2 =
300
+ You may notice a focus state around your accordion items when clicking them. This is necessary to support accessibility within the plugin. If you really must remove the focus state (though not recommended) you can do so by adding this CSS to your theme's stylesheet: `.accordion-title {outline: none;}`.
301
+
302
  = 2.3.1 =
303
  Fixed a minor bug that could cause warnings in the developer console. Also now compatible up to WordPress 4.6.
304
 
321
  Fixes a bug introduced in v2.2 when using the scroll and openfirst setting together.
322
 
323
  = 2.2 =
324
+ Drastically improved accessibility. New 'read' class added to opened accordion items. Compatibility mode added for theme's with the same accordion shortcode names. WordPress 4.2 compatibility.
325
 
326
  = 2.1.1 =
327
  Fixes a few minor issues accidentally introduced in the 2.1 update.