Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 1.4.0 #26

Merged
merged 12 commits into from Aug 22, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
60 changes: 42 additions & 18 deletions classes/class-woothemes-testimonials.php
Expand Up @@ -7,7 +7,7 @@
* All functionality pertaining to the Testimonials feature.
*
* @package WordPress
* @subpackage WooThemes_Testimonials
* @subpackage Woothemes_Testimonials
* @category Plugin
* @author Matty
* @since 1.0.0
Expand Down Expand Up @@ -35,30 +35,30 @@ public function __construct( $file ) {
$this->token = 'testimonial';

$this->load_plugin_textdomain();
add_action( 'init', array( &$this, 'load_localisation' ), 0 );
add_action( 'init', array( $this, 'load_localisation' ), 0 );

// Run this on activation.
register_activation_hook( $this->file, array( &$this, 'activation' ) );
register_activation_hook( $this->file, array( $this, 'activation' ) );

add_action( 'init', array( &$this, 'register_post_type' ) );
add_action( 'init', array( $this, 'register_post_type' ) );
add_action( 'init', array( $this, 'register_taxonomy' ) );

if ( is_admin() ) {
global $pagenow;

add_action( 'admin_menu', array( &$this, 'meta_box_setup' ), 20 );
add_action( 'save_post', array( &$this, 'meta_box_save' ) );
add_filter( 'enter_title_here', array( &$this, 'enter_title_here' ) );
add_action( 'admin_print_styles', array( &$this, 'enqueue_admin_styles' ), 10 );
add_filter( 'post_updated_messages', array( &$this, 'updated_messages' ) );
add_action( 'admin_menu', array( $this, 'meta_box_setup' ), 20 );
add_action( 'save_post', array( $this, 'meta_box_save' ) );
add_filter( 'enter_title_here', array( $this, 'enter_title_here' ) );
add_action( 'admin_print_styles', array( $this, 'enqueue_admin_styles' ), 10 );
add_filter( 'post_updated_messages', array( $this, 'updated_messages' ) );

if ( $pagenow == 'edit.php' && isset( $_GET['post_type'] ) && esc_attr( $_GET['post_type'] ) == $this->token ) {
add_filter( 'manage_edit-' . $this->token . '_columns', array( &$this, 'register_custom_column_headings' ), 10, 1 );
add_action( 'manage_posts_custom_column', array( &$this, 'register_custom_columns' ), 10, 2 );
add_filter( 'manage_edit-' . $this->token . '_columns', array( $this, 'register_custom_column_headings' ), 10, 1 );
add_action( 'manage_posts_custom_column', array( $this, 'register_custom_columns' ), 10, 2 );
}
}

add_action( 'after_setup_theme', array( &$this, 'ensure_post_thumbnails_support' ) );
add_action( 'after_setup_theme', array( $this, 'ensure_post_thumbnails_support' ) );
} // End __construct()

/**
Expand Down Expand Up @@ -88,18 +88,22 @@ public function register_post_type () {
'menu_name' => __( 'Testimonials', 'woothemes-testimonials' )

);

$single_slug = apply_filters( 'woothemes_testimonials_single_slug', _x( 'testimonial', 'single post url slug', 'woothemes-testimonials' ) );
$archive_slug = apply_filters( 'woothemes_testimonials_archive_slug', _x( 'testimonials', 'post archive url slug', 'woothemes-testimonials' ) );

$args = array(
'labels' => $labels,
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'show_in_menu' => true,
'query_var' => true,
'rewrite' => array( 'slug' => 'testimonial' ),
'rewrite' => array( 'slug' => $single_slug, 'with_front' => false ),
'capability_type' => 'post',
'has_archive' => 'testimonials',
'has_archive' => $archive_slug,
'hierarchical' => false,
'supports' => array( 'title', 'editor', 'thumbnail', 'page-attributes' ),
'supports' => array( 'title', 'author' ,'editor', 'thumbnail', 'page-attributes' ),
'menu_position' => 5,
'menu_icon' => ''
);
Expand Down Expand Up @@ -216,7 +220,7 @@ public function updated_messages ( $messages ) {
* @return void
*/
public function meta_box_setup () {
add_meta_box( 'testimonial-data', __( 'Testimonial Details', 'woothemes-testimonials' ), array( &$this, 'meta_box_content' ), $this->token, 'normal', 'high' );
add_meta_box( 'testimonial-data', __( 'Testimonial Details', 'woothemes-testimonials' ), array( $this, 'meta_box_content' ), $this->token, 'normal', 'high' );
} // End meta_box_setup()

/**
Expand Down Expand Up @@ -423,8 +427,16 @@ public function get_testimonials ( $args = '' ) {
$query_args['order'] = $args['order'];
$query_args['suppress_filters'] = false;

if ( is_numeric( $args['id'] ) && ( intval( $args['id'] ) > 0 ) ) {
$query_args['p'] = intval( $args['id'] );
$ids = explode( ',', $args['id'] );
$ids = array_map( 'intval', $ids );

if ( 0 < count( $ids ) ) {
if ( 1 == count( $ids ) && is_numeric( $ids[0] ) && ( 0 < intval( $ids[0] ) ) ) {
$query_args['p'] = intval( $args['id'] );
} else {
$query_args['ignore_sticky_posts'] = 1;
$query_args['post__in'] = $ids;
}
}

// Whitelist checks.
Expand Down Expand Up @@ -517,6 +529,7 @@ public function load_plugin_textdomain () {
*/
public function activation () {
$this->register_plugin_version();
$this->flush_rewrite_rules();
} // End activation()

/**
Expand All @@ -531,6 +544,17 @@ private function register_plugin_version () {
}
} // End register_plugin_version()

/**
* Flush the rewrite rules
* @access public
* @since 1.4.0
* @return void
*/
private function flush_rewrite_rules () {
$this->register_post_type();
flush_rewrite_rules();
} // End flush_rewrite_rules()

/**
* Ensure that "post-thumbnails" support is available for those themes that don't register it.
* @since 1.0.1
Expand Down
57 changes: 35 additions & 22 deletions lang/woothemes-testimonials-en_GB.po
@@ -1,15 +1,16 @@
msgid ""
msgstr ""
"Project-Id-Version: Testimonials v1.3.0\n"
"Project-Id-Version: Testimonials v1.3.1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: \n"
"PO-Revision-Date: 2013-04-30 12:40:13+0000\n"
"PO-Revision-Date: 2013-07-31 02:00:10+0000\n"
"Last-Translator: Matty <matt@woothemes.com>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: CSL v1.x\n"
"X-Poedit-Language: English\n"
"X-Poedit-Country: UNITED KINGDOM\n"
"X-Poedit-SourceCharset: utf-8\n"
Expand Down Expand Up @@ -106,110 +107,110 @@ msgstr ""
msgid "No %s Found In Trash"
msgstr ""

#: classes/class-woothemes-testimonials.php:159
#: classes/class-woothemes-testimonials.php:163
#@ woothemes-testimonials
msgid "Image"
msgstr ""

#: classes/class-woothemes-testimonials.php:193
#: classes/class-woothemes-testimonials.php:197
#, php-format
#@ woothemes-testimonials
msgid "Testimonial updated. %sView testimonial%s"
msgstr ""

#: classes/class-woothemes-testimonials.php:194
#: classes/class-woothemes-testimonials.php:198
#@ woothemes-testimonials
msgid "Custom field updated."
msgstr ""

#: classes/class-woothemes-testimonials.php:195
#: classes/class-woothemes-testimonials.php:199
#@ woothemes-testimonials
msgid "Custom field deleted."
msgstr ""

#: classes/class-woothemes-testimonials.php:196
#: classes/class-woothemes-testimonials.php:200
#@ woothemes-testimonials
msgid "Testimonial updated."
msgstr ""

#. translators: %s: date and time of the revision
#: classes/class-woothemes-testimonials.php:198
#: classes/class-woothemes-testimonials.php:202
#, php-format
#@ woothemes-testimonials
msgid "Testimonial restored to revision from %s"
msgstr ""

#: classes/class-woothemes-testimonials.php:199
#: classes/class-woothemes-testimonials.php:203
#, php-format
#@ woothemes-testimonials
msgid "Testimonial published. %sView testimonial%s"
msgstr ""

#: classes/class-woothemes-testimonials.php:200
#: classes/class-woothemes-testimonials.php:204
#@ default
msgid "Testimonial saved."
msgstr ""

#: classes/class-woothemes-testimonials.php:201
#: classes/class-woothemes-testimonials.php:205
#, php-format
#@ woothemes-testimonials
msgid "Testimonial submitted. %sPreview testimonial%s"
msgstr ""

#: classes/class-woothemes-testimonials.php:202
#: classes/class-woothemes-testimonials.php:206
#, php-format
#@ woothemes-testimonials
msgid "Testimonial scheduled for: %1$s. %2$sPreview testimonial%3$s"
msgstr ""

#: classes/class-woothemes-testimonials.php:204
#: classes/class-woothemes-testimonials.php:208
#@ default
msgid "M j, Y @ G:i"
msgstr ""

#: classes/class-woothemes-testimonials.php:205
#: classes/class-woothemes-testimonials.php:209
#, php-format
#@ woothemes-testimonials
msgid "Testimonial draft updated. %sPreview testimonial%s"
msgstr ""

#: classes/class-woothemes-testimonials.php:219
#: classes/class-woothemes-testimonials.php:223
#@ woothemes-testimonials
msgid "Testimonial Details"
msgstr ""

#: classes/class-woothemes-testimonials.php:318
#: classes/class-woothemes-testimonials.php:322
#@ woothemes-testimonials
msgid "Enter the customer's name here"
msgstr ""

#: classes/class-woothemes-testimonials.php:344
#: classes/class-woothemes-testimonials.php:348
#@ woothemes-testimonials
msgid "Gravatar E-mail Address"
msgstr ""

#: classes/class-woothemes-testimonials.php:345
#: classes/class-woothemes-testimonials.php:349
#, php-format
#@ woothemes-testimonials
msgid "Enter in an e-mail address, to use a %sGravatar%s, instead of using the \"Featured Image\"."
msgstr ""

#: classes/class-woothemes-testimonials.php:352
#: classes/class-woothemes-testimonials.php:356
#@ woothemes-testimonials
msgid "Byline"
msgstr ""

#: classes/class-woothemes-testimonials.php:353
#: classes/class-woothemes-testimonials.php:357
#@ woothemes-testimonials
msgid "Enter a byline for the customer giving this testimonial (for example: \"CEO of WooThemes\")."
msgstr ""

#: classes/class-woothemes-testimonials.php:360
#: classes/class-woothemes-testimonials.php:364
#@ woothemes-testimonials
msgid "URL"
msgstr ""

#: classes/class-woothemes-testimonials.php:361
#: classes/class-woothemes-testimonials.php:365
#@ woothemes-testimonials
msgid "Enter a URL that applies to this customer (for example: http://woothemes.com/)."
msgstr ""
Expand Down Expand Up @@ -389,3 +390,15 @@ msgstr ""
msgid "All"
msgstr ""

#: classes/class-woothemes-testimonials.php:92
#@ woothemes-testimonials
msgctxt "single post url slug"
msgid "testimonial"
msgstr ""

#: classes/class-woothemes-testimonials.php:93
#@ woothemes-testimonials
msgctxt "post archive url slug"
msgid "testimonials"
msgstr ""

28 changes: 23 additions & 5 deletions readme.txt
Expand Up @@ -3,8 +3,8 @@ Contributors: woothemes, mattyza, jameskoster
Donate link: http://woothemes.com/
Tags: testimonials, widget, shortcode, template-tag, feedback, customers
Requires at least: 3.4.2
Tested up to: 3.5.1
Stable tag: 1.3.1
Tested up to: 3.6.0
Stable tag: 1.4.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand All @@ -14,10 +14,10 @@ Show off what your customers are saying about your business and how great they s

"Testimonials by WooThemes" is a clean and easy-to-use testimonials management system for WordPress. Load in what your customers are saying about your business, and display the testimonials via a shortcode, widget or template tag on your website.

Looking for a helping hand? [View plugin documentation](http://wordpress.org/extend/plugins/testimonials-by-woothemes/other_notes/).
Looking for a helping hand? [View plugin documentation](http://wordpress.org/plugins/testimonials-by-woothemes/other_notes/).

Looking to contribute code to this plugin? [Fork the repository over at GitHub](http://github.com/woothemes/testimonials/).
(submit pull requests to the "develop" branch)
(submit pull requests to the latest "release-" branch)

== Usage ==

Expand All @@ -28,6 +28,7 @@ To display your testimonials via a theme or a custom plugin, please use the foll
To add arguments to this, please use any of the following arguments, using the syntax provided below:

* 'limit' => 5 (the maximum number of items to display)
* 'per_row' => 3 (when creating rows, how many items display in a single row?)
* 'orderby' => 'menu_order' (how to order the items - accepts all default WordPress ordering options)
* 'order' => 'DESC' (the order direction)
* 'id' => 0 (display a specific item)
Expand Down Expand Up @@ -94,7 +95,14 @@ We encourage everyone to contribute their ideas, thoughts and code snippets. Thi

1. The testimonials management screen within the WordPress admin.

== Upgrade Notice ==
== Upgrade Notice =

= 1.4.0 =
* Adds "per_row" functionality, a "columns-X" CSS class on the wrapper, support for multiple comma-separated ID values in the "id" argument and a "no-image" CSS class if no image is available for the item.

= 1.3.2 =
* Adds filters for the single testimonials and testimonial archives URL slugs
* Adds a flush_rewrite_rules() call on plugin activation

= 1.3.1 =
* Fixes bug where testimonial text doesn't display (incorrectly placed action hook).
Expand All @@ -119,6 +127,16 @@ We encourage everyone to contribute their ideas, thoughts and code snippets. Thi

== Changelog ==

= 1.4.0 =
* 2013-08-20.
* Adds "per_row" functionality and a "columns-X" CSS class on the wrapper.
* Adds support for multiple comma-separated ID values in the "id" argument.
* Adds a "no-image" CSS class if no image is available for the item.
* Renames the effect CSS class to include "effect-" as a prefix (for example, "effect-fade").
* Adds "woothemes_testimonials_single_slug" as a filter for the single testimonials URL slug
* Adds "woothemes_testimonials_archive_slug" as a filter for the testimonials archive URL slug
* Adds a flush_rewrite_rules() call on plugin activation

= 1.3.1 =
* 2013-04-30.
* Fixes bug where testimonial text doesn't display (incorrectly placed action hook).
Expand Down