{"id":313,"date":"2011-04-28T09:04:24","date_gmt":"2011-04-28T01:04:24","guid":{"rendered":"http:\/\/lesterchan.net\/wordpress\/?p=313"},"modified":"2011-04-28T09:04:24","modified_gmt":"2011-04-28T01:04:24","slug":"wp-showhide-1-00","status":"publish","type":"post","link":"https:\/\/lesterchan.net\/wordpress\/2011\/04\/28\/wp-showhide-1-00\/","title":{"rendered":"WP-ShowHide 1.00"},"content":{"rendered":"<p>I have created a new plugin, <a href=\"https:\/\/lesterchan.net\/portfolio\/programming\/php\/#wp-showhide\">WP-ShowHide<\/a>. It is a simple plugin (83 lines of codes including comments) with no configuration screen needed.<\/p>\n<p>This new plugin came about when <a href=\"http:\/\/www.mhisham.org\/\">Hisham<\/a> tweeted me about whether there is a &#8220;Show\/Hide Press Release&#8221; WordPress plugin like what <a href=\"http:\/\/www.engadget.com\/\">Engadget<\/a> does when <a href=\"http:\/\/www.engadget.com\/2011\/04\/27\/ipad-2-extends-its-global-reign-of-terror-to-singapore-japan-9\/\">posting a Press Release<\/a>.<\/p>\n<p>I can&#8217;t seem to find it and decided to code one myself using <a href=\"http:\/\/codex.wordpress.org\/Shortcode_API\">WordPress ShortCode API<\/a>. I made the plugin more generic rather than focusing on Press Releases, so you can have multiple Show\/Hide content within a post.<\/p>\n<p>I tested it on WordPress 3.1.1 but technically it should work with any version higher than WordPress 2.5 because ShortCode was introduced in WordPress 2.5. <\/p>\n<p><strong>WP-ShowHide Description<\/strong><\/p>\n<blockquote><p>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 &#8220;Show Content&#8221; link to toggle it. Similar to what Engadget is doing for their press releases.<\/p>\n<p>Example usage: <code>[ showhide type=\"pressrelease\" ]Press Release goes in here.[ \/showhide ]<\/code> (Remove the spaces before and after the square brackets [].)<\/p><\/blockquote>\n<p>Download: <a href=\"http:\/\/downloads.wordpress.org\/plugin\/wp-showhide.zip\">WP-ShowHide 1.00<\/a><br \/>\nDocumentation: <a href=\"http:\/\/wordpress.org\/extend\/plugins\/wp-showhide\/\">WP-ShowHide<\/a><\/p>\n<p><strong>Demostration\/Example Usage<\/strong><br \/>\nRemove the spaces before and after the square brackets [].<\/p>\n<p>Tag: <code>[ showhide ][ \/showhide ]<\/code><br \/>\n<div id=\"pressrelease-link-313\" class=\"sh-link pressrelease-link sh-hide\"><a href=\"#\" onclick=\"showhide_toggle('pressrelease', 313, 'Show Press Release (129 More Words)', 'Hide Press Release (129 Less Words)'); return false;\" aria-expanded=\"false\"><span id=\"pressrelease-toggle-313\">Show Press Release (129 More Words)<\/span><\/a><\/div><div id=\"pressrelease-content-313\" class=\"sh-content pressrelease-content sh-hide\" style=\"display: none;\"><br \/>\nlesterchan.net is the blog and portfolio site of Lester Chan who is also the author of many popular WordPress plugins like WP-Polls and WP-PageNavi.<\/p>\n<p>For the blog section, it is updated on a regular basis from topics ranging from gadgets to technology and even current affairs in Singapore<\/p>\n<p>For the portfolio section, it features the resume as well as the WordPress plugins page.<\/p>\n<p>lesterchan.net showcase how extensible WordPress can be in terms of themes and plugins.<\/p>\n<p>For themes, the sidebar can be switch to either the left or right side and the preference will be save into the browser cookie so that in future visit, it will display the menu on your prefered side.<\/p>\n<p>For plugins, there is the gallery page over at https:\/\/lesterchan.net\/gallery\/ which implements basic gallery features such as category and pagination.<br \/>\n<\/div><\/p>\n<p>Tag: <code>[ showhide type=\"links\" more_text=\"Show Links (%s More Words)\" less_text=\"Hide Links (%s More Words)\" ][ \/showhide ]<\/code><br \/>\n<div id=\"links-link-313\" class=\"sh-link links-link sh-hide\"><a href=\"#\" onclick=\"showhide_toggle('links', 313, 'Show Links (9 More Words)', 'Hide Links (9 More Words)'); return false;\" aria-expanded=\"false\"><span id=\"links-toggle-313\">Show Links (9 More Words)<\/span><\/a><\/div><div id=\"links-content-313\" class=\"sh-content links-content sh-hide\" style=\"display: none;\"><br \/>\nOfficial Links: <a href=\"https:\/\/lesterchan.net\">lesterchan.net<\/a><br \/>\nOfficial Links #1: <a href=\"https:\/\/lesterchan.net\">lesterchan.net<\/a><br \/>\nOfficial Links #2: <a href=\"https:\/\/lesterchan.net\">lesterchan.net<\/a><br \/>\n<\/div><\/p>\n<p>Tag: <code>[ showhide type=\"visibility\" hidden=\"no\" more_text=\"Show Visibility Content (%s More Words)\" less_text=\"Hide Visibility Content (%s More Words)\" ][ \/showhide ]<\/code><br \/>\n<div id=\"visibility-link-313\" class=\"sh-link visibility-link sh-show\"><a href=\"#\" onclick=\"showhide_toggle('visibility', 313, 'Hide Visibility Content (14 More Words)', 'Show Visibility Content (14 More Words)'); return false;\" aria-expanded=\"true\"><span id=\"visibility-toggle-313\">Hide Visibility Content (14 More Words)<\/span><\/a><\/div><div id=\"visibility-content-313\" class=\"sh-content visibility-content sh-show\" style=\"display: block;\"><br \/>\nThe visibility of this content is set to display by default instead of hidden.<br \/>\n<\/div><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have created a new plugin, WP-ShowHide. It is a simple plugin (83 lines of codes including comments) with no configuration screen needed. This new plugin came about when Hisham tweeted me about whether there is a &#8220;Show\/Hide Press Release&#8221; WordPress plugin like what Engadget does when posting a Press Release. I can&#8217;t seem to &hellip; <a href=\"https:\/\/lesterchan.net\/wordpress\/2011\/04\/28\/wp-showhide-1-00\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;WP-ShowHide 1.00&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[129],"tags":[],"class_list":["post-313","post","type-post","status-publish","format-standard","hentry","category-wp-showhide"],"views":31428,"_links":{"self":[{"href":"https:\/\/lesterchan.net\/wordpress\/wp-json\/wp\/v2\/posts\/313","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lesterchan.net\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lesterchan.net\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lesterchan.net\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lesterchan.net\/wordpress\/wp-json\/wp\/v2\/comments?post=313"}],"version-history":[{"count":0,"href":"https:\/\/lesterchan.net\/wordpress\/wp-json\/wp\/v2\/posts\/313\/revisions"}],"wp:attachment":[{"href":"https:\/\/lesterchan.net\/wordpress\/wp-json\/wp\/v2\/media?parent=313"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lesterchan.net\/wordpress\/wp-json\/wp\/v2\/categories?post=313"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lesterchan.net\/wordpress\/wp-json\/wp\/v2\/tags?post=313"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}