Version Description
- New Feature: Testimonials Now Support Images!
Download this release
Release Info
Developer | richardgabriel |
Plugin | Easy Testimonials |
Version | 1.1 |
Comparing to | |
See all releases |
Code changes from version 1.0 to 1.1
- css/style.css +5 -0
- easy-testimonials.php +28 -4
- include/easy_testimonial_options.php +9 -0
- include/ik-custom-post-type.php +1 -1
- readme.txt +9 -2
css/style.css
CHANGED
@@ -2,6 +2,11 @@
|
|
2 |
blockquote.easy_testimonial{
|
3 |
}
|
4 |
|
|
|
|
|
|
|
|
|
|
|
5 |
blockquote.easy_testimonial p{
|
6 |
}
|
7 |
|
2 |
blockquote.easy_testimonial{
|
3 |
}
|
4 |
|
5 |
+
blockquote.easy_testimonial .attachment-easy_testimonial_thumb{
|
6 |
+
float: left;
|
7 |
+
margin: 10px;
|
8 |
+
}
|
9 |
+
|
10 |
blockquote.easy_testimonial p{
|
11 |
}
|
12 |
|
easy-testimonials.php
CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Easy Testimonials
|
|
4 |
Plugin URI: http://illuminatikarate.com/easy-testimonials/
|
5 |
Description: Easy Testimonials - Provides custom post type, shortcode, sidebar widget, and other functionality for testimonials.
|
6 |
Author: Illuminati Karate
|
7 |
-
Version: 1.
|
8 |
Author URI: http://illuminatikarate.com
|
9 |
|
10 |
This file is part of Easy Testimonials.
|
@@ -60,11 +60,17 @@ function ik_setup_testimonials(){
|
|
60 |
$easy_testimonial_options = new easyTestimonialOptions();
|
61 |
|
62 |
//setup post type for testimonials
|
63 |
-
$postType = array('name' => 'Testimonial', 'plural' =>'Testimonials' );
|
64 |
$fields = array();
|
65 |
$fields[] = array('name' => 'client', 'title' => 'Client Name', 'description' => "Name of the Client giving the testimonial. Appears below the Testimonial.", 'type' => 'text');
|
66 |
$fields[] = array('name' => 'position', 'title' => 'Position / Location / Other', 'description' => "The information that appears below the client's name.", 'type' => 'text');
|
67 |
$myCustomType = new ikTestimonialsCustomPostType($postType, $fields);
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
}
|
69 |
|
70 |
//load testimonials into an array and output a random one
|
@@ -78,6 +84,8 @@ function outputRandomTestimonial($atts){
|
|
78 |
'short_version' => false,
|
79 |
), $atts ) );
|
80 |
|
|
|
|
|
81 |
//load testimonials into an array
|
82 |
$i = 0;
|
83 |
$loop = new WP_Query(array( 'post_type' => 'testimonial','posts_per_page' => '-1'));
|
@@ -94,6 +102,10 @@ function outputRandomTestimonial($atts){
|
|
94 |
$testimonials[$i]['content'] = word_trim($testimonials[$i]['content'], 65, TRUE);
|
95 |
}
|
96 |
|
|
|
|
|
|
|
|
|
97 |
$testimonials[$i]['client'] = get_post_meta($postid, '_ikcf_client', true);
|
98 |
$testimonials[$i]['position'] = get_post_meta($postid, '_ikcf_position', true);
|
99 |
$i++;
|
@@ -105,7 +117,10 @@ function outputRandomTestimonial($atts){
|
|
105 |
ob_start();
|
106 |
|
107 |
if(!$short_version){
|
108 |
-
?><blockquote class="easy_testimonial">
|
|
|
|
|
|
|
109 |
<p class="<?=$body_class?>">
|
110 |
<?=$testimonials[$rand]['content'];?>
|
111 |
<?php if(strlen($testimonials_link)>2):?><a href="<?php echo $testimonials_link; ?>">Read More</a><?php endif; ?></p>
|
@@ -133,6 +148,8 @@ function outputTestimonials($atts){
|
|
133 |
'testimonials_link' => get_option('testimonials_link')
|
134 |
), $atts ) );
|
135 |
|
|
|
|
|
136 |
ob_start();
|
137 |
|
138 |
//load testimonials into an array
|
@@ -146,10 +163,17 @@ function outputTestimonials($atts){
|
|
146 |
$testimonial['content'] = get_the_content($postid);
|
147 |
}
|
148 |
|
|
|
|
|
|
|
|
|
149 |
$testimonial['client'] = get_post_meta($postid, '_ikcf_client', true);
|
150 |
$testimonial['position'] = get_post_meta($postid, '_ikcf_position', true);
|
151 |
|
152 |
-
?><blockquote class="easy_testimonial">
|
|
|
|
|
|
|
153 |
<p>
|
154 |
<?=$testimonial['content'];?>
|
155 |
<?php if(strlen($testimonials_link)>2):?><a href="<?php echo $testimonials_link; ?>">Read More</a><?php endif; ?></p>
|
4 |
Plugin URI: http://illuminatikarate.com/easy-testimonials/
|
5 |
Description: Easy Testimonials - Provides custom post type, shortcode, sidebar widget, and other functionality for testimonials.
|
6 |
Author: Illuminati Karate
|
7 |
+
Version: 1.1
|
8 |
Author URI: http://illuminatikarate.com
|
9 |
|
10 |
This file is part of Easy Testimonials.
|
60 |
$easy_testimonial_options = new easyTestimonialOptions();
|
61 |
|
62 |
//setup post type for testimonials
|
63 |
+
$postType = array('name' => 'Testimonial', 'plural' =>'Testimonials', 'slug' => 'testimonial' );
|
64 |
$fields = array();
|
65 |
$fields[] = array('name' => 'client', 'title' => 'Client Name', 'description' => "Name of the Client giving the testimonial. Appears below the Testimonial.", 'type' => 'text');
|
66 |
$fields[] = array('name' => 'position', 'title' => 'Position / Location / Other', 'description' => "The information that appears below the client's name.", 'type' => 'text');
|
67 |
$myCustomType = new ikTestimonialsCustomPostType($postType, $fields);
|
68 |
+
|
69 |
+
//add featured image support
|
70 |
+
add_theme_support( 'post-thumbnails', array( 'testimonial') );
|
71 |
+
|
72 |
+
//for the testimonial thumb images
|
73 |
+
add_image_size( 'easy_testimonial_thumb', 50, 50, true );
|
74 |
}
|
75 |
|
76 |
//load testimonials into an array and output a random one
|
84 |
'short_version' => false,
|
85 |
), $atts ) );
|
86 |
|
87 |
+
$show_thumbs = get_option('testimonials_image');
|
88 |
+
|
89 |
//load testimonials into an array
|
90 |
$i = 0;
|
91 |
$loop = new WP_Query(array( 'post_type' => 'testimonial','posts_per_page' => '-1'));
|
102 |
$testimonials[$i]['content'] = word_trim($testimonials[$i]['content'], 65, TRUE);
|
103 |
}
|
104 |
|
105 |
+
if ($show_thumbs) {
|
106 |
+
$testimonials[$i]['image'] = get_the_post_thumbnail($postid, 'easy_testimonial_thumb');
|
107 |
+
}
|
108 |
+
|
109 |
$testimonials[$i]['client'] = get_post_meta($postid, '_ikcf_client', true);
|
110 |
$testimonials[$i]['position'] = get_post_meta($postid, '_ikcf_position', true);
|
111 |
$i++;
|
117 |
ob_start();
|
118 |
|
119 |
if(!$short_version){
|
120 |
+
?><blockquote class="easy_testimonial">
|
121 |
+
<?php if ($show_thumbs) {
|
122 |
+
echo $testimonials[$rand]['image'];
|
123 |
+
} ?>
|
124 |
<p class="<?=$body_class?>">
|
125 |
<?=$testimonials[$rand]['content'];?>
|
126 |
<?php if(strlen($testimonials_link)>2):?><a href="<?php echo $testimonials_link; ?>">Read More</a><?php endif; ?></p>
|
148 |
'testimonials_link' => get_option('testimonials_link')
|
149 |
), $atts ) );
|
150 |
|
151 |
+
$show_thumbs = get_option('testimonials_image');
|
152 |
+
|
153 |
ob_start();
|
154 |
|
155 |
//load testimonials into an array
|
163 |
$testimonial['content'] = get_the_content($postid);
|
164 |
}
|
165 |
|
166 |
+
if ($show_thumbs) {
|
167 |
+
$testimonial['image'] = get_the_post_thumbnail($postid, 'easy_testimonial_thumb');
|
168 |
+
}
|
169 |
+
|
170 |
$testimonial['client'] = get_post_meta($postid, '_ikcf_client', true);
|
171 |
$testimonial['position'] = get_post_meta($postid, '_ikcf_position', true);
|
172 |
|
173 |
+
?><blockquote class="easy_testimonial">
|
174 |
+
<?php if ($show_thumbs) {
|
175 |
+
echo $testimonial['image'];
|
176 |
+
} ?>
|
177 |
<p>
|
178 |
<?=$testimonial['content'];?>
|
179 |
<?php if(strlen($testimonials_link)>2):?><a href="<?php echo $testimonials_link; ?>">Read More</a><?php endif; ?></p>
|
include/easy_testimonial_options.php
CHANGED
@@ -41,6 +41,7 @@ class easyTestimonialOptions
|
|
41 |
function register_settings(){
|
42 |
//register our settings
|
43 |
register_setting( 'easy-testimonials-settings-group', 'testimonials_link' );
|
|
|
44 |
}
|
45 |
|
46 |
function settings_page(){
|
@@ -66,6 +67,14 @@ class easyTestimonialOptions
|
|
66 |
</tr>
|
67 |
</table>
|
68 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
<p class="submit">
|
70 |
<input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
|
71 |
</p>
|
41 |
function register_settings(){
|
42 |
//register our settings
|
43 |
register_setting( 'easy-testimonials-settings-group', 'testimonials_link' );
|
44 |
+
register_setting( 'easy-testimonials-settings-group', 'testimonials_image' );
|
45 |
}
|
46 |
|
47 |
function settings_page(){
|
67 |
</tr>
|
68 |
</table>
|
69 |
|
70 |
+
<table class="form-table">
|
71 |
+
<tr valign="top">
|
72 |
+
<th scope="row"><label for="testimonials_image">Show Testimonial Image</label></th>
|
73 |
+
<td><input type="checkbox" name="testimonials_image" id="testimonials_image" value="1" <?php if(get_option('testimonials_image')){ ?> checked="CHECKED" <?php } ?>/>
|
74 |
+
<p class="description">If checked, the Image will be shown next to the Testimonial.</p>
|
75 |
+
</tr>
|
76 |
+
</table>
|
77 |
+
|
78 |
<p class="submit">
|
79 |
<input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
|
80 |
</p>
|
include/ik-custom-post-type.php
CHANGED
@@ -55,7 +55,7 @@ class ikTestimonialsCustomPostType
|
|
55 |
'publicly_queryable' => true,
|
56 |
'show_ui' => true,
|
57 |
'query_var' => true,
|
58 |
-
'rewrite' => true,
|
59 |
'capability_type' => 'post',
|
60 |
'hierarchical' => false,
|
61 |
'menu_position' => 20,
|
55 |
'publicly_queryable' => true,
|
56 |
'show_ui' => true,
|
57 |
'query_var' => true,
|
58 |
+
'rewrite' => array( 'slug' => $postType['slug'], 'with_front' => (strlen($postType['slug'])>0) ? false : true),
|
59 |
'capability_type' => 'post',
|
60 |
'hierarchical' => false,
|
61 |
'menu_position' => 20,
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: richardgabriel
|
|
3 |
Tags: testimonials, testimonial widget, testimonial feed, random testimonials
|
4 |
Requires at least: 3.0.1
|
5 |
Tested up to: 3.5.2
|
6 |
-
Stable tag: 1.
|
7 |
License: GPLv3 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
9 |
|
@@ -13,7 +13,7 @@ Easy Testimonials is a simple plugin for adding Testimonials to your WordPress T
|
|
13 |
|
14 |
Easy Testimonials is an easy-to-use plugin that allows users to add Testimonials to the sidebar, as a widget, or to embed them into a Page or Post using the shortcode. The Easy Testimonials also allows you to insert a list of all Testimonials or output a Random Testimonial.
|
15 |
|
16 |
-
Easy Testimonials includes options to set the URL of the Read More Link, and more!
|
17 |
|
18 |
Easy Testimonials plugin will inherit the styling from your Theme - just install and get to work!
|
19 |
|
@@ -30,6 +30,10 @@ This section describes how to install the plugin and get it working.
|
|
30 |
* To ouput a list of All Testimonials, place the shortcode [testimonials] in the desired area of the Page or Post Content.
|
31 |
* To output a Testimonial in the Sidebar, use the Widgets section of your WordPress Theme.
|
32 |
|
|
|
|
|
|
|
|
|
33 |
== Frequently Asked Questions ==
|
34 |
|
35 |
= Help! I need more information! =
|
@@ -42,6 +46,9 @@ OK! We have a great page with some helpful information here: https://illuminati
|
|
42 |
|
43 |
== Changelog ==
|
44 |
|
|
|
|
|
|
|
45 |
= 1.0 =
|
46 |
* Released!
|
47 |
|
3 |
Tags: testimonials, testimonial widget, testimonial feed, random testimonials
|
4 |
Requires at least: 3.0.1
|
5 |
Tested up to: 3.5.2
|
6 |
+
Stable tag: 1.1
|
7 |
License: GPLv3 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
9 |
|
13 |
|
14 |
Easy Testimonials is an easy-to-use plugin that allows users to add Testimonials to the sidebar, as a widget, or to embed them into a Page or Post using the shortcode. The Easy Testimonials also allows you to insert a list of all Testimonials or output a Random Testimonial.
|
15 |
|
16 |
+
Easy Testimonials includes options to set the URL of the Read More Link, whether or not to display the Testimonial Image, and more!
|
17 |
|
18 |
Easy Testimonials plugin will inherit the styling from your Theme - just install and get to work!
|
19 |
|
30 |
* To ouput a list of All Testimonials, place the shortcode [testimonials] in the desired area of the Page or Post Content.
|
31 |
* To output a Testimonial in the Sidebar, use the Widgets section of your WordPress Theme.
|
32 |
|
33 |
+
= Options =
|
34 |
+
* To control the destination of the "Read More" link, set the path in the Testimonials Read More Link field.
|
35 |
+
* To diplay any Featured Images that you have attached to your Testimonials, check the box next to Show Testimonial Image.
|
36 |
+
|
37 |
== Frequently Asked Questions ==
|
38 |
|
39 |
= Help! I need more information! =
|
46 |
|
47 |
== Changelog ==
|
48 |
|
49 |
+
= 1.1 =
|
50 |
+
* New Feature: Testimonials Now Support Images!
|
51 |
+
|
52 |
= 1.0 =
|
53 |
* Released!
|
54 |
|