Changeset 469209
- Timestamp:
- 11/29/2011 08:40:01 PM (14 years ago)
- Location:
- tb-testimonials/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (2 diffs)
-
tb-testimonials.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tb-testimonials/trunk/readme.txt
r452689 r469209 5 5 Requires at least: 3.0 6 6 Tested up to: 3.1 7 Stable tag: 1.5. 77 Stable tag: 1.5.8 8 8 9 9 Testimonial Management done right with Custom Post Types. Supports a testimonial.php template file for single testimonial pages. Testimonial Shortcode to insert testimonials in any post or page. Animated Sidebar Widget, Built in documentation and code examples. Customize output and tons of other options! … … 43 43 44 44 == Changelog == 45 46 = 1.5.8 = 47 * Fixed script and style enqueue issues with WordPress 3.3 48 * Fixed issue with default_loader.gif when FORCE_SSL was set to true. 45 49 46 50 = 1.5.7 = -
tb-testimonials/trunk/tb-testimonials.php
r452689 r469209 4 4 * Plugin URI: http://travisballard.com/wordpress/tb-testimonials/ 5 5 * Description: Testimonials managed by Custom Post Types. Supports a testimonial.php template file for single testimonial pages. Testimonial Shortcode to insert testimonials in any post. Scrolling Sidebar Widget 6 * Version: 1.5. 76 * Version: 1.5.8 7 7 * Author: Travis Ballard 8 8 * Author URI: http://www.travisballard.com … … 43 43 function __construct() 44 44 { 45 global $pagenow;46 47 45 # settings 48 46 add_action( 'init', array( &$this, 'init' ) ); … … 91 89 add_filter( 'manage_edit-testimonial_columns', array( &$this, 'testimonial_listing_edit_columns' ) ); 92 90 add_action( 'manage_pages_custom_column', array( &$this, 'testimonial_listing_columns' ) ); 93 94 # admin js 95 $pages = array( 'edit.php', 'post-new.php', 'post.php' ); 96 if( in_array( $pagenow, $pages ) ){ 97 wp_enqueue_script( 'tbtestimonials_admin', plugins_url( 'inc/js/tbtestimonials.admin.js', __FILE__ ), array( 'jquery' ), '1.0' ); 98 } 99 100 # admin css 101 if( is_admin() ) wp_enqueue_style( 'tbtestimonials-admin-stylesheet', plugins_url( 'inc/css/tbtestimonials.admin.css', __FILE__ ), array(), '1.0', 'screen' ); 102 103 # jquery: we use the version on google's cdn because other plugins load the one bundled with WordPress in the header and this sometime 104 # causes conflicts. Having 2 versions of jQuery will cause a conflict as well though so that's why we have the option to load in the header 105 # or the footer depending on whichever one works for you. By default we try to load it in the footer for performance reasons. 106 wp_register_script( 'jquery-footer', "http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js", false, '1.4.2', $this->load_js_in_footer ? 1 : 0 ); 107 108 # cycle 109 $which_jq = (bool)$this->load_js_in_footer ? array( 'jquery-footer' ) : array( 'jquery' ); 110 wp_register_script( 'jquery-cycle', plugins_url( 'inc/js/jquery.cycle.all.min.js', __FILE__ ), $which_jq, '1.0', (bool)$this->load_js_in_footer ); 111 112 # documentation 113 wp_register_script( 'tbt_documentation', plugins_url( 'inc/js/documentation.js', __FILE__ ), array( 'jquery-ui-tabs' ), '1.0' ); 114 wp_register_style( 'tbt_documentation', plugins_url( 'inc/css/documentation.css', __FILE__ ), array(), '1.0', 'screen' ); 115 116 # code mirror 117 if( $pagenow == 'edit.php' && isset( $_GET['post_type'] ) && $_GET['post_type'] == 'testimonial' && isset( $_GET['page'] ) && $_GET['page'] == 'tbtestimonials-syntax-settings' ){ 118 wp_enqueue_script( 'CodeMirror', plugins_url( 'inc/js/codemirror.js', __FILE__ ), array(), '1.0' ); 119 add_action ('admin_footer', array( &$this, 'add_codemirror' ) ); 120 } 121 122 # only call when widget is active 123 if( is_active_widget( false, false, 'tbtestimonialswidget' ) ) 124 { 125 # load js 126 if( ! is_admin() ){ 127 $requires = isset( $this->settings['disable_cycle'] ) && $this->settings['disable_cycle'] == 1 ? array() : array( 'jquery-cycle' ); 128 wp_enqueue_script( 'tbtestimonials', plugins_url( 'inc/js/tbtestimonials.js', __FILE__ ), $requires, '1.0', $this->load_js_in_footer ? 1 : 0 ); 129 } 130 131 # load css 132 if( ! is_admin() && isset( $this->settings['use_stylesheet'] ) ) wp_enqueue_style( 'tbtestimonials-stylesheet', plugins_url( 'inc/css/tbtestimonials.css', __FILE__ ), array(), '1.0', 'screen' ); 133 } 134 } 135 136 /** 137 * init funcitons. register taxonomy and post types 91 } 92 93 /** 94 * init funcitons. register scripts, styles, taxonomies and post types 138 95 * 139 96 */ 140 97 function init() 141 98 { 99 $this->register_scripts(); 100 $this->register_styles(); 101 142 102 # add testimonial post type 143 103 register_post_type( … … 726 686 } 727 687 688 /** 689 * register scripts used in plugin 690 * 691 */ 692 function register_scripts() 693 { 694 global $pagenow; 695 696 # admin js 697 $pages = array( 'edit.php', 'post-new.php', 'post.php' ); 698 if( in_array( $pagenow, $pages ) ){ 699 wp_enqueue_script( 'tbtestimonials_admin', plugins_url( 'inc/js/tbtestimonials.admin.js', __FILE__ ), array( 'jquery' ), '1.0' ); 700 } 701 702 # jquery: we use the version on google's cdn because other plugins load the one bundled with WordPress in the header and this sometime 703 # causes conflicts. Having 2 versions of jQuery will cause a conflict as well though so that's why we have the option to load in the header 704 # or the footer depending on whichever one works for you. By default we try to load it in the footer for performance reasons. 705 wp_register_script( 'jquery-footer', "http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js", false, '1.4.2', $this->load_js_in_footer ? 1 : 0 ); 706 707 # cycle 708 $which_jq = (bool)$this->load_js_in_footer ? array( 'jquery-footer' ) : array( 'jquery' ); 709 wp_register_script( 'jquery-cycle', plugins_url( 'inc/js/jquery.cycle.all.min.js', __FILE__ ), $which_jq, '1.0', (bool)$this->load_js_in_footer ); 710 711 # documentation 712 wp_register_script( 'tbt_documentation', plugins_url( 'inc/js/documentation.js', __FILE__ ), array( 'jquery-ui-tabs' ), '1.0' ); 713 714 # code mirror 715 if( $pagenow == 'edit.php' && isset( $_GET['post_type'] ) && $_GET['post_type'] == 'testimonial' && isset( $_GET['page'] ) && $_GET['page'] == 'tbtestimonials-syntax-settings' ){ 716 wp_enqueue_script( 'CodeMirror', plugins_url( 'inc/js/codemirror.js', __FILE__ ), array(), '1.0' ); 717 add_action ('admin_footer', array( &$this, 'add_codemirror' ) ); 718 } 719 720 # only call when widget is active 721 if( is_active_widget( false, false, 'tbtestimonialswidget' ) ) 722 { 723 # load js 724 if( ! is_admin() ){ 725 $requires = isset( $this->settings['disable_cycle'] ) && $this->settings['disable_cycle'] == 1 ? array() : array( 'jquery-cycle' ); 726 wp_enqueue_script( 'tbtestimonials', plugins_url( 'inc/js/tbtestimonials.js', __FILE__ ), $requires, '1.0', $this->load_js_in_footer ? 1 : 0 ); 727 } 728 } 729 } 730 731 /** 732 * register styles used in plugin 733 * 734 */ 735 function register_styles() 736 { 737 # admin css 738 if( is_admin() ) wp_enqueue_style( 'tbtestimonials-admin-stylesheet', plugins_url( 'inc/css/tbtestimonials.admin.css', __FILE__ ), array(), '1.0', 'screen' ); 739 740 # documentation 741 wp_register_style( 'tbt_documentation', plugins_url( 'inc/css/documentation.css', __FILE__ ), array(), '1.0', 'screen' ); 742 743 # only call when widget is active 744 if( is_active_widget( false, false, 'tbtestimonialswidget' ) ) 745 { 746 # load css 747 if( ! is_admin() && isset( $this->settings['use_stylesheet'] ) ) wp_enqueue_style( 'tbtestimonials-stylesheet', plugins_url( 'inc/css/tbtestimonials.css', __FILE__ ), array(), '1.0', 'screen' ); 748 } 749 } 728 750 } 729 751 … … 943 965 $preloader['path'] = str_replace( WP_CONTENT_URL, WP_CONTENT_DIR, $preloader['url'] ); 944 966 } 945 else # not in loaders folder, error 946 { 947 trigger_error( sprintf( '%s is not a valid file or url', $url ), E_USER_WARNING ); 967 else # not in loaders folder, return 948 968 return false; 949 }950 969 } 951 970 }
Note: See TracChangeset
for help on using the changeset viewer.