Changeset 1041057
- Timestamp:
- 12/09/2014 09:07:04 AM (11 years ago)
- Location:
- simple-faqs/trunk
- Files:
-
- 6 added
- 2 edited
-
faq_generator.php (added)
-
readme.txt (modified) (4 diffs)
-
simple-faq-icon.jpg (added)
-
simple-faq.php (modified) (10 diffs)
-
simple_faq_button.js (added)
-
simple_faq_generator.css (added)
-
skins (added)
-
skins/dark.css (added)
Legend:
- Unmodified
- Added
- Removed
-
simple-faqs/trunk/readme.txt
r829004 r1041057 3 3 Tags: FAQ listing 4 4 Requires at least: 3.7.1 5 Tested up to: 3.86 Stable tag: 1.1.45 Tested up to: 4.0.1 6 Stable tag: 2.0 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 13 13 This is a simple plugin to help users put up FAQ lists on their site. Most FAQ plugins only allow a single format (usually the Accordion) format to put up FAQ lists. While that is great there are a number of folks who would rather just have simple bookmark tags to list their Questions at the top and lead to Answers below. This plugin attempts to provide an easy to use solution for such scenarios. 14 14 15 Options available are:15 Options for FAQ 16 16 <ol> 17 17 <li>Accordion (the default option)</li> … … 19 19 <li>Bookmarks (show the questions at the top and lead to the related answer below) - now implements scrolling via LocalScroll jQuery plugin</li> 20 20 </ol> 21 22 Also has options for ordering the FAQ and includes 1 pre-built skin with more coming soon 21 23 22 24 Details and examples about using the plugin are available at <a href="http://speedsoftsol.com/simple-faq-plugin/" target="_blank">speedsoftsol.com/simple-faq-plugin/</a> … … 28 30 29 31 == Frequently Asked Questions == 32 1. What are the different parameters available: 33 style (can be Accordion, Simple, Bookmark) 34 skin (can be none, Dark) 35 order (can be Default, Alpha, Date) 36 category (can be All or any category slug defined in your site) 30 37 38 2. Can we use multiple shortcodes on the same page? 39 Yes that is possible since version 2 of the plugin 31 40 32 41 33 42 == Changelog == 43 = 2.0 = 44 Added shortcode generator 45 Now able to have multiple shortcodes on the same page 46 Added new styling skins 47 Multiple ordering options (by order id, publish date or alphabetical) 34 48 35 = 1.0 = 36 Initial launch 49 = 1.1.4 = 50 Sort out SVN issue 51 52 = 1.1.3 = 53 Add smooth scrolling feature for Bookmark Style FAQ 54 55 = 1.1.2 = 56 Add Back To Top feature for Bookmark Style 57 58 = 1.1.1 59 Show all FAQ without pagination 37 60 38 61 = 1.1 = 39 62 Reset Post Data To avoid conflict with Theme Queries 40 63 41 = 1.1.1 42 Show all FAQ without pagination 43 44 = 1.1.2 = 45 Add Back To Top feature for Bookmark Style 46 47 = 1.1.3 = 48 Add smooth scrolling feature for Bookmark Style FAQ 49 50 = 1.1.4 = 51 Sort out SVN issue 64 = 1.0 = 65 Initial launch -
simple-faqs/trunk/simple-faq.php
r1023806 r1041057 4 4 * Plugin URI: http://wordpress.org/plugins/simple-faqs/ 5 5 * Description: FAQ plugin to allow creating and showing FAQ easily on Wordpress website 6 * Version: 1.1.56 * Version: 2.0 7 7 * Author: Waqas Ahmed 8 8 * Author URI: http://speedsoftsol.com … … 11 11 12 12 13 13 /** Add new button in TinyMCE Editor and associate a generator **/ 14 add_action('admin_head', 'simple_faq_button'); 15 function simple_faq_button() { 16 add_filter("mce_external_plugins", "simple_faq_add_editor_button_script"); 17 add_filter('mce_buttons', 'simple_faq_button_register'); 18 } 19 20 function simple_faq_add_editor_button_script($plugin_array) { 21 $plugin_array['simple_faq_button'] = plugins_url( '/simple_faq_button.js', __FILE__ ); 22 return $plugin_array; 23 } 24 25 function simple_faq_button_register($buttons) { 26 array_push($buttons, "faq_button"); 27 return $buttons; 28 } 29 30 function simple_faq_admin_styles() { 31 wp_enqueue_style('simple-faq-admin', plugins_url('/simple_faq_generator.css', __FILE__)); 32 } 33 add_action('admin_enqueue_scripts', 'simple_faq_admin_styles'); 34 35 14 36 /** Registering the Custom Post Types and the taxonomy at initialization **/ 15 37 add_action( 'init', 'create_simple_faq_taxonomy', 0 ); … … 41 63 'category' => 'all', 42 64 'style' => 'accordion', 65 'skin' => 'none', 66 'order' => 'default' 43 67 ), $atts ) ); 44 68 45 $items = get_requested_faqs($category); 69 $simple_faq_skin = strtolower($skin); 70 if (isset($simple_faq_skin) && $simple_faq_skin != "none") { 71 if ($simple_faq_skin == "dark") { 72 wp_enqueue_style( 'simple-faq-skin', plugins_url( 'skins/dark.css', __FILE__ ) ); 73 } 74 elseif ($simple_faq_skin == "light") { 75 wp_enqueue_style( 'simple-faq-skin', plugins_url( 'skins/light.css', __FILE__ ) ); 76 } 77 } 78 $items = get_requested_faqs($category, $order); 46 79 switch (strtolower($style)) { 47 80 case "accordion": 48 add_action ('wp_head', 'initialize_accordion');49 81 $output = faq_style_accordion($items); 50 82 break; … … 56 88 break; 57 89 default: 58 add_action ('wp_head', 'initialize_accordion');59 90 $output = faq_style_accordion($items); 60 91 } 61 return $output;92 return do_shortcode($output); 62 93 } 63 94 add_shortcode( 'simple-faq', 'render_faqs' ); 64 95 65 96 66 function get_requested_faqs ($parameter) { 67 if ($parameter == 'all') { 97 // Get all the FAQ you want - and in the correct order 98 function get_requested_faqs ($category, $order) { 99 100 /** Possible order options are 101 default, name, date 102 **/ 103 switch (strtolower($order)) { 104 case "default": 105 $orderby = 'menu_order'; 106 break; 107 case "date": 108 $orderby = 'date'; 109 break; 110 case "alphabetical": 111 $orderby = 'name'; 112 break; 113 default: 114 $orderby = 'menu_order'; 115 } 116 $category = strtolower($category); 117 if ($category == 'all') { 68 118 $args = array ( 69 119 'post_type' => 'simple-faqs', 70 'orderby' => 'menu_order',120 'orderby' => $orderby, 71 121 'order' => 'ASC', 72 122 'posts_per_page' => -1 … … 76 126 $args = array ( 77 127 'post_type' => 'simple-faqs', 78 'orderby' => 'menu_order',128 'orderby' => $orderby, 79 129 'order' => 'ASC', 80 130 'posts_per_page' => -1, … … 83 133 'taxonomy' => 'faq_category', 84 134 'field' => 'slug', 85 'terms' => $parameter135 'terms' => array($category) 86 136 ) 87 137 ) … … 110 160 $output .= '<li class="simple-faq-item simple-faq-number-'.$item_number.'">'; 111 161 $output .= '<h3>' . $item['title'] . '</h3>'; 112 $output .= '<br />' .$item['content'] . '</li>';162 $output .= $item['content'] . '</li>'; 113 163 $item_number++; 114 164 } … … 146 196 } 147 197 148 $output .= '<div class="simple-faqs- detail">';198 $output .= '<div class="simple-faqs-bookmarks">'; 149 199 //For the actual FAQ content below 150 200 $item_number = 1; //Reset item counter … … 168 218 echo "<script> 169 219 jQuery(document).ready(function($){ 170 $( ' #simple-faq-accordion' ).accordion({220 $( '.simple-faq-accordion' ).accordion({ 171 221 collapsible: true, 172 222 heightStyle: 'content' … … 176 226 177 227 $item_number = 1; 178 $output = '<div id="simple-faq-accordion">';228 $output = '<div class="simple-faq-accordion">'; 179 229 foreach ($items as $item) { 180 230 $output .= '<h3>';
Note: See TracChangeset
for help on using the changeset viewer.