diff --git a/classes/class-woothemes-testimonials.php b/classes/class-woothemes-testimonials.php index d2f47d4..65169c4 100644 --- a/classes/class-woothemes-testimonials.php +++ b/classes/class-woothemes-testimonials.php @@ -17,7 +17,7 @@ class Woothemes_Testimonials { private $assets_dir; private $assets_url; private $token; - public $version; + public $version; private $file; /** @@ -344,34 +344,34 @@ public function enqueue_admin_styles () { * @since 1.0.0 * @return array */ - public function get_custom_fields_settings () { + public function get_custom_fields_settings() { $fields = array(); $fields['gravatar_email'] = array( - 'name' => __( 'Gravatar E-mail Address', 'woothemes-testimonials' ), - 'description' => sprintf( __( 'Enter in an e-mail address, to use a %sGravatar%s, instead of using the "Featured Image".', 'woothemes-testimonials' ), '', '' ), - 'type' => 'text', - 'default' => '', - 'section' => 'info' + 'name' => __( 'Gravatar E-mail Address', 'woothemes-testimonials' ), + 'description' => sprintf( __( 'Enter in an e-mail address, to use a %sGravatar%s, instead of using the "Featured Image".', 'woothemes-testimonials' ), '', '' ), + 'type' => 'text', + 'default' => '', + 'section' => 'info', ); $fields['byline'] = array( - 'name' => __( 'Byline', 'woothemes-testimonials' ), - 'description' => __( 'Enter a byline for the customer giving this testimonial (for example: "CEO of WooThemes").', 'woothemes-testimonials' ), - 'type' => 'text', - 'default' => '', - 'section' => 'info' + 'name' => __( 'Byline', 'woothemes-testimonials' ), + 'description' => __( 'Enter a byline for the customer giving this testimonial (for example: "CEO of WooThemes").', 'woothemes-testimonials' ), + 'type' => 'text', + 'default' => '', + 'section' => 'info', ); $fields['url'] = array( - 'name' => __( 'URL', 'woothemes-testimonials' ), - 'description' => __( 'Enter a URL that applies to this customer (for example: http://woothemes.com/).', 'woothemes-testimonials' ), - 'type' => 'url', - 'default' => '', - 'section' => 'info' + 'name' => __( 'URL', 'woothemes-testimonials' ), + 'description' => __( 'Enter a URL that applies to this customer (for example: http://woothemes.com/).', 'woothemes-testimonials' ), + 'type' => 'url', + 'default' => '', + 'section' => 'info', ); - return $fields; + return apply_filters( 'testimonials_get_custom_fields_settings', $fields ); } // End get_custom_fields_settings() /** diff --git a/classes/class-woothemes-widget-testimonials.php b/classes/class-woothemes-widget-testimonials.php index 53e022b..da807eb 100644 --- a/classes/class-woothemes-widget-testimonials.php +++ b/classes/class-woothemes-widget-testimonials.php @@ -267,5 +267,7 @@ protected function get_order_options () { } // End Class /* Register the widget. */ -add_action( 'widgets_init', create_function( '', 'return register_widget("Woothemes_Widget_Testimonials");' ), 1 ); -?> \ No newline at end of file +add_action( 'widgets_init', function() { + return register_widget( 'Woothemes_Widget_Testimonials' ); +}, 1 ); +?> diff --git a/woothemes-testimonials-template.php b/woothemes-testimonials-template.php index 91c6236..0c0388a 100644 --- a/woothemes-testimonials-template.php +++ b/woothemes-testimonials-template.php @@ -57,7 +57,6 @@ function woothemes_testimonials ( $args = '' ) { // Allow child themes/plugins to filter here. $args = apply_filters( 'woothemes_testimonials_args', $args ); $html = ''; - do_action( 'woothemes_testimonials_before', $args ); // The Query. @@ -85,11 +84,13 @@ function woothemes_testimonials ( $args = '' ) { $html .= '
' . "\n"; // Begin templating logic. - $tpl = '
%%TEXT%%
%%AVATAR%% %%AUTHOR%%
'; + $tpl = '
%%TEXT%%
%%AVATAR%% %%AUTHOR%%
'; $tpl = apply_filters( 'woothemes_testimonials_item_template', $tpl, $args ); $count = 0; - foreach ( $query as $post ) { $count++; + foreach ( $query as $post ) { + $count++; + $template = $tpl; $css_class = 'quote'; @@ -105,21 +106,23 @@ function woothemes_testimonials ( $args = '' ) { $author = ''; $author_text = ''; - // If we need to display the author, get the data. - if ( ( get_the_title( $post ) != '' ) && true == $args['display_author'] ) { - $author .= '