WP-ShowHide - Version 1.02

Version Description

N/A

Download this release

Release Info

Developer GamerZ
Plugin Icon WP-ShowHide
Version 1.02
Comparing to
See all releases

Code changes from version 1.01 to 1.02

Files changed (2) hide show
  1. readme.txt +11 -8
  2. wp-showhide.php +5 -5
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://lesterchan.net/site/donation/
4
  Tags: show, hide, content, visibility, press release, toggle
5
  Requires at least: 3.0
6
  Tested up to: 3.9
7
- Stable tag: 1.01
8
 
9
  Allows you to embed content within your blog post via WordPress ShortCode API and toggling the visibility of the cotent via a link.
10
 
@@ -29,8 +29,11 @@ By default the content is hidden and user will have to click on the "Show Conten
29
 
30
  == Changelog ==
31
 
 
 
 
32
  = Version 1.01 =
33
- * NEW: Added additional "show" or "hide" class to the link and content depending on the visiblity of the content to allow more precise CSS styling.
34
 
35
  = Version 1.00 (01-05-2011) =
36
  * FIXED: Initial Release
@@ -55,22 +58,22 @@ By default the content is hidden and user will have to click on the "Show Conten
55
 
56
  1. You can style the content via CSS that is generated by the plugin. Here is a sample of the generated HTML. Note that pressrelease is the default type.
57
  <code>
58
- &lt;div id="pressrelease-link-1" class="pressrelease-link hide"&gt;
59
  &nbsp;&nbsp;&lt;a href="#"&gt;
60
  &nbsp;&nbsp;&nbsp;&nbsp;&lt;span id="pressrelease-toggle-1"&gt;Show Press Release (4 More Words)&lt;/span&gt;
61
  &nbsp;&nbsp;&lt;/a&gt;
62
  &lt;/div&gt;
63
- &lt;div id="pressrelease-content-1" class="pressrelease-content hide" style="display: none;"&gt;Content&lt;/div&gt;
64
  </code>
65
 
66
  2. With the example above, here are the following styles you can use in your CSS:
67
  <code>
68
  .pressrelease-link { }
69
- .pressrelease-link.hide A { }
70
- .pressrelease-link.show A { }
71
  .pressrelease-content { }
72
- .pressrelease-content.hide { }
73
- .pressrelease-content.show { }
74
  </code>
75
 
76
  == Upgrading ==
4
  Tags: show, hide, content, visibility, press release, toggle
5
  Requires at least: 3.0
6
  Tested up to: 3.9
7
+ Stable tag: 1.02
8
 
9
  Allows you to embed content within your blog post via WordPress ShortCode API and toggling the visibility of the cotent via a link.
10
 
29
 
30
  == Changelog ==
31
 
32
+ = Version 1.02 =
33
+ * FIXED: Some theme uses `.hide` as `display: none` and hence I have changed `.show` to `.sh-show` and `.hide` to `.sh-hide` to advoid conflicts.
34
+
35
  = Version 1.01 =
36
+ * NEW: Added additional `show` or `hide` class to the link and content depending on the visiblity of the content to allow more precise CSS styling.
37
 
38
  = Version 1.00 (01-05-2011) =
39
  * FIXED: Initial Release
58
 
59
  1. You can style the content via CSS that is generated by the plugin. Here is a sample of the generated HTML. Note that pressrelease is the default type.
60
  <code>
61
+ &lt;div id="pressrelease-link-1" class="pressrelease-link sh-hide"&gt;
62
  &nbsp;&nbsp;&lt;a href="#"&gt;
63
  &nbsp;&nbsp;&nbsp;&nbsp;&lt;span id="pressrelease-toggle-1"&gt;Show Press Release (4 More Words)&lt;/span&gt;
64
  &nbsp;&nbsp;&lt;/a&gt;
65
  &lt;/div&gt;
66
+ &lt;div id="pressrelease-content-1" class="pressrelease-content sh-hide" style="display: none;"&gt;Content&lt;/div&gt;
67
  </code>
68
 
69
  2. With the example above, here are the following styles you can use in your CSS:
70
  <code>
71
  .pressrelease-link { }
72
+ .pressrelease-link.sh-hide A { }
73
+ .pressrelease-link.sh-show A { }
74
  .pressrelease-content { }
75
+ .pressrelease-content.sh-hide { }
76
+ .pressrelease-content.sh-show { }
77
  </code>
78
 
79
  == Upgrading ==
wp-showhide.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: WP-ShowHide
4
  Plugin URI: http://lesterchan.net/portfolio/programming/php/
5
  Description: Allows you to embed content within your blog post via WordPress ShortCode API and toggling the visibility of the cotent via a link. By default the content is hidden and user will have to click on the "Show Content" link to toggle it. Similar to what Engadget is doing for their press releases. Example usage: <code>[showhide type="pressrelease"]Press Release goes in here.[/showhide]</code>
6
- Version: 1.01
7
  Author: Lester 'GaMerZ' Chan
8
  Author URI: http://lesterchan.net
9
  Text Domain: wp-showhide
@@ -56,10 +56,10 @@ function showhide_shortcode($atts, $content = null) {
56
  $less_text = sprintf($less_text, $word_count);
57
 
58
  // Determine Whether To Show Or Hide Press Release
59
- $hidden_class = 'hide';
60
  $hidden_css = 'display: none;';
61
  if($hidden == 'no') {
62
- $hidden_class = 'show';
63
  $hidden_css = 'display: block;';
64
  $tmp_text = $more_text;
65
  $more_text = $less_text;
@@ -84,7 +84,7 @@ function showhide_footer() {
84
  var $link = jQuery("#"+ type + "-link-" + post_id)
85
  , $content = jQuery("#"+ type + "-content-" + post_id)
86
  , $toggle = jQuery("#"+ type + "-toggle-" + post_id)
87
- , show_hide_class = 'show hide';
88
  $link.toggleClass(show_hide_class);
89
  $content.toggleClass(show_hide_class).toggle();
90
  if($toggle.text() === more_text) {
@@ -95,7 +95,7 @@ function showhide_footer() {
95
  }
96
  </script>
97
  <?php else : ?>
98
- <script type="text/javascript">function showhide_toggle(a,b,c,d){var e=jQuery("#"+a+"-link-"+b),f=jQuery("#"+a+"-content-"+b);a=jQuery("#"+a+"-toggle-"+b);e.toggleClass("show hide");f.toggleClass("show hide").toggle();a.text()===c?a.text(d):a.text(c)};</script>
99
  <?php endif; ?>
100
  <?php
101
  }
3
  Plugin Name: WP-ShowHide
4
  Plugin URI: http://lesterchan.net/portfolio/programming/php/
5
  Description: Allows you to embed content within your blog post via WordPress ShortCode API and toggling the visibility of the cotent via a link. By default the content is hidden and user will have to click on the "Show Content" link to toggle it. Similar to what Engadget is doing for their press releases. Example usage: <code>[showhide type="pressrelease"]Press Release goes in here.[/showhide]</code>
6
+ Version: 1.02
7
  Author: Lester 'GaMerZ' Chan
8
  Author URI: http://lesterchan.net
9
  Text Domain: wp-showhide
56
  $less_text = sprintf($less_text, $word_count);
57
 
58
  // Determine Whether To Show Or Hide Press Release
59
+ $hidden_class = 'sh-hide';
60
  $hidden_css = 'display: none;';
61
  if($hidden == 'no') {
62
+ $hidden_class = 'sh-show';
63
  $hidden_css = 'display: block;';
64
  $tmp_text = $more_text;
65
  $more_text = $less_text;
84
  var $link = jQuery("#"+ type + "-link-" + post_id)
85
  , $content = jQuery("#"+ type + "-content-" + post_id)
86
  , $toggle = jQuery("#"+ type + "-toggle-" + post_id)
87
+ , show_hide_class = 'sh-show sh-hide';
88
  $link.toggleClass(show_hide_class);
89
  $content.toggleClass(show_hide_class).toggle();
90
  if($toggle.text() === more_text) {
95
  }
96
  </script>
97
  <?php else : ?>
98
+ <script type="text/javascript">function showhide_toggle(a,b,c,d){var e=jQuery("#"+a+"-link-"+b),f=jQuery("#"+a+"-content-"+b);a=jQuery("#"+a+"-toggle-"+b);e.toggleClass("sh-show sh-hide");f.toggleClass("sh-show sh-hide").toggle();a.text()===c?a.text(d):a.text(c)};</script>
99
  <?php endif; ?>
100
  <?php
101
  }