Version Description
- Add filter
testimonials_widget_version
- Screenshot 11/16 updated
- Update POT
- Update Premium features
- Version tracking for default settings
Download this release
Release Info
Developer | comprock |
Plugin | Testimonials Widget |
Version | 2.8.2 |
Comparing to | |
See all releases |
Code changes from version 0.2.14 to 2.8.2
- languages/testimonials-widget-he_IL.mo +0 -0
- languages/testimonials-widget-he_IL.po +546 -0
- languages/testimonials-widget.pot +438 -154
- lib/metabox.class.php +1458 -0
- lib/settings.css +76 -0
- lib/settings.testimonials-widget.php +808 -0
- lib/testimonials-widget-widget.php +267 -0
- media/michael-cannon-red-square-300x2251.jpg +0 -0
- readme.txt +1739 -105
- screenshot-1.png +0 -0
- screenshot-10.png +0 -0
- screenshot-11.png +0 -0
- screenshot-12.png +0 -0
- screenshot-13.png +0 -0
- screenshot-14.png +0 -0
- screenshot-15.png +0 -0
- screenshot-16.png +0 -0
- screenshot-17.png +0 -0
- screenshot-18.png +0 -0
- screenshot-19.png +0 -0
- screenshot-2.png +0 -0
- screenshot-20.png +0 -0
- screenshot-21.png +0 -0
- screenshot-22.png +0 -0
- screenshot-23.png +0 -0
- screenshot-24.png +0 -0
- screenshot-25.png +0 -0
- screenshot-26.png +0 -0
- screenshot-3.png +0 -0
- screenshot-4.png +0 -0
- screenshot-5.png +0 -0
- screenshot-6.png +0 -0
- screenshot-7.png +0 -0
- screenshot-8.png +0 -0
- screenshot-9.png +0 -0
- testimonials-widget-admin.php +0 -514
- testimonials-widget-widget.php +0 -130
- testimonials-widget.css +80 -30
- testimonials-widget.php +1208 -232
- wpml-config.xml +16 -0
languages/testimonials-widget-he_IL.mo
ADDED
Binary file
|
languages/testimonials-widget-he_IL.po
ADDED
@@ -0,0 +1,546 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# This file was generated by WPML
|
2 |
+
# WPML is a WordPress plugin that can turn any WordPress or WordPressMU site into a full featured multilingual content management system.
|
3 |
+
# http://wpml.org
|
4 |
+
msgid ""
|
5 |
+
msgstr ""
|
6 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
7 |
+
"Content-Transfer-Encoding: 8bit\n"
|
8 |
+
"Project-Id-Version: Testimonials-Widget\n"
|
9 |
+
"POT-Creation-Date: \n"
|
10 |
+
"PO-Revision-Date: \n"
|
11 |
+
"Last-Translator: Ahrale <contact@atar4u.com>\n"
|
12 |
+
"Language-Team: Ahrale - Atar4U <contact@atar4u.com>\n"
|
13 |
+
"MIME-Version: 1.0\n"
|
14 |
+
"X-Generator: Poedit 1.5.4\n"
|
15 |
+
"Language: he_IL\n"
|
16 |
+
|
17 |
+
# $form_parts['order'] = '<p><label for="' . $this->get_field_id( 'order' ) . '">' . __( 'ORDER BY Order', 'testimonials-widget' ) . '</label>' . $order_select . '</p>';
|
18 |
+
#
|
19 |
+
# $form_parts['random'] = '<p><input type="checkbox" id="' . $this->get_field_id( 'random' ) . '" name="' . $this->get_field_name( 'random' ) . '" value="true"' . checked( $instance['random'], 'true', false ) . ' /> <label for="' . $this->get_field_id( 'random' ) . '">' . __( 'Random order', 'testimonials-widget' ) . '</label><br/><span class="setting-description"><small>' . __( 'Unchecking this will rotate testimonials per ORDER BY and ORDER BY Order', 'testimonials-widget' ) . '</small></span></p>';
|
20 |
+
msgid "Custom text or HTML for bottom of widgets"
|
21 |
+
msgstr "טקסט מותאם אישית או HTML עבור תחתית הוידג'טים"
|
22 |
+
|
23 |
+
# $form_parts['order'] = '<p><label for="' . $this->get_field_id( 'order' ) . '">' . __( 'ORDER BY Order', 'testimonials-widget' ) . '</label>' . $order_select . '</p>';
|
24 |
+
#
|
25 |
+
# $form_parts['random'] = '<p><input type="checkbox" id="' . $this->get_field_id( 'random' ) . '" name="' . $this->get_field_name( 'random' ) . '" value="true"' . checked( $instance['random'], 'true', false ) . ' /> <label for="' . $this->get_field_id( 'random' ) . '">' . __( 'Random order', 'testimonials-widget' ) . '</label><br/><span class="setting-description"><small>' . __( 'Unchecking this will rotate testimonials per ORDER BY and ORDER BY Order', 'testimonials-widget' ) . '</small></span></p>';
|
26 |
+
msgid "Widget Bottom Text"
|
27 |
+
msgstr "טקסט תחתית הוידג'ט"
|
28 |
+
|
29 |
+
# $order_select .= '</select>';
|
30 |
+
#
|
31 |
+
# $form_parts['order'] = '<p><label for="' . $this->get_field_id( 'order' ) . '">' . __( 'ORDER BY Order', 'testimonials-widget' ) . '</label>' . $order_select . '</p>';
|
32 |
+
msgid "Seconds between testimonial rotations or 0 for no refresh"
|
33 |
+
msgstr "שניות בין החלפת עדויות או 0 כדי לא לרענן"
|
34 |
+
|
35 |
+
# $order_select .= '</select>';
|
36 |
+
#
|
37 |
+
# $form_parts['order'] = '<p><label for="' . $this->get_field_id( 'order' ) . '">' . __( 'ORDER BY Order', 'testimonials-widget' ) . '</label>' . $order_select . '</p>';
|
38 |
+
msgid "Rotation Speed"
|
39 |
+
msgstr "מהירות רוטציה"
|
40 |
+
|
41 |
+
# }
|
42 |
+
#
|
43 |
+
# $order_select .= '</select>';
|
44 |
+
msgid ""
|
45 |
+
"Unchecking this will rotate testimonials per ORDER BY and ORDER BY Order"
|
46 |
+
msgstr "ביטול סימון תיבה זו יגרום לסבב עדויות לפי סדר"
|
47 |
+
|
48 |
+
# }
|
49 |
+
#
|
50 |
+
# $order_select .= '</select>';
|
51 |
+
msgid "Random order"
|
52 |
+
msgstr "סדר אקראי"
|
53 |
+
|
54 |
+
# $order_select .= $title;
|
55 |
+
# $order_select .= '</option>';
|
56 |
+
# }
|
57 |
+
msgid "ORDER BY Order"
|
58 |
+
msgstr "סדר לפי סדר"
|
59 |
+
|
60 |
+
#
|
61 |
+
# $form_parts['meta_key'] = '<p><label for="' . $this->get_field_id( 'meta_key' ) . '">' . __( 'Sort by meta key', 'testimonials-widget' ) . '</label>' . $meta_key_select . '<br/><span class="setting-description"><small>' . __( 'Used when Random order is disabled and sorting by a testimonials meta key is needed. Overrides ORDER BY', 'testimonials-widget' ) . '</small></span></p>';
|
62 |
+
#
|
63 |
+
msgid "Ascending"
|
64 |
+
msgstr "סדר עולה"
|
65 |
+
|
66 |
+
# $meta_key_select .= '</select>';
|
67 |
+
#
|
68 |
+
# $form_parts['meta_key'] = '<p><label for="' . $this->get_field_id( 'meta_key' ) . '">' . __( 'Sort by meta key', 'testimonials-widget' ) . '</label>' . $meta_key_select . '<br/><span class="setting-description"><small>' . __( 'Used when Random order is disabled and sorting by a testimonials meta key is needed. Overrides ORDER BY', 'testimonials-widget' ) . '</small></span></p>';
|
69 |
+
msgid "Descending"
|
70 |
+
msgstr "סדר יורד"
|
71 |
+
|
72 |
+
# $meta_key_select .= $title;
|
73 |
+
# $meta_key_select .= '</option>';
|
74 |
+
# }
|
75 |
+
msgid ""
|
76 |
+
"Used when Random order is disabled and sorting by a testimonials meta key is "
|
77 |
+
"needed. Overrides ORDER BY"
|
78 |
+
msgstr ""
|
79 |
+
"בשימוש כאשר הסדר האקראי כבוי ונדרש מיון לפי מפתח תיאור. דורס את סדר לפי"
|
80 |
+
|
81 |
+
# $meta_key_select .= $title;
|
82 |
+
# $meta_key_select .= '</option>';
|
83 |
+
# }
|
84 |
+
msgid "Sort by meta key"
|
85 |
+
msgstr "מיין לפי מפתח תיאור"
|
86 |
+
|
87 |
+
# $orderby_select .= '</select>';
|
88 |
+
#
|
89 |
+
# $form_parts['orderby'] = '<p><label for="' . $this->get_field_id( 'orderby' ) . '">' . __( 'ORDER BY', 'testimonials-widget' ) . '</label>' . $orderby_select . '<br/><span class="setting-description"><small>' . __( 'Used when Random order is disabled', 'testimonials-widget' ) . '</small></span></p>';
|
90 |
+
msgid "None"
|
91 |
+
msgstr "ללא"
|
92 |
+
|
93 |
+
# $orderby_select .= $title;
|
94 |
+
# $orderby_select .= '</option>';
|
95 |
+
# }
|
96 |
+
msgid "Used when Random order is disabled"
|
97 |
+
msgstr "בשימוש כאשר הסדר האקראי כבוי"
|
98 |
+
|
99 |
+
# $orderby_select .= $title;
|
100 |
+
# $orderby_select .= '</option>';
|
101 |
+
# }
|
102 |
+
msgid "ORDER BY"
|
103 |
+
msgstr "סדר לפי"
|
104 |
+
|
105 |
+
# $orderby_select = '<select id="' . $this->get_field_id( 'orderby' ) . '" name="' . $this->get_field_name( 'orderby' ) . '">';
|
106 |
+
# $orderby_options = array(
|
107 |
+
# 'ID' => __( 'Testimonial ID', 'testimonials-widget' ),
|
108 |
+
msgid "No order"
|
109 |
+
msgstr "ללא סדר"
|
110 |
+
|
111 |
+
#
|
112 |
+
# $form_parts['max_height'] = '<p><label for="' . $this->get_field_id( 'max_height' ) . '">' . __('Maximum Height', 'testimonials-widget') . '</label><input size="4" type="text" id="' . $this->get_field_id( 'max_height' ) . '" name="' . $this->get_field_name( 'max_height' ) . '" value="' . htmlspecialchars($instance['max_height'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __('Set for maximum display height', 'testimonials-widget') . '</small></span></p>';
|
113 |
+
#
|
114 |
+
msgid "Author"
|
115 |
+
msgstr "מחבר"
|
116 |
+
|
117 |
+
# $form_parts['min_height'] = '<p><label for="' . $this->get_field_id( 'min_height' ) . '">' . __('Minimum Height', 'testimonials-widget') . '</label><input size="4" type="text" id="' . $this->get_field_id( 'min_height' ) . '" name="' . $this->get_field_name( 'min_height' ) . '" value="' . htmlspecialchars($instance['min_height'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __('Set for minimum display height', 'testimonials-widget') . '</small></span></p>';
|
118 |
+
#
|
119 |
+
# $form_parts['max_height'] = '<p><label for="' . $this->get_field_id( 'max_height' ) . '">' . __('Maximum Height', 'testimonials-widget') . '</label><input size="4" type="text" id="' . $this->get_field_id( 'max_height' ) . '" name="' . $this->get_field_name( 'max_height' ) . '" value="' . htmlspecialchars($instance['max_height'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __('Set for maximum display height', 'testimonials-widget') . '</small></span></p>';
|
120 |
+
msgid "Testimonial ID"
|
121 |
+
msgstr "מזהה עדות"
|
122 |
+
|
123 |
+
# $form_parts['exclude'] = '<p><label for="' . $this->get_field_id( 'exclude' ) . '">' . __( 'Exclude IDs filter', 'testimonials-widget' ) . '</label><input class="widefat" type="text" id="' . $this->get_field_id( 'exclude' ) . '" name="' . $this->get_field_name( 'exclude' ) . '" value="' . htmlspecialchars($instance['exclude'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __( 'Comma separated IDs', 'testimonials-widget' ) . '</small></span></p>';
|
124 |
+
#
|
125 |
+
# $form_parts['limit'] = '<p><label for="' . $this->get_field_id( 'limit' ) . '">' . __( 'Limit', 'testimonials-widget' ) . '</label><input size="4" type="text" id="' . $this->get_field_id( 'limit' ) . '" name="' . $this->get_field_name( 'limit' ) . '" value="' . htmlspecialchars($instance['limit'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __( 'Number of testimonials to rotate through', 'testimonials-widget' ) . '</small></span></p>';
|
126 |
+
msgid "Set for maximum display height"
|
127 |
+
msgstr "הגדר לגובה התצוגה המירבי"
|
128 |
+
|
129 |
+
# $form_parts['exclude'] = '<p><label for="' . $this->get_field_id( 'exclude' ) . '">' . __( 'Exclude IDs filter', 'testimonials-widget' ) . '</label><input class="widefat" type="text" id="' . $this->get_field_id( 'exclude' ) . '" name="' . $this->get_field_name( 'exclude' ) . '" value="' . htmlspecialchars($instance['exclude'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __( 'Comma separated IDs', 'testimonials-widget' ) . '</small></span></p>';
|
130 |
+
#
|
131 |
+
# $form_parts['limit'] = '<p><label for="' . $this->get_field_id( 'limit' ) . '">' . __( 'Limit', 'testimonials-widget' ) . '</label><input size="4" type="text" id="' . $this->get_field_id( 'limit' ) . '" name="' . $this->get_field_name( 'limit' ) . '" value="' . htmlspecialchars($instance['limit'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __( 'Number of testimonials to rotate through', 'testimonials-widget' ) . '</small></span></p>';
|
132 |
+
msgid "Maximum Height"
|
133 |
+
msgstr "גובה מירבי"
|
134 |
+
|
135 |
+
# $form_parts['ids'] = '<p><label for="' . $this->get_field_id( 'ids' ) . '">' . __( 'IDs filter', 'testimonials-widget' ) . '</label><input class="widefat" type="text" id="' . $this->get_field_id( 'ids' ) . '" name="' . $this->get_field_name( 'ids' ) . '" value="' . htmlspecialchars($instance['ids'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __( 'Comma separated IDs', 'testimonials-widget' ) . '</small></span></p>';
|
136 |
+
#
|
137 |
+
# $form_parts['exclude'] = '<p><label for="' . $this->get_field_id( 'exclude' ) . '">' . __( 'Exclude IDs filter', 'testimonials-widget' ) . '</label><input class="widefat" type="text" id="' . $this->get_field_id( 'exclude' ) . '" name="' . $this->get_field_name( 'exclude' ) . '" value="' . htmlspecialchars($instance['exclude'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __( 'Comma separated IDs', 'testimonials-widget' ) . '</small></span></p>';
|
138 |
+
msgid "Set for minimum display height"
|
139 |
+
msgstr "הגדר לגובה התצוגה המינימלי"
|
140 |
+
|
141 |
+
# $form_parts['ids'] = '<p><label for="' . $this->get_field_id( 'ids' ) . '">' . __( 'IDs filter', 'testimonials-widget' ) . '</label><input class="widefat" type="text" id="' . $this->get_field_id( 'ids' ) . '" name="' . $this->get_field_name( 'ids' ) . '" value="' . htmlspecialchars($instance['ids'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __( 'Comma separated IDs', 'testimonials-widget' ) . '</small></span></p>';
|
142 |
+
#
|
143 |
+
# $form_parts['exclude'] = '<p><label for="' . $this->get_field_id( 'exclude' ) . '">' . __( 'Exclude IDs filter', 'testimonials-widget' ) . '</label><input class="widefat" type="text" id="' . $this->get_field_id( 'exclude' ) . '" name="' . $this->get_field_name( 'exclude' ) . '" value="' . htmlspecialchars($instance['exclude'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __( 'Comma separated IDs', 'testimonials-widget' ) . '</small></span></p>';
|
144 |
+
msgid "Minimum Height"
|
145 |
+
msgstr "גובה מינימלי"
|
146 |
+
|
147 |
+
# $form_parts['char_limit'] = '<p><label for="' . $this->get_field_id( 'char_limit' ) . '">' . __( 'Character limit', 'testimonials-widget' ) . '</label><input size="4" type="text" id="' . $this->get_field_id( 'char_limit' ) . '" name="' . $this->get_field_name( 'char_limit' ) . '" value="' . htmlspecialchars($instance['char_limit'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __( 'Number of characters to limit testimonial views to', 'testimonials-widget' ) . '</small></span></p>';
|
148 |
+
#
|
149 |
+
# $form_parts['ids'] = '<p><label for="' . $this->get_field_id( 'ids' ) . '">' . __( 'IDs filter', 'testimonials-widget' ) . '</label><input class="widefat" type="text" id="' . $this->get_field_id( 'ids' ) . '" name="' . $this->get_field_name( 'ids' ) . '" value="' . htmlspecialchars($instance['ids'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __( 'Comma separated IDs', 'testimonials-widget' ) . '</small></span></p>';
|
150 |
+
msgid "Number of testimonials to rotate through"
|
151 |
+
msgstr "מספר העדויות בסבב"
|
152 |
+
|
153 |
+
# $form_parts['char_limit'] = '<p><label for="' . $this->get_field_id( 'char_limit' ) . '">' . __( 'Character limit', 'testimonials-widget' ) . '</label><input size="4" type="text" id="' . $this->get_field_id( 'char_limit' ) . '" name="' . $this->get_field_name( 'char_limit' ) . '" value="' . htmlspecialchars($instance['char_limit'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __( 'Number of characters to limit testimonial views to', 'testimonials-widget' ) . '</small></span></p>';
|
154 |
+
#
|
155 |
+
# $form_parts['ids'] = '<p><label for="' . $this->get_field_id( 'ids' ) . '">' . __( 'IDs filter', 'testimonials-widget' ) . '</label><input class="widefat" type="text" id="' . $this->get_field_id( 'ids' ) . '" name="' . $this->get_field_name( 'ids' ) . '" value="' . htmlspecialchars($instance['ids'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __( 'Comma separated IDs', 'testimonials-widget' ) . '</small></span></p>';
|
156 |
+
msgid "Limit"
|
157 |
+
msgstr "הגבל"
|
158 |
+
|
159 |
+
# $form_parts['target'] = '<p><label for="' . $this->get_field_id( 'target' ) . '">' . __( 'URL Target', 'testimonials-widget' ) . '</label><input size="15" type="text" id="' . $this->get_field_id( 'target' ) . '" name="' . $this->get_field_name( 'target' ) . '" value="' . htmlspecialchars($instance['target'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __( 'Leave blank if none', 'testimonials-widget' ) . '</small></span></p>';
|
160 |
+
#
|
161 |
+
# $form_parts['char_limit'] = '<p><label for="' . $this->get_field_id( 'char_limit' ) . '">' . __( 'Character limit', 'testimonials-widget' ) . '</label><input size="4" type="text" id="' . $this->get_field_id( 'char_limit' ) . '" name="' . $this->get_field_name( 'char_limit' ) . '" value="' . htmlspecialchars($instance['char_limit'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __( 'Number of characters to limit testimonial views to', 'testimonials-widget' ) . '</small></span></p>';
|
162 |
+
msgid "Comma separated IDs"
|
163 |
+
msgstr "מזהים מופרדים בפסיק"
|
164 |
+
|
165 |
+
# $form_parts['target'] = '<p><label for="' . $this->get_field_id( 'target' ) . '">' . __( 'URL Target', 'testimonials-widget' ) . '</label><input size="15" type="text" id="' . $this->get_field_id( 'target' ) . '" name="' . $this->get_field_name( 'target' ) . '" value="' . htmlspecialchars($instance['target'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __( 'Leave blank if none', 'testimonials-widget' ) . '</small></span></p>';
|
166 |
+
#
|
167 |
+
# $form_parts['char_limit'] = '<p><label for="' . $this->get_field_id( 'char_limit' ) . '">' . __( 'Character limit', 'testimonials-widget' ) . '</label><input size="4" type="text" id="' . $this->get_field_id( 'char_limit' ) . '" name="' . $this->get_field_name( 'char_limit' ) . '" value="' . htmlspecialchars($instance['char_limit'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __( 'Number of characters to limit testimonial views to', 'testimonials-widget' ) . '</small></span></p>';
|
168 |
+
msgid "IDs filter"
|
169 |
+
msgstr "מסנן מזהים"
|
170 |
+
|
171 |
+
# $form_parts['hide_url'] = '<p><input type="checkbox" id="' . $this->get_field_id( 'hide_url' ) . '" name="' . $this->get_field_name( 'hide_url' ) . '" value="true"' . checked( $instance['hide_url'], 'true', false ) . ' /> <label for="' . $this->get_field_id( 'hide_url' ) . '">' . __( 'Hide URL?', 'testimonials-widget' ) . '</label></p>';
|
172 |
+
#
|
173 |
+
# $form_parts['target'] = '<p><label for="' . $this->get_field_id( 'target' ) . '">' . __( 'URL Target', 'testimonials-widget' ) . '</label><input size="15" type="text" id="' . $this->get_field_id( 'target' ) . '" name="' . $this->get_field_name( 'target' ) . '" value="' . htmlspecialchars($instance['target'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __( 'Leave blank if none', 'testimonials-widget' ) . '</small></span></p>';
|
174 |
+
msgid "Number of characters to limit testimonial views to"
|
175 |
+
msgstr "מספר התווים המירבי בתצוגת עדות"
|
176 |
+
|
177 |
+
# $form_parts['hide_url'] = '<p><input type="checkbox" id="' . $this->get_field_id( 'hide_url' ) . '" name="' . $this->get_field_name( 'hide_url' ) . '" value="true"' . checked( $instance['hide_url'], 'true', false ) . ' /> <label for="' . $this->get_field_id( 'hide_url' ) . '">' . __( 'Hide URL?', 'testimonials-widget' ) . '</label></p>';
|
178 |
+
#
|
179 |
+
# $form_parts['target'] = '<p><label for="' . $this->get_field_id( 'target' ) . '">' . __( 'URL Target', 'testimonials-widget' ) . '</label><input size="15" type="text" id="' . $this->get_field_id( 'target' ) . '" name="' . $this->get_field_name( 'target' ) . '" value="' . htmlspecialchars($instance['target'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __( 'Leave blank if none', 'testimonials-widget' ) . '</small></span></p>';
|
180 |
+
msgid "Character limit"
|
181 |
+
msgstr "הגבלת תווים"
|
182 |
+
|
183 |
+
# $form_parts['hide_company'] = '<p><input type="checkbox" id="' . $this->get_field_id( 'hide_company' ) . '" name="' . $this->get_field_name( 'hide_company' ) . '" value="true"' . checked( $instance['hide_company'], 'true', false ) . ' /> <label for="' . $this->get_field_id( 'hide_company' ) . '">' . __( 'Hide company?', 'testimonials-widget' ) . '</label></p>';
|
184 |
+
#
|
185 |
+
# $form_parts['hide_url'] = '<p><input type="checkbox" id="' . $this->get_field_id( 'hide_url' ) . '" name="' . $this->get_field_name( 'hide_url' ) . '" value="true"' . checked( $instance['hide_url'], 'true', false ) . ' /> <label for="' . $this->get_field_id( 'hide_url' ) . '">' . __( 'Hide URL?', 'testimonials-widget' ) . '</label></p>';
|
186 |
+
msgid "Leave blank if none"
|
187 |
+
msgstr "השאר ריק אם לא"
|
188 |
+
|
189 |
+
# $form_parts['hide_company'] = '<p><input type="checkbox" id="' . $this->get_field_id( 'hide_company' ) . '" name="' . $this->get_field_name( 'hide_company' ) . '" value="true"' . checked( $instance['hide_company'], 'true', false ) . ' /> <label for="' . $this->get_field_id( 'hide_company' ) . '">' . __( 'Hide company?', 'testimonials-widget' ) . '</label></p>';
|
190 |
+
#
|
191 |
+
# $form_parts['hide_url'] = '<p><input type="checkbox" id="' . $this->get_field_id( 'hide_url' ) . '" name="' . $this->get_field_name( 'hide_url' ) . '" value="true"' . checked( $instance['hide_url'], 'true', false ) . ' /> <label for="' . $this->get_field_id( 'hide_url' ) . '">' . __( 'Hide URL?', 'testimonials-widget' ) . '</label></p>';
|
192 |
+
msgid "URL Target"
|
193 |
+
msgstr "כתובת יעד URL"
|
194 |
+
|
195 |
+
# $form_parts['hide_email'] = '<p><input type="checkbox" id="' . $this->get_field_id( 'hide_email' ) . '" name="' . $this->get_field_name( 'hide_email' ) . '" value="true"' . checked( $instance['hide_email'], 'true', false ) . ' /> <label for="' . $this->get_field_id( 'hide_email' ) . '">' . __( 'Hide email?', 'testimonials-widget' ) . '</label></p>';
|
196 |
+
#
|
197 |
+
# $form_parts['hide_company'] = '<p><input type="checkbox" id="' . $this->get_field_id( 'hide_company' ) . '" name="' . $this->get_field_name( 'hide_company' ) . '" value="true"' . checked( $instance['hide_company'], 'true', false ) . ' /> <label for="' . $this->get_field_id( 'hide_company' ) . '">' . __( 'Hide company?', 'testimonials-widget' ) . '</label></p>';
|
198 |
+
msgid "Hide URL?"
|
199 |
+
msgstr "האם להסתיר כתובת URL?"
|
200 |
+
|
201 |
+
# $form_parts['hide_source'] = '<p><input type="checkbox" id="' . $this->get_field_id( 'hide_source' ) . '" name="' . $this->get_field_name( 'hide_source' ) . '" value="true"' . checked( $instance['hide_source'], 'true', false ) . ' /> <label for="' . $this->get_field_id( 'hide_source' ) . '">' . __( 'Hide source?', 'testimonials-widget' ) . '</label></p>';
|
202 |
+
#
|
203 |
+
# $form_parts['hide_email'] = '<p><input type="checkbox" id="' . $this->get_field_id( 'hide_email' ) . '" name="' . $this->get_field_name( 'hide_email' ) . '" value="true"' . checked( $instance['hide_email'], 'true', false ) . ' /> <label for="' . $this->get_field_id( 'hide_email' ) . '">' . __( 'Hide email?', 'testimonials-widget' ) . '</label></p>';
|
204 |
+
msgid "Hide company?"
|
205 |
+
msgstr "האם להסתיר חברה?"
|
206 |
+
|
207 |
+
# $form_parts['hide_title'] = '<p><input type="checkbox" id="' . $this->get_field_id( 'hide_title' ) . '" name="' . $this->get_field_name( 'hide_title' ) . '" value="true"' . checked( $instance['hide_title'], 'true', false ) . ' /> <label for="' . $this->get_field_id( 'hide_title' ) . '">' . __( 'Hide title?', 'testimonials-widget' ) . '</label></p>';
|
208 |
+
#
|
209 |
+
# $form_parts['hide_source'] = '<p><input type="checkbox" id="' . $this->get_field_id( 'hide_source' ) . '" name="' . $this->get_field_name( 'hide_source' ) . '" value="true"' . checked( $instance['hide_source'], 'true', false ) . ' /> <label for="' . $this->get_field_id( 'hide_source' ) . '">' . __( 'Hide source?', 'testimonials-widget' ) . '</label></p>';
|
210 |
+
msgid "Hide email?"
|
211 |
+
msgstr "האם להסתיר מייל?"
|
212 |
+
|
213 |
+
# $form_parts['hide_not_found'] = '<p><input type="checkbox" id="' . $this->get_field_id( 'hide_not_found' ) . '" name="' . $this->get_field_name( 'hide_not_found' ) . '" value="true"' . checked( $instance['hide_not_found'], 'true', false ) . ' /> <label for="' . $this->get_field_id( 'hide_not_found' ) . '">' . __( 'Hide testimonials not found?', 'testimonials-widget' ) . '</label></p>';
|
214 |
+
#
|
215 |
+
# $form_parts['hide_title'] = '<p><input type="checkbox" id="' . $this->get_field_id( 'hide_title' ) . '" name="' . $this->get_field_name( 'hide_title' ) . '" value="true"' . checked( $instance['hide_title'], 'true', false ) . ' /> <label for="' . $this->get_field_id( 'hide_title' ) . '">' . __( 'Hide title?', 'testimonials-widget' ) . '</label></p>';
|
216 |
+
msgid "Hide source?"
|
217 |
+
msgstr "האם להסתיר מקור?"
|
218 |
+
|
219 |
+
# $form_parts['hide_image'] = '<p><input type="checkbox" id="' . $this->get_field_id( 'hide_image' ) . '" name="' . $this->get_field_name( 'hide_image' ) . '" value="true"' . checked( $instance['hide_image'], 'true', false ) . ' /> <label for="' . $this->get_field_id( 'hide_image' ) . '">' . __( 'Hide image?', 'testimonials-widget' ) . '</label></p>';
|
220 |
+
#
|
221 |
+
# $form_parts['hide_not_found'] = '<p><input type="checkbox" id="' . $this->get_field_id( 'hide_not_found' ) . '" name="' . $this->get_field_name( 'hide_not_found' ) . '" value="true"' . checked( $instance['hide_not_found'], 'true', false ) . ' /> <label for="' . $this->get_field_id( 'hide_not_found' ) . '">' . __( 'Hide testimonials not found?', 'testimonials-widget' ) . '</label></p>';
|
222 |
+
msgid "Hide title?"
|
223 |
+
msgstr "האם להסתיר כותרת?"
|
224 |
+
|
225 |
+
# $form_parts['hide_gravatar'] = '<p><input type="checkbox" id="' . $this->get_field_id( 'hide_gravatar' ) . '" name="' . $this->get_field_name( 'hide_gravatar' ) . '" value="true"' . checked( $instance['hide_gravatar'], 'true', false ) . ' /> <label for="' . $this->get_field_id( 'hide_gravatar' ) . '">' . __( 'Hide gravatar?', 'testimonials-widget' ) . '</label></p>';
|
226 |
+
#
|
227 |
+
# $form_parts['hide_image'] = '<p><input type="checkbox" id="' . $this->get_field_id( 'hide_image' ) . '" name="' . $this->get_field_name( 'hide_image' ) . '" value="true"' . checked( $instance['hide_image'], 'true', false ) . ' /> <label for="' . $this->get_field_id( 'hide_image' ) . '">' . __( 'Hide image?', 'testimonials-widget' ) . '</label></p>';
|
228 |
+
msgid "Hide testimonials not found?"
|
229 |
+
msgstr "האם להסתיר עדות שלא נמצאת?"
|
230 |
+
|
231 |
+
# $form_parts['adv_opts'] = '<div id="' . $this->get_field_id( 'adv_opts' ) . '" style="display:none">';
|
232 |
+
#
|
233 |
+
# $form_parts['hide_gravatar'] = '<p><input type="checkbox" id="' . $this->get_field_id( 'hide_gravatar' ) . '" name="' . $this->get_field_name( 'hide_gravatar' ) . '" value="true"' . checked( $instance['hide_gravatar'], 'true', false ) . ' /> <label for="' . $this->get_field_id( 'hide_gravatar' ) . '">' . __( 'Hide gravatar?', 'testimonials-widget' ) . '</label></p>';
|
234 |
+
msgid "Hide image?"
|
235 |
+
msgstr "האם להסתיר תמונה?"
|
236 |
+
|
237 |
+
# $form_parts['adv_key'] = "<p style=\"text-align:left;\"><small><a id=\"" . $this->get_field_id( 'adv_key' ) . "\" style=\"cursor:pointer;\" onclick=\"jQuery( 'div#" . $this->get_field_id( 'adv_opts' ) . "' ) . slideToggle();\">" . __( 'Advanced Options', 'testimonials-widget' ) . " »</a></small></p>";
|
238 |
+
#
|
239 |
+
# $form_parts['adv_opts'] = '<div id="' . $this->get_field_id( 'adv_opts' ) . '" style="display:none">';
|
240 |
+
msgid "Hide gravatar?"
|
241 |
+
msgstr "האם להסתיר צלמית משתמש?"
|
242 |
+
|
243 |
+
# $form_parts['tags_all'] = '<p><input type="checkbox" id="' . $this->get_field_id( 'tags_all' ) . '" name="' . $this->get_field_name( 'tags_all' ) . '" value="true"' . checked( $instance['tags_all'], 'true', false ) . ' /> <label for="' . $this->get_field_id( 'tags_all' ) . '">' . __( 'Require all tags', 'testimonials-widget' ) . '</label><br/><span class="setting-description"><small>' . __( 'Select only testimonials with all of the given tags', 'testimonials-widget' ) . '</small></span></p>';
|
244 |
+
#
|
245 |
+
# $form_parts['keep_whitespace'] = '<p><input type="checkbox" id="' . $this->get_field_id( 'keep_whitespace' ) . '" name="' . $this->get_field_name( 'keep_whitespace' ) . '" value="true"' . checked( $instance['keep_whitespace'], 'true', false ) . ' /> <label for="' . $this->get_field_id( 'keep_whitespace' ) . '">' . __( 'Keep whitespace?', 'testimonials-widget' ) . '</label><br/><span class="setting-description"><small>' . __( 'Keeps testimonials looking as entered than sans auto-formatting', 'testimonials-widget' ) . '</small></span></p>';
|
246 |
+
msgid "Advanced Options"
|
247 |
+
msgstr "אפשרויות מתקדמות"
|
248 |
+
|
249 |
+
# $form_parts['tags'] = '<p><label for="' . $this->get_field_id( 'tags' ) . '">' . __( 'Tags filter', 'testimonials-widget' ) . '</label><input class="widefat" type="text" id="' . $this->get_field_id( 'tags' ) . '" name="' . $this->get_field_name( 'tags' ) . '" value="' . htmlspecialchars($instance['tags'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __( 'Comma separated tag slug-names', 'testimonials-widget' ) . '</small></span></p>';
|
250 |
+
#
|
251 |
+
# $form_parts['tags_all'] = '<p><input type="checkbox" id="' . $this->get_field_id( 'tags_all' ) . '" name="' . $this->get_field_name( 'tags_all' ) . '" value="true"' . checked( $instance['tags_all'], 'true', false ) . ' /> <label for="' . $this->get_field_id( 'tags_all' ) . '">' . __( 'Require all tags', 'testimonials-widget' ) . '</label><br/><span class="setting-description"><small>' . __( 'Select only testimonials with all of the given tags', 'testimonials-widget' ) . '</small></span></p>';
|
252 |
+
msgid "Keeps testimonials looking as entered than sans auto-formatting"
|
253 |
+
msgstr "שומר עדויות הנראות כמוזנות עם עיצוב אוטומטי"
|
254 |
+
|
255 |
+
# $form_parts['tags'] = '<p><label for="' . $this->get_field_id( 'tags' ) . '">' . __( 'Tags filter', 'testimonials-widget' ) . '</label><input class="widefat" type="text" id="' . $this->get_field_id( 'tags' ) . '" name="' . $this->get_field_name( 'tags' ) . '" value="' . htmlspecialchars($instance['tags'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __( 'Comma separated tag slug-names', 'testimonials-widget' ) . '</small></span></p>';
|
256 |
+
#
|
257 |
+
# $form_parts['tags_all'] = '<p><input type="checkbox" id="' . $this->get_field_id( 'tags_all' ) . '" name="' . $this->get_field_name( 'tags_all' ) . '" value="true"' . checked( $instance['tags_all'], 'true', false ) . ' /> <label for="' . $this->get_field_id( 'tags_all' ) . '">' . __( 'Require all tags', 'testimonials-widget' ) . '</label><br/><span class="setting-description"><small>' . __( 'Select only testimonials with all of the given tags', 'testimonials-widget' ) . '</small></span></p>';
|
258 |
+
msgid "Keep whitespace?"
|
259 |
+
msgstr "להשאיר רווח לבן?"
|
260 |
+
|
261 |
+
# $form_parts['category'] = '<p><label for="' . $this->get_field_id( 'category' ) . '">' . __( 'Category filter', 'testimonials-widget' ) . '</label><input class="widefat" type="text" id="' . $this->get_field_id( 'category' ) . '" name="' . $this->get_field_name( 'category' ) . '" value="' . htmlspecialchars($instance['category'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __( 'Comma separated category slug-names', 'testimonials-widget' ) . '</small></span></p>';
|
262 |
+
#
|
263 |
+
# $form_parts['tags'] = '<p><label for="' . $this->get_field_id( 'tags' ) . '">' . __( 'Tags filter', 'testimonials-widget' ) . '</label><input class="widefat" type="text" id="' . $this->get_field_id( 'tags' ) . '" name="' . $this->get_field_name( 'tags' ) . '" value="' . htmlspecialchars($instance['tags'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __( 'Comma separated tag slug-names', 'testimonials-widget' ) . '</small></span></p>';
|
264 |
+
msgid "Select only testimonials with all of the given tags"
|
265 |
+
msgstr "בחר רק עדויות עם כל התגיות שצוינו"
|
266 |
+
|
267 |
+
# $form_parts['category'] = '<p><label for="' . $this->get_field_id( 'category' ) . '">' . __( 'Category filter', 'testimonials-widget' ) . '</label><input class="widefat" type="text" id="' . $this->get_field_id( 'category' ) . '" name="' . $this->get_field_name( 'category' ) . '" value="' . htmlspecialchars($instance['category'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __( 'Comma separated category slug-names', 'testimonials-widget' ) . '</small></span></p>';
|
268 |
+
#
|
269 |
+
# $form_parts['tags'] = '<p><label for="' . $this->get_field_id( 'tags' ) . '">' . __( 'Tags filter', 'testimonials-widget' ) . '</label><input class="widefat" type="text" id="' . $this->get_field_id( 'tags' ) . '" name="' . $this->get_field_name( 'tags' ) . '" value="' . htmlspecialchars($instance['tags'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __( 'Comma separated tag slug-names', 'testimonials-widget' ) . '</small></span></p>';
|
270 |
+
msgid "Require all tags"
|
271 |
+
msgstr "דרוש את כל התגיות"
|
272 |
+
|
273 |
+
# $form_parts['title_link'] = '<p><label for="' . $this->get_field_id( 'title_link' ) . '">' . __( 'Title link', 'testimonials-widget' ) . '</label><input class="widefat" type="text" id="' . $this->get_field_id( 'title_link' ) . '" name="' . $this->get_field_name( 'title_link' ) . '" value="' . htmlspecialchars($instance['title_link'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __( 'URL or Post ID to link widget title to', 'testimonials-widget' ) . '</small></span></p>';
|
274 |
+
#
|
275 |
+
# $form_parts['category'] = '<p><label for="' . $this->get_field_id( 'category' ) . '">' . __( 'Category filter', 'testimonials-widget' ) . '</label><input class="widefat" type="text" id="' . $this->get_field_id( 'category' ) . '" name="' . $this->get_field_name( 'category' ) . '" value="' . htmlspecialchars($instance['category'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __( 'Comma separated category slug-names', 'testimonials-widget' ) . '</small></span></p>';
|
276 |
+
msgid "Comma separated tag slug-names"
|
277 |
+
msgstr "שמות סלאג תגיות מופרדים בפסיק"
|
278 |
+
|
279 |
+
# $form_parts['title_link'] = '<p><label for="' . $this->get_field_id( 'title_link' ) . '">' . __( 'Title link', 'testimonials-widget' ) . '</label><input class="widefat" type="text" id="' . $this->get_field_id( 'title_link' ) . '" name="' . $this->get_field_name( 'title_link' ) . '" value="' . htmlspecialchars($instance['title_link'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __( 'URL or Post ID to link widget title to', 'testimonials-widget' ) . '</small></span></p>';
|
280 |
+
#
|
281 |
+
# $form_parts['category'] = '<p><label for="' . $this->get_field_id( 'category' ) . '">' . __( 'Category filter', 'testimonials-widget' ) . '</label><input class="widefat" type="text" id="' . $this->get_field_id( 'category' ) . '" name="' . $this->get_field_name( 'category' ) . '" value="' . htmlspecialchars($instance['category'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __( 'Comma separated category slug-names', 'testimonials-widget' ) . '</small></span></p>';
|
282 |
+
msgid "Tags filter"
|
283 |
+
msgstr "מסנן תגיות"
|
284 |
+
|
285 |
+
# $form_parts['title'] = '<p><label for="' . $this->get_field_id( 'title' ) . '">' . __( 'Title', 'testimonials-widget' ) . '</label><input class="widefat" type="text" id="' . $this->get_field_id( 'title' ) . '" name="' . $this->get_field_name( 'title' ) . '" value="' . htmlspecialchars($instance['title'], ENT_QUOTES) . '" /></p>';
|
286 |
+
#
|
287 |
+
# $form_parts['title_link'] = '<p><label for="' . $this->get_field_id( 'title_link' ) . '">' . __( 'Title link', 'testimonials-widget' ) . '</label><input class="widefat" type="text" id="' . $this->get_field_id( 'title_link' ) . '" name="' . $this->get_field_name( 'title_link' ) . '" value="' . htmlspecialchars($instance['title_link'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __( 'URL or Post ID to link widget title to', 'testimonials-widget' ) . '</small></span></p>';
|
288 |
+
msgid "Comma separated category slug-names"
|
289 |
+
msgstr "שמות סלאג קטגוריה מופרדים בפסיק"
|
290 |
+
|
291 |
+
# $form_parts['title'] = '<p><label for="' . $this->get_field_id( 'title' ) . '">' . __( 'Title', 'testimonials-widget' ) . '</label><input class="widefat" type="text" id="' . $this->get_field_id( 'title' ) . '" name="' . $this->get_field_name( 'title' ) . '" value="' . htmlspecialchars($instance['title'], ENT_QUOTES) . '" /></p>';
|
292 |
+
#
|
293 |
+
# $form_parts['title_link'] = '<p><label for="' . $this->get_field_id( 'title_link' ) . '">' . __( 'Title link', 'testimonials-widget' ) . '</label><input class="widefat" type="text" id="' . $this->get_field_id( 'title_link' ) . '" name="' . $this->get_field_name( 'title_link' ) . '" value="' . htmlspecialchars($instance['title_link'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __( 'URL or Post ID to link widget title to', 'testimonials-widget' ) . '</small></span></p>';
|
294 |
+
msgid "Category filter"
|
295 |
+
msgstr "מסנן קטגוריה"
|
296 |
+
|
297 |
+
# $form_parts = array();
|
298 |
+
#
|
299 |
+
# $form_parts['title'] = '<p><label for="' . $this->get_field_id( 'title' ) . '">' . __( 'Title', 'testimonials-widget' ) . '</label><input class="widefat" type="text" id="' . $this->get_field_id( 'title' ) . '" name="' . $this->get_field_name( 'title' ) . '" value="' . htmlspecialchars($instance['title'], ENT_QUOTES) . '" /></p>';
|
300 |
+
msgid "URL or Post ID to link widget title to"
|
301 |
+
msgstr "כתובת URL או מזהה פוסט אליו יתקושר כותרת הוידג'ט"
|
302 |
+
|
303 |
+
# $form_parts = array();
|
304 |
+
#
|
305 |
+
# $form_parts['title'] = '<p><label for="' . $this->get_field_id( 'title' ) . '">' . __( 'Title', 'testimonials-widget' ) . '</label><input class="widefat" type="text" id="' . $this->get_field_id( 'title' ) . '" name="' . $this->get_field_name( 'title' ) . '" value="' . htmlspecialchars($instance['title'], ENT_QUOTES) . '" /></p>';
|
306 |
+
msgid "Title link"
|
307 |
+
msgstr "קישור כותרת"
|
308 |
+
|
309 |
+
# 'testimonials_widget',
|
310 |
+
# __( 'Testimonials Widget', 'testimonials-widget' ),
|
311 |
+
# $widget_ops,
|
312 |
+
msgid "Testimonials Widget"
|
313 |
+
msgstr "וידג'ט עדויות"
|
314 |
+
|
315 |
+
# 'classname' => 'Testimonials_Widget_Widget',
|
316 |
+
# 'description' => __( 'Display testimonials with multiple selection and display options', 'testimonials-widget' )
|
317 |
+
# );
|
318 |
+
msgid "Display testimonials with multiple selection and display options"
|
319 |
+
msgstr "מציג עדויות עם בחירה מרובה ואפשרויות תצוגה"
|
320 |
+
|
321 |
+
# 'testimonial_url' => $url,
|
322 |
+
# );
|
323 |
+
#
|
324 |
+
msgid ""
|
325 |
+
"Testimonial draft updated. <a target=\"_blank\" href=\"%s\">Preview "
|
326 |
+
"testimonial</a>"
|
327 |
+
msgstr ""
|
328 |
+
"טיוטת העדות עודכנה. <a target=\"_blank\" href=\"%s\">תצוגה מוקדמת של העדות</"
|
329 |
+
"a>"
|
330 |
+
|
331 |
+
# 'testimonial_title' => get_post_meta( $post_id, 'testimonials-widget-title', true ),
|
332 |
+
# 'testimonial_url' => $url,
|
333 |
+
# );
|
334 |
+
msgid ""
|
335 |
+
"Testimonial scheduled for: <strong>%1$s</strong>. <a target=\"_blank\" href="
|
336 |
+
"\"%2$s\">Preview testimonial</a>"
|
337 |
+
msgstr ""
|
338 |
+
"עדות מתוזמנת עבור: <strong>%1$s</strong>. <a target=\"_blank\" href=\"%2$s"
|
339 |
+
"\">תצוגה מוקדמת של העדות</a>"
|
340 |
+
|
341 |
+
# 'testimonial_source' => $row->post_title,
|
342 |
+
# 'testimonial_title' => get_post_meta( $post_id, 'testimonials-widget-title', true ),
|
343 |
+
# 'testimonial_url' => $url,
|
344 |
+
msgid ""
|
345 |
+
"Testimonial submitted. <a target=\"_blank\" href=\"%s\">Preview testimonial</"
|
346 |
+
"a>"
|
347 |
+
msgstr ""
|
348 |
+
"העדות נשלחה. <a target=\"_blank\" href=\"%s\">תצוגה מוקדמת של העדות</a>"
|
349 |
+
|
350 |
+
# 'testimonial_image' => $image,
|
351 |
+
# 'testimonial_source' => $row->post_title,
|
352 |
+
# 'testimonial_title' => get_post_meta( $post_id, 'testimonials-widget-title', true ),
|
353 |
+
msgid "Testimonial saved."
|
354 |
+
msgstr "העדות נשמרה."
|
355 |
+
|
356 |
+
# 'testimonial_extra' => '',
|
357 |
+
# 'testimonial_image' => $image,
|
358 |
+
# 'testimonial_source' => $row->post_title,
|
359 |
+
msgid "Testimonial published. <a href=\"%s\">View testimonial</a>"
|
360 |
+
msgstr "העדות פורסמה. <a href=\"%s\">הצג את העדות</a>"
|
361 |
+
|
362 |
+
# 'testimonial_email' => $email,
|
363 |
+
# 'testimonial_extra' => '',
|
364 |
+
# 'testimonial_image' => $image,
|
365 |
+
msgid "Testimonial restored to revision from %s"
|
366 |
+
msgstr "העדות שוחזרה למהדורה מ %s"
|
367 |
+
|
368 |
+
# 'testimonial_company' => get_post_meta( $post_id, 'testimonials-widget-company', true ),
|
369 |
+
# 'testimonial_content' => $row->post_content,
|
370 |
+
# 'testimonial_email' => $email,
|
371 |
+
msgid "Testimonial updated."
|
372 |
+
msgstr "העדות עודכנה."
|
373 |
+
|
374 |
+
# 'post_id' => $post_id,
|
375 |
+
# 'testimonial_company' => get_post_meta( $post_id, 'testimonials-widget-company', true ),
|
376 |
+
# 'testimonial_content' => $row->post_content,
|
377 |
+
msgid "Custom field deleted."
|
378 |
+
msgstr "השדה מותאם אישית נמחק."
|
379 |
+
|
380 |
+
# $data = array(
|
381 |
+
# 'post_id' => $post_id,
|
382 |
+
# 'testimonial_company' => get_post_meta( $post_id, 'testimonials-widget-company', true ),
|
383 |
+
msgid "Custom field updated."
|
384 |
+
msgstr "השדה מותאם אישית עודכן."
|
385 |
+
|
386 |
+
#
|
387 |
+
# $data = array(
|
388 |
+
# 'post_id' => $post_id,
|
389 |
+
msgid "Testimonial updated. <a href=\"%s\">View testimonial</a>"
|
390 |
+
msgstr "העדות עודכנה. <a href=\"%s\">הצג את העדות</a>"
|
391 |
+
|
392 |
+
# $gravatar_size = apply_filters( 'testimonials_widget_gravatar_size', 96 );
|
393 |
+
#
|
394 |
+
# $testimonial_data = array();
|
395 |
+
msgid "Enter testimonial source here"
|
396 |
+
msgstr "הזן כאן את מקור העדות"
|
397 |
+
|
398 |
+
# $image_size = apply_filters( 'testimonials_widget_image_size', 'thumbnail' );
|
399 |
+
# $gravatar_size = apply_filters( 'testimonials_widget_gravatar_size', 96 );
|
400 |
+
#
|
401 |
+
msgid "Enter title here"
|
402 |
+
msgstr "הזן כאן את הכותרת"
|
403 |
+
|
404 |
+
#
|
405 |
+
#
|
406 |
+
# public function get_testimonials( $atts ) {
|
407 |
+
msgid "Testimonial Data"
|
408 |
+
msgstr "נתוני העדות"
|
409 |
+
|
410 |
+
# if ($tag[0] == '&') // Handle HTML entity by copying straight through
|
411 |
+
# {
|
412 |
+
# $output .= $tag;
|
413 |
+
msgid "»"
|
414 |
+
msgstr "»"
|
415 |
+
|
416 |
+
# {
|
417 |
+
# $output .= $func_strcut($text, 0, $max_length - $output_length);
|
418 |
+
# $truncated = true;
|
419 |
+
msgid "«"
|
420 |
+
msgstr "«"
|
421 |
+
|
422 |
+
# $is_first = false;
|
423 |
+
# }
|
424 |
+
#
|
425 |
+
msgid "…"
|
426 |
+
msgstr "…"
|
427 |
+
|
428 |
+
# 'date' => __( 'Date' , 'testimonials-widget' ),
|
429 |
+
# );
|
430 |
+
#
|
431 |
+
msgid "View Testimonial"
|
432 |
+
msgstr "הצג את העדות"
|
433 |
+
|
434 |
+
# 'tags' => __( 'Tags' , 'testimonials-widget' ),
|
435 |
+
# 'date' => __( 'Date' , 'testimonials-widget' ),
|
436 |
+
# );
|
437 |
+
msgid "Testimonial"
|
438 |
+
msgstr "עדות"
|
439 |
+
|
440 |
+
# 'categories' => __( 'Category' , 'testimonials-widget' ),
|
441 |
+
# 'tags' => __( 'Tags' , 'testimonials-widget' ),
|
442 |
+
# 'date' => __( 'Date' , 'testimonials-widget' ),
|
443 |
+
msgid "Search Testimonials"
|
444 |
+
msgstr "חיפוש בעדויות"
|
445 |
+
|
446 |
+
# 'testimonials-widget-url' => __( 'URL' , 'testimonials-widget' ),
|
447 |
+
# 'author' => __( 'Published by' , 'testimonials-widget' ),
|
448 |
+
# 'categories' => __( 'Category' , 'testimonials-widget' ),
|
449 |
+
msgid "No testimonials found in Trash"
|
450 |
+
msgstr "לא נמצאו עדויות באשפה"
|
451 |
+
|
452 |
+
# $target = ( preg_match( '#^\w+$#', $atts['target'] ) ) ? $atts['target'] : false;
|
453 |
+
#
|
454 |
+
# $html = '';
|
455 |
+
msgid "No testimonials found"
|
456 |
+
msgstr "לא נמצאו עדויות"
|
457 |
+
|
458 |
+
# 'shortcode' => __( 'Shortcodes' , 'testimonials-widget' ),
|
459 |
+
# 'testimonials-widget-title' => __( 'Title' , 'testimonials-widget' ),
|
460 |
+
# 'testimonials-widget-email' => __( 'Email' , 'testimonials-widget' ),
|
461 |
+
msgid "Edit Testimonial"
|
462 |
+
msgstr "ערוך עדות"
|
463 |
+
|
464 |
+
# 'testimonials-widget-email' => __( 'Email' , 'testimonials-widget' ),
|
465 |
+
# 'testimonials-widget-company' => __( 'Company' , 'testimonials-widget' ),
|
466 |
+
# 'testimonials-widget-url' => __( 'URL' , 'testimonials-widget' ),
|
467 |
+
msgid "Add New Testimonial"
|
468 |
+
msgstr "הוספת עדות חדשה"
|
469 |
+
|
470 |
+
# 'thumbnail' => __( 'Image' , 'testimonials-widget' ),
|
471 |
+
# 'title' => __( 'Source' , 'testimonials-widget' ),
|
472 |
+
# 'shortcode' => __( 'Shortcodes' , 'testimonials-widget' ),
|
473 |
+
msgid "New Testimonial"
|
474 |
+
msgstr "עדות חדשה"
|
475 |
+
|
476 |
+
#
|
477 |
+
# $orderby_select = '<select id="' . $this->get_field_id( 'orderby' ) . '" name="' . $this->get_field_name( 'orderby' ) . '">';
|
478 |
+
# $orderby_options = array(
|
479 |
+
msgid "Date"
|
480 |
+
msgstr "תאריך"
|
481 |
+
|
482 |
+
#
|
483 |
+
# $result = apply_filters( 'testimonials_widget_posts_custom_column', $result, $column, $post_id );
|
484 |
+
#
|
485 |
+
msgid "Tags"
|
486 |
+
msgstr "תגיות"
|
487 |
+
|
488 |
+
# }
|
489 |
+
#
|
490 |
+
# $result = apply_filters( 'testimonials_widget_posts_custom_column', $result, $column, $post_id );
|
491 |
+
msgid "Category"
|
492 |
+
msgstr "קטגוריה"
|
493 |
+
|
494 |
+
# break;
|
495 |
+
# }
|
496 |
+
#
|
497 |
+
msgid "Published by"
|
498 |
+
msgstr "פורסם על ידי"
|
499 |
+
|
500 |
+
# $meta_key_select = '<select id="' . $this->get_field_id( 'meta_key' ) . '" name="' . $this->get_field_name( 'meta_key' ) . '">';
|
501 |
+
# $meta_key_options = array(
|
502 |
+
# '' => __( 'None' , 'testimonials-widget'),
|
503 |
+
msgid "URL"
|
504 |
+
msgstr "כתובת URL"
|
505 |
+
|
506 |
+
#
|
507 |
+
# $meta_key_select = '<select id="' . $this->get_field_id( 'meta_key' ) . '" name="' . $this->get_field_name( 'meta_key' ) . '">';
|
508 |
+
# $meta_key_options = array(
|
509 |
+
msgid "Company"
|
510 |
+
msgstr "חברה"
|
511 |
+
|
512 |
+
# $form_parts['orderby'] = '<p><label for="' . $this->get_field_id( 'orderby' ) . '">' . __( 'ORDER BY', 'testimonials-widget' ) . '</label>' . $orderby_select . '<br/><span class="setting-description"><small>' . __( 'Used when Random order is disabled', 'testimonials-widget' ) . '</small></span></p>';
|
513 |
+
#
|
514 |
+
# $meta_key_select = '<select id="' . $this->get_field_id( 'meta_key' ) . '" name="' . $this->get_field_name( 'meta_key' ) . '">';
|
515 |
+
msgid "Email"
|
516 |
+
msgstr "מייל"
|
517 |
+
|
518 |
+
#
|
519 |
+
# $form_parts['orderby'] = '<p><label for="' . $this->get_field_id( 'orderby' ) . '">' . __( 'ORDER BY', 'testimonials-widget' ) . '</label>' . $orderby_select . '<br/><span class="setting-description"><small>' . __( 'Used when Random order is disabled', 'testimonials-widget' ) . '</small></span></p>';
|
520 |
+
#
|
521 |
+
msgid "Title"
|
522 |
+
msgstr "כותרת"
|
523 |
+
|
524 |
+
# } elseif ( is_email( $email ) ) {
|
525 |
+
# $result = get_avatar( $email );
|
526 |
+
# } else {
|
527 |
+
msgid "Shortcode"
|
528 |
+
msgstr "קיצור קוד"
|
529 |
+
|
530 |
+
# $form_parts['max_height'] = '<p><label for="' . $this->get_field_id( 'max_height' ) . '">' . __('Maximum Height', 'testimonials-widget') . '</label><input size="4" type="text" id="' . $this->get_field_id( 'max_height' ) . '" name="' . $this->get_field_name( 'max_height' ) . '" value="' . htmlspecialchars($instance['max_height'], ENT_QUOTES) . '" /><br/><span class="setting-description"><small>' . __('Set for maximum display height', 'testimonials-widget') . '</small></span></p>';
|
531 |
+
#
|
532 |
+
# $orderby_select = '<select id="' . $this->get_field_id( 'orderby' ) . '" name="' . $this->get_field_name( 'orderby' ) . '">';
|
533 |
+
msgid "Source"
|
534 |
+
msgstr "מקור"
|
535 |
+
|
536 |
+
# if ( has_post_thumbnail( $post_id ) ) {
|
537 |
+
# $result = get_the_post_thumbnail( $post_id, 'thumbnail' );
|
538 |
+
# } elseif ( is_email( $email ) ) {
|
539 |
+
msgid "Image"
|
540 |
+
msgstr "תמונה"
|
541 |
+
|
542 |
+
# 'name' => __( 'Testimonials' , 'testimonials-widget' ),
|
543 |
+
# 'new_item' => __( 'Add New Testimonial' , 'testimonials-widget' ),
|
544 |
+
# 'not_found' => __( 'No testimonials found' , 'testimonials-widget' ),
|
545 |
+
msgid "Testimonials"
|
546 |
+
msgstr "עדויות"
|
languages/testimonials-widget.pot
CHANGED
@@ -1,307 +1,591 @@
|
|
1 |
-
# Copyright (C)
|
2 |
# This file is distributed under the same license as the Testimonials Widget package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Testimonials Widget
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/testimonials-widget\n"
|
7 |
-
"POT-Creation-Date:
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
11 |
-
"PO-Revision-Date:
|
12 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
13 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
14 |
|
15 |
-
#: testimonials-widget
|
16 |
-
msgid "
|
17 |
msgstr ""
|
18 |
|
19 |
-
#: testimonials-widget
|
20 |
-
msgid "
|
21 |
msgstr ""
|
22 |
|
23 |
-
#: testimonials-widget
|
24 |
-
msgid "
|
25 |
msgstr ""
|
26 |
|
27 |
-
#: testimonials-widget
|
28 |
-
msgid "
|
29 |
msgstr ""
|
30 |
|
31 |
-
#: testimonials-widget
|
32 |
-
msgid "
|
33 |
msgstr ""
|
34 |
|
35 |
-
#: testimonials-widget
|
36 |
-
msgid "
|
37 |
msgstr ""
|
38 |
|
39 |
-
#:
|
40 |
-
msgid "
|
41 |
msgstr ""
|
42 |
|
43 |
-
#:
|
44 |
-
|
45 |
-
msgid "There was an error in the MySQL query"
|
46 |
msgstr ""
|
47 |
|
48 |
-
#: testimonials-widget-
|
49 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
msgstr ""
|
51 |
|
52 |
-
#: testimonials-widget
|
53 |
-
msgid "
|
54 |
msgstr ""
|
55 |
|
56 |
-
#: testimonials-widget
|
57 |
-
msgid "
|
58 |
msgstr ""
|
59 |
|
60 |
-
#: testimonials-widget
|
61 |
-
msgid "
|
62 |
msgstr ""
|
63 |
|
64 |
-
#: testimonials-widget
|
65 |
-
msgid "
|
66 |
msgstr ""
|
67 |
|
68 |
-
#:
|
69 |
-
msgid "
|
70 |
msgstr ""
|
71 |
|
72 |
-
#:
|
73 |
-
msgid "
|
74 |
msgstr ""
|
75 |
|
76 |
-
#: testimonials-widget
|
77 |
-
|
|
|
78 |
msgstr ""
|
79 |
|
80 |
-
#:
|
81 |
-
msgid "
|
82 |
msgstr ""
|
83 |
|
84 |
-
#:
|
85 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
msgid "Author"
|
87 |
msgstr ""
|
88 |
|
89 |
-
#: testimonials-widget
|
90 |
-
#: testimonials-widget-admin.php:461
|
91 |
msgid "Source"
|
92 |
msgstr ""
|
93 |
|
94 |
-
#: testimonials-widget
|
95 |
-
msgid "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
96 |
msgstr ""
|
97 |
|
98 |
-
#:
|
99 |
-
msgid "
|
|
|
|
|
100 |
msgstr ""
|
101 |
|
102 |
-
#: testimonials-widget
|
103 |
-
msgid "
|
|
|
|
|
|
|
|
|
|
|
104 |
msgstr ""
|
105 |
|
106 |
-
#: testimonials-widget-
|
107 |
-
|
|
|
108 |
msgstr ""
|
109 |
|
110 |
-
#: testimonials-widget-
|
111 |
-
|
|
|
112 |
msgstr ""
|
113 |
|
114 |
-
#: testimonials-widget
|
115 |
-
|
|
|
116 |
msgstr ""
|
117 |
|
118 |
-
#: testimonials-widget
|
119 |
-
msgid "
|
120 |
msgstr ""
|
121 |
|
122 |
-
#: testimonials-widget
|
123 |
-
msgid "
|
124 |
msgstr ""
|
125 |
|
126 |
-
#: testimonials-widget
|
127 |
-
msgid "
|
128 |
msgstr ""
|
129 |
|
130 |
-
#: testimonials-widget
|
131 |
-
msgid "
|
132 |
msgstr ""
|
133 |
|
134 |
-
#:
|
135 |
-
|
136 |
-
msgid "Add new testimonial"
|
137 |
msgstr ""
|
138 |
|
139 |
-
#:
|
140 |
-
msgid "
|
141 |
msgstr ""
|
142 |
|
143 |
-
#: testimonials-widget
|
144 |
-
msgid "
|
145 |
msgstr ""
|
146 |
|
147 |
-
#: testimonials-widget
|
148 |
-
msgid "
|
|
|
|
|
|
|
149 |
msgstr ""
|
150 |
|
151 |
-
#:
|
152 |
-
msgid "
|
153 |
msgstr ""
|
154 |
|
155 |
-
#: testimonials-widget
|
156 |
-
msgid "
|
|
|
|
|
157 |
msgstr ""
|
158 |
|
159 |
-
#: testimonials-widget
|
160 |
-
msgid "
|
161 |
msgstr ""
|
162 |
|
163 |
-
#: testimonials-widget
|
164 |
-
msgid "
|
165 |
msgstr ""
|
166 |
|
167 |
-
#: testimonials-widget
|
168 |
-
msgid "
|
169 |
msgstr ""
|
170 |
|
171 |
-
#: testimonials-widget
|
172 |
-
msgid "
|
173 |
msgstr ""
|
174 |
|
175 |
-
#: testimonials-widget
|
176 |
-
msgid "
|
177 |
msgstr ""
|
178 |
|
179 |
-
#: testimonials-widget
|
180 |
-
msgid "
|
181 |
msgstr ""
|
182 |
|
183 |
-
#:
|
184 |
-
msgid "
|
185 |
msgstr ""
|
186 |
|
187 |
-
#: testimonials-widget
|
188 |
-
msgid "
|
189 |
msgstr ""
|
190 |
|
191 |
-
#: testimonials-widget
|
192 |
-
msgid "
|
193 |
msgstr ""
|
194 |
|
195 |
-
#: testimonials-widget
|
196 |
-
msgid "
|
197 |
msgstr ""
|
198 |
|
199 |
-
#: testimonials-widget
|
200 |
-
msgid "
|
201 |
msgstr ""
|
202 |
|
203 |
-
#:
|
204 |
-
msgid "
|
205 |
-
|
206 |
-
msgstr[0] ""
|
207 |
-
msgstr[1] ""
|
208 |
|
209 |
-
#: testimonials-widget
|
210 |
-
msgid ""
|
211 |
-
|
212 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
213 |
msgstr ""
|
214 |
|
215 |
-
#. #-#-#-#-# testimonials-widget.pot (Testimonials Widget
|
216 |
#. Plugin Name of the plugin/theme
|
217 |
-
#: testimonials-widget-widget.php:
|
218 |
msgid "Testimonials Widget"
|
219 |
msgstr ""
|
220 |
|
221 |
-
#: testimonials-widget-widget.php:
|
222 |
-
msgid "
|
223 |
msgstr ""
|
224 |
|
225 |
-
#: testimonials-widget-widget.php:
|
226 |
-
msgid "
|
227 |
msgstr ""
|
228 |
|
229 |
-
#: testimonials-widget-widget.php:
|
230 |
-
msgid "
|
231 |
msgstr ""
|
232 |
|
233 |
-
#: testimonials-widget
|
234 |
-
msgid ""
|
235 |
-
|
236 |
-
|
237 |
-
|
|
|
238 |
msgstr ""
|
239 |
|
240 |
-
#: testimonials-widget
|
241 |
-
msgid "
|
242 |
msgstr ""
|
243 |
|
244 |
-
#: testimonials-widget
|
245 |
-
msgid "
|
246 |
msgstr ""
|
247 |
|
248 |
-
#: testimonials-widget
|
249 |
-
msgid "
|
250 |
msgstr ""
|
251 |
|
252 |
-
#: testimonials-widget
|
253 |
-
msgid "
|
254 |
msgstr ""
|
255 |
|
256 |
-
#: testimonials-widget-widget.php:
|
257 |
-
msgid "
|
258 |
msgstr ""
|
259 |
|
260 |
-
#: testimonials-widget
|
261 |
-
msgid "
|
262 |
msgstr ""
|
263 |
|
264 |
-
#: testimonials-widget-widget.php:
|
265 |
-
msgid ""
|
266 |
-
"Unchecking this will rotate testimonials in the order added, latest first."
|
267 |
msgstr ""
|
268 |
|
269 |
-
#: testimonials-widget
|
270 |
-
msgid "
|
271 |
msgstr ""
|
272 |
|
273 |
-
#: testimonials-widget
|
274 |
-
msgid "
|
275 |
msgstr ""
|
276 |
|
277 |
-
#: testimonials-widget
|
278 |
-
msgid "
|
279 |
msgstr ""
|
280 |
|
281 |
-
#: testimonials-widget
|
282 |
-
msgid "
|
283 |
msgstr ""
|
284 |
|
285 |
-
#: testimonials-widget
|
286 |
-
msgid "
|
287 |
msgstr ""
|
288 |
|
289 |
-
#: testimonials-widget
|
290 |
-
msgid "
|
291 |
msgstr ""
|
292 |
|
293 |
-
#: testimonials-widget
|
294 |
-
msgid "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
295 |
msgstr ""
|
296 |
|
297 |
-
|
298 |
-
msgid "
|
299 |
msgstr ""
|
300 |
|
301 |
#. Description of the plugin/theme
|
302 |
msgid ""
|
303 |
-
"
|
304 |
-
"your WordPress
|
|
|
305 |
msgstr ""
|
306 |
|
307 |
#. Author of the plugin/theme
|
@@ -309,5 +593,5 @@ msgid "Michael Cannon"
|
|
309 |
msgstr ""
|
310 |
|
311 |
#. Author URI of the plugin/theme
|
312 |
-
msgid "http://
|
313 |
msgstr ""
|
1 |
+
# Copyright (C) 2013 Testimonials Widget
|
2 |
# This file is distributed under the same license as the Testimonials Widget package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Testimonials Widget 2.8.2\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/testimonials-widget\n"
|
7 |
+
"POT-Creation-Date: 2013-02-27 13:29:09+00:00\n"
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
11 |
+
"PO-Revision-Date: 2013-MO-DA HO:MI+ZONE\n"
|
12 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
13 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
14 |
|
15 |
+
#: lib/settings.testimonials-widget.php:38
|
16 |
+
msgid "General"
|
17 |
msgstr ""
|
18 |
|
19 |
+
#: lib/settings.testimonials-widget.php:39
|
20 |
+
msgid "Selection"
|
21 |
msgstr ""
|
22 |
|
23 |
+
#: lib/settings.testimonials-widget.php:40
|
24 |
+
msgid "Ordering"
|
25 |
msgstr ""
|
26 |
|
27 |
+
#: lib/settings.testimonials-widget.php:41
|
28 |
+
msgid "Widget"
|
29 |
msgstr ""
|
30 |
|
31 |
+
#: lib/settings.testimonials-widget.php:43
|
32 |
+
msgid "Post Type"
|
33 |
msgstr ""
|
34 |
|
35 |
+
#: lib/settings.testimonials-widget.php:44
|
36 |
+
msgid "Reset"
|
37 |
msgstr ""
|
38 |
|
39 |
+
#: lib/settings.testimonials-widget.php:45
|
40 |
+
msgid "About Testimonials Widget"
|
41 |
msgstr ""
|
42 |
|
43 |
+
#: lib/settings.testimonials-widget.php:55
|
44 |
+
msgid "Widget Title"
|
|
|
45 |
msgstr ""
|
46 |
|
47 |
+
#: lib/settings.testimonials-widget.php:56 testimonials-widget.php:352
|
48 |
+
#: testimonials-widget.php:380
|
49 |
+
msgid "Testimonials"
|
50 |
+
msgstr ""
|
51 |
+
|
52 |
+
#: lib/settings.testimonials-widget.php:61
|
53 |
+
msgid "Title Link"
|
54 |
+
msgstr ""
|
55 |
+
|
56 |
+
#: lib/settings.testimonials-widget.php:62
|
57 |
+
msgid "URL or Post ID to link widget title to. Ex: 123 or http://example.com"
|
58 |
+
msgstr ""
|
59 |
+
|
60 |
+
#: lib/settings.testimonials-widget.php:67
|
61 |
+
msgid "Keep Whitespace?"
|
62 |
+
msgstr ""
|
63 |
+
|
64 |
+
#: lib/settings.testimonials-widget.php:68
|
65 |
+
msgid "Keeps testimonials looking as entered than sans auto-formatting"
|
66 |
+
msgstr ""
|
67 |
+
|
68 |
+
#: lib/settings.testimonials-widget.php:74
|
69 |
+
msgid "Minimum Height"
|
70 |
+
msgstr ""
|
71 |
+
|
72 |
+
#: lib/settings.testimonials-widget.php:75
|
73 |
+
msgid "Set for minimum display height, in pixels"
|
74 |
+
msgstr ""
|
75 |
+
|
76 |
+
#: lib/settings.testimonials-widget.php:80
|
77 |
+
msgid "Maximum Height"
|
78 |
+
msgstr ""
|
79 |
+
|
80 |
+
#: lib/settings.testimonials-widget.php:81
|
81 |
+
msgid "Set for maximum display height, in pixels"
|
82 |
+
msgstr ""
|
83 |
+
|
84 |
+
#: lib/settings.testimonials-widget.php:86
|
85 |
+
msgid "Rotation Speed"
|
86 |
+
msgstr ""
|
87 |
+
|
88 |
+
#: lib/settings.testimonials-widget.php:87
|
89 |
+
msgid ""
|
90 |
+
"Number of seconds between testimonial rotations or 0 for no rotation at all "
|
91 |
+
"refresh"
|
92 |
+
msgstr ""
|
93 |
+
|
94 |
+
#: lib/settings.testimonials-widget.php:93
|
95 |
+
msgid "General Options"
|
96 |
+
msgstr ""
|
97 |
+
|
98 |
+
#: lib/settings.testimonials-widget.php:98
|
99 |
+
msgid "Character Limit"
|
100 |
+
msgstr ""
|
101 |
+
|
102 |
+
#: lib/settings.testimonials-widget.php:99
|
103 |
+
msgid "Number of characters to limit non-single testimonial views to"
|
104 |
+
msgstr ""
|
105 |
+
|
106 |
+
#: lib/settings.testimonials-widget.php:103
|
107 |
+
msgid "Hide \"Testimonials Not Found\"?"
|
108 |
+
msgstr ""
|
109 |
+
|
110 |
+
#: lib/settings.testimonials-widget.php:108
|
111 |
+
msgid "Hide Gravatar Image?"
|
112 |
+
msgstr ""
|
113 |
+
|
114 |
+
#: lib/settings.testimonials-widget.php:113
|
115 |
+
msgid "Hide Image?"
|
116 |
+
msgstr ""
|
117 |
+
|
118 |
+
#: lib/settings.testimonials-widget.php:118
|
119 |
+
msgid "Hide Testimonial Content?"
|
120 |
+
msgstr ""
|
121 |
+
|
122 |
+
#: lib/settings.testimonials-widget.php:123
|
123 |
+
msgid "Hide Author/Source?"
|
124 |
+
msgstr ""
|
125 |
+
|
126 |
+
#: lib/settings.testimonials-widget.php:125
|
127 |
+
msgid "Don't display \"Post Title\" in cite"
|
128 |
+
msgstr ""
|
129 |
+
|
130 |
+
#: lib/settings.testimonials-widget.php:129
|
131 |
+
msgid "Hide Email?"
|
132 |
+
msgstr ""
|
133 |
+
|
134 |
+
#: lib/settings.testimonials-widget.php:135
|
135 |
+
msgid "Hide Title?"
|
136 |
+
msgstr ""
|
137 |
+
|
138 |
+
#: lib/settings.testimonials-widget.php:140
|
139 |
+
msgid "Hide Company?"
|
140 |
+
msgstr ""
|
141 |
+
|
142 |
+
#: lib/settings.testimonials-widget.php:145
|
143 |
+
msgid "Hide URL?"
|
144 |
+
msgstr ""
|
145 |
+
|
146 |
+
#: lib/settings.testimonials-widget.php:150
|
147 |
+
msgid "URL Target"
|
148 |
+
msgstr ""
|
149 |
+
|
150 |
+
#: lib/settings.testimonials-widget.php:151
|
151 |
+
msgid "Adds target to all URLs; leave blank if none"
|
152 |
+
msgstr ""
|
153 |
+
|
154 |
+
#: lib/settings.testimonials-widget.php:155
|
155 |
+
msgid "Testimonial Bottom Text"
|
156 |
+
msgstr ""
|
157 |
+
|
158 |
+
#: lib/settings.testimonials-widget.php:156
|
159 |
+
msgid "Custom text or HTML for bottom of testimonials"
|
160 |
+
msgstr ""
|
161 |
+
|
162 |
+
#: lib/settings.testimonials-widget.php:161
|
163 |
+
msgid "Enable Paging?"
|
164 |
+
msgstr ""
|
165 |
+
|
166 |
+
#: lib/settings.testimonials-widget.php:162
|
167 |
+
msgid "For `[testimonialswidget_list]`"
|
168 |
+
msgstr ""
|
169 |
+
|
170 |
+
#: lib/settings.testimonials-widget.php:165
|
171 |
+
msgid "Disable"
|
172 |
+
msgstr ""
|
173 |
+
|
174 |
+
#: lib/settings.testimonials-widget.php:166
|
175 |
+
msgid "Enable"
|
176 |
+
msgstr ""
|
177 |
+
|
178 |
+
#: lib/settings.testimonials-widget.php:167
|
179 |
+
msgid "Before testimonials"
|
180 |
+
msgstr ""
|
181 |
+
|
182 |
+
#: lib/settings.testimonials-widget.php:168
|
183 |
+
msgid "After testimonials"
|
184 |
+
msgstr ""
|
185 |
+
|
186 |
+
#: lib/settings.testimonials-widget.php:174
|
187 |
+
msgid "Remove `.hentry` CSS?"
|
188 |
+
msgstr ""
|
189 |
+
|
190 |
+
#: lib/settings.testimonials-widget.php:175
|
191 |
+
msgid ""
|
192 |
+
"Some themes use class `.hentry` in a manner that breaks Testimonials Widgets "
|
193 |
+
"CSS"
|
194 |
+
msgstr ""
|
195 |
+
|
196 |
+
#: lib/settings.testimonials-widget.php:186
|
197 |
+
msgid "Selection Options"
|
198 |
+
msgstr ""
|
199 |
+
|
200 |
+
#: lib/settings.testimonials-widget.php:192
|
201 |
+
msgid "Category Filter"
|
202 |
msgstr ""
|
203 |
|
204 |
+
#: lib/settings.testimonials-widget.php:193
|
205 |
+
msgid "Comma separated category slug-names. Ex: category-a, another-category"
|
206 |
msgstr ""
|
207 |
|
208 |
+
#: lib/settings.testimonials-widget.php:198
|
209 |
+
msgid "Tags Filter"
|
210 |
msgstr ""
|
211 |
|
212 |
+
#: lib/settings.testimonials-widget.php:199
|
213 |
+
msgid "Comma separated tag slug-names. Ex: tag-a, another-tag"
|
214 |
msgstr ""
|
215 |
|
216 |
+
#: lib/settings.testimonials-widget.php:204
|
217 |
+
msgid "Require All Tags?"
|
218 |
msgstr ""
|
219 |
|
220 |
+
#: lib/settings.testimonials-widget.php:205
|
221 |
+
msgid "Select only testimonials with all of the given tags"
|
222 |
msgstr ""
|
223 |
|
224 |
+
#: lib/settings.testimonials-widget.php:211
|
225 |
+
msgid "Include IDs Filter"
|
226 |
msgstr ""
|
227 |
|
228 |
+
#: lib/settings.testimonials-widget.php:212
|
229 |
+
#: lib/settings.testimonials-widget.php:218
|
230 |
+
msgid "Comma separated testimonial IDs. Ex: 3,1,2"
|
231 |
msgstr ""
|
232 |
|
233 |
+
#: lib/settings.testimonials-widget.php:217
|
234 |
+
msgid "Exclude IDs Filter"
|
235 |
msgstr ""
|
236 |
|
237 |
+
#: lib/settings.testimonials-widget.php:223
|
238 |
+
msgid "Limit"
|
239 |
+
msgstr ""
|
240 |
+
|
241 |
+
#: lib/settings.testimonials-widget.php:224
|
242 |
+
msgid "Number of testimonials to select per instance"
|
243 |
+
msgstr ""
|
244 |
+
|
245 |
+
#: lib/settings.testimonials-widget.php:236
|
246 |
+
msgid "Ordering Options"
|
247 |
+
msgstr ""
|
248 |
+
|
249 |
+
#: lib/settings.testimonials-widget.php:242
|
250 |
+
msgid "Random Order?"
|
251 |
+
msgstr ""
|
252 |
+
|
253 |
+
#: lib/settings.testimonials-widget.php:243
|
254 |
+
msgid ""
|
255 |
+
"If checked, ignores ORDER BY, ORDER BY meta_key, and ORDER BY Order. Widgets "
|
256 |
+
"are random by default automatically"
|
257 |
+
msgstr ""
|
258 |
+
|
259 |
+
#: lib/settings.testimonials-widget.php:249
|
260 |
+
msgid "ORDER BY"
|
261 |
+
msgstr ""
|
262 |
+
|
263 |
+
#: lib/settings.testimonials-widget.php:250
|
264 |
+
msgid "Used when \"Random Order\" is disabled"
|
265 |
+
msgstr ""
|
266 |
+
|
267 |
+
#: lib/settings.testimonials-widget.php:253
|
268 |
+
msgid "Testimonial ID"
|
269 |
+
msgstr ""
|
270 |
+
|
271 |
+
#: lib/settings.testimonials-widget.php:254
|
272 |
msgid "Author"
|
273 |
msgstr ""
|
274 |
|
275 |
+
#: lib/settings.testimonials-widget.php:255 testimonials-widget.php:329
|
|
|
276 |
msgid "Source"
|
277 |
msgstr ""
|
278 |
|
279 |
+
#: lib/settings.testimonials-widget.php:256 testimonials-widget.php:338
|
280 |
+
msgid "Date"
|
281 |
+
msgstr ""
|
282 |
+
|
283 |
+
#: lib/settings.testimonials-widget.php:257
|
284 |
+
msgid "No order"
|
285 |
+
msgstr ""
|
286 |
+
|
287 |
+
#: lib/settings.testimonials-widget.php:264
|
288 |
+
msgid "ORDER BY meta_key"
|
289 |
msgstr ""
|
290 |
|
291 |
+
#: lib/settings.testimonials-widget.php:265
|
292 |
+
msgid ""
|
293 |
+
"Used when \"Random Order\" is disabled and sorting by a testimonials meta "
|
294 |
+
"key is needed. Overrides ORDER BY"
|
295 |
msgstr ""
|
296 |
|
297 |
+
#: lib/settings.testimonials-widget.php:268
|
298 |
+
msgid "None"
|
299 |
+
msgstr ""
|
300 |
+
|
301 |
+
#: lib/settings.testimonials-widget.php:269 testimonials-widget.php:331
|
302 |
+
#: testimonials-widget.php:1211
|
303 |
+
msgid "Title"
|
304 |
msgstr ""
|
305 |
|
306 |
+
#: lib/settings.testimonials-widget.php:270 testimonials-widget.php:332
|
307 |
+
#: testimonials-widget.php:1217
|
308 |
+
msgid "Email"
|
309 |
msgstr ""
|
310 |
|
311 |
+
#: lib/settings.testimonials-widget.php:271 testimonials-widget.php:333
|
312 |
+
#: testimonials-widget.php:1223
|
313 |
+
msgid "Company"
|
314 |
msgstr ""
|
315 |
|
316 |
+
#: lib/settings.testimonials-widget.php:272 testimonials-widget.php:334
|
317 |
+
#: testimonials-widget.php:1229
|
318 |
+
msgid "URL"
|
319 |
msgstr ""
|
320 |
|
321 |
+
#: lib/settings.testimonials-widget.php:278
|
322 |
+
msgid "ORDER BY Order"
|
323 |
msgstr ""
|
324 |
|
325 |
+
#: lib/settings.testimonials-widget.php:281
|
326 |
+
msgid "Descending"
|
327 |
msgstr ""
|
328 |
|
329 |
+
#: lib/settings.testimonials-widget.php:282
|
330 |
+
msgid "Ascending"
|
331 |
msgstr ""
|
332 |
|
333 |
+
#: lib/settings.testimonials-widget.php:295
|
334 |
+
msgid "Debug Mode?"
|
335 |
msgstr ""
|
336 |
|
337 |
+
#: lib/settings.testimonials-widget.php:296
|
338 |
+
msgid "Not implemented yet"
|
|
|
339 |
msgstr ""
|
340 |
|
341 |
+
#: lib/settings.testimonials-widget.php:303
|
342 |
+
msgid "Allow Comments?"
|
343 |
msgstr ""
|
344 |
|
345 |
+
#: lib/settings.testimonials-widget.php:304
|
346 |
+
msgid "If checked, allows commenting on testimonial single-view pages"
|
347 |
msgstr ""
|
348 |
|
349 |
+
#: lib/settings.testimonials-widget.php:308
|
350 |
+
msgid ""
|
351 |
+
"URL slug-name for <a href=\"%1s\">testimonials archive</a> page. After "
|
352 |
+
"changing, you must click \"Save Changes\" on <a href=\"%2s\">Permalink "
|
353 |
+
"Settings</a> to update them."
|
354 |
msgstr ""
|
355 |
|
356 |
+
#: lib/settings.testimonials-widget.php:314
|
357 |
+
msgid "Archive Page URL"
|
358 |
msgstr ""
|
359 |
|
360 |
+
#: lib/settings.testimonials-widget.php:319
|
361 |
+
msgid ""
|
362 |
+
"URL slug-name for testimonial view pages. After changing, you must click "
|
363 |
+
"\"Save Changes\" on <a href=\"%1s\">Permalink Settings</a> to update them."
|
364 |
msgstr ""
|
365 |
|
366 |
+
#: lib/settings.testimonials-widget.php:322
|
367 |
+
msgid "Testimonial Page URL"
|
368 |
msgstr ""
|
369 |
|
370 |
+
#: lib/settings.testimonials-widget.php:330
|
371 |
+
msgid "Reset to Defaults?"
|
372 |
msgstr ""
|
373 |
|
374 |
+
#: lib/settings.testimonials-widget.php:333
|
375 |
+
msgid "Check this box to reset options to their defaults"
|
376 |
msgstr ""
|
377 |
|
378 |
+
#: lib/settings.testimonials-widget.php:339
|
379 |
+
msgid "Example Text Input"
|
380 |
msgstr ""
|
381 |
|
382 |
+
#: lib/settings.testimonials-widget.php:340
|
383 |
+
msgid "This is a description for the text input."
|
384 |
msgstr ""
|
385 |
|
386 |
+
#: lib/settings.testimonials-widget.php:345
|
387 |
+
msgid "Example Textarea Input"
|
388 |
msgstr ""
|
389 |
|
390 |
+
#: lib/settings.testimonials-widget.php:346
|
391 |
+
msgid "This is a description for the textarea input."
|
392 |
msgstr ""
|
393 |
|
394 |
+
#: lib/settings.testimonials-widget.php:352
|
395 |
+
msgid "Example Checkbox"
|
396 |
msgstr ""
|
397 |
|
398 |
+
#: lib/settings.testimonials-widget.php:353
|
399 |
+
msgid "This is a description for the checkbox."
|
400 |
msgstr ""
|
401 |
|
402 |
+
#: lib/settings.testimonials-widget.php:365
|
403 |
+
msgid "Example Radio"
|
404 |
msgstr ""
|
405 |
|
406 |
+
#: lib/settings.testimonials-widget.php:366
|
407 |
+
msgid "This is a description for the radio buttons."
|
408 |
msgstr ""
|
409 |
|
410 |
+
#: lib/settings.testimonials-widget.php:376
|
411 |
+
msgid "Example Select"
|
412 |
+
msgstr ""
|
|
|
|
|
413 |
|
414 |
+
#: lib/settings.testimonials-widget.php:377
|
415 |
+
msgid "This is a description for the drop-down."
|
416 |
+
msgstr ""
|
417 |
+
|
418 |
+
#: lib/settings.testimonials-widget.php:428
|
419 |
+
#: lib/settings.testimonials-widget.php:460
|
420 |
+
msgid "Testimonials Widget Settings"
|
421 |
+
msgstr ""
|
422 |
+
|
423 |
+
#: lib/settings.testimonials-widget.php:428 testimonials-widget.php:90
|
424 |
+
msgid "Settings"
|
425 |
+
msgstr ""
|
426 |
+
|
427 |
+
#: lib/settings.testimonials-widget.php:479
|
428 |
+
msgid "Save Changes"
|
429 |
+
msgstr ""
|
430 |
+
|
431 |
+
#: lib/settings.testimonials-widget.php:490
|
432 |
+
msgid "Copyright ©%1$s %2$s."
|
433 |
+
msgstr ""
|
434 |
+
|
435 |
+
#: lib/testimonials-widget-widget.php:8
|
436 |
+
msgid "Display testimonials with multiple selection and display options"
|
437 |
msgstr ""
|
438 |
|
439 |
+
#. #-#-#-#-# testimonials-widget.pot (Testimonials Widget 2.8.2) #-#-#-#-#
|
440 |
#. Plugin Name of the plugin/theme
|
441 |
+
#: lib/testimonials-widget-widget.php:19
|
442 |
msgid "Testimonials Widget"
|
443 |
msgstr ""
|
444 |
|
445 |
+
#: lib/testimonials-widget-widget.php:133
|
446 |
+
msgid "CSS Class"
|
447 |
msgstr ""
|
448 |
|
449 |
+
#: lib/testimonials-widget-widget.php:134
|
450 |
+
msgid "This widget's unique CSS class for styling"
|
451 |
msgstr ""
|
452 |
|
453 |
+
#: lib/testimonials-widget-widget.php:172
|
454 |
+
msgid "Expand/Collapse"
|
455 |
msgstr ""
|
456 |
|
457 |
+
#: testimonials-widget.php:328
|
458 |
+
msgid "Image"
|
459 |
+
msgstr ""
|
460 |
+
|
461 |
+
#: testimonials-widget.php:330
|
462 |
+
msgid "Shortcodes"
|
463 |
msgstr ""
|
464 |
|
465 |
+
#: testimonials-widget.php:335
|
466 |
+
msgid "Published by"
|
467 |
msgstr ""
|
468 |
|
469 |
+
#: testimonials-widget.php:336
|
470 |
+
msgid "Category"
|
471 |
msgstr ""
|
472 |
|
473 |
+
#: testimonials-widget.php:337
|
474 |
+
msgid "Tags"
|
475 |
msgstr ""
|
476 |
|
477 |
+
#: testimonials-widget.php:349
|
478 |
+
msgid "Add New"
|
479 |
msgstr ""
|
480 |
|
481 |
+
#: testimonials-widget.php:350 testimonials-widget.php:353
|
482 |
+
msgid "Add New Testimonial"
|
483 |
msgstr ""
|
484 |
|
485 |
+
#: testimonials-widget.php:351
|
486 |
+
msgid "Edit Testimonial"
|
487 |
msgstr ""
|
488 |
|
489 |
+
#: testimonials-widget.php:354 testimonials-widget.php:615
|
490 |
+
msgid "No testimonials found"
|
|
|
491 |
msgstr ""
|
492 |
|
493 |
+
#: testimonials-widget.php:355
|
494 |
+
msgid "No testimonials found in Trash"
|
495 |
msgstr ""
|
496 |
|
497 |
+
#: testimonials-widget.php:357
|
498 |
+
msgid "Search Testimonials"
|
499 |
msgstr ""
|
500 |
|
501 |
+
#: testimonials-widget.php:358
|
502 |
+
msgid "Testimonial"
|
503 |
msgstr ""
|
504 |
|
505 |
+
#: testimonials-widget.php:359
|
506 |
+
msgid "View Testimonial"
|
507 |
msgstr ""
|
508 |
|
509 |
+
#: testimonials-widget.php:648
|
510 |
+
msgid "…"
|
511 |
msgstr ""
|
512 |
|
513 |
+
#: testimonials-widget.php:984
|
514 |
+
msgid "«"
|
515 |
msgstr ""
|
516 |
|
517 |
+
#: testimonials-widget.php:993
|
518 |
+
msgid "»"
|
519 |
+
msgstr ""
|
520 |
+
|
521 |
+
#: testimonials-widget.php:1241
|
522 |
+
msgid "Testimonial Data"
|
523 |
+
msgstr ""
|
524 |
+
|
525 |
+
#: testimonials-widget.php:1266
|
526 |
+
msgid "Enter title here"
|
527 |
+
msgstr ""
|
528 |
+
|
529 |
+
#: testimonials-widget.php:1267
|
530 |
+
msgid "Enter testimonial source here"
|
531 |
+
msgstr ""
|
532 |
+
|
533 |
+
#: testimonials-widget.php:1291
|
534 |
+
msgid "Testimonial updated. <a href=\"%s\">View testimonial</a>"
|
535 |
+
msgstr ""
|
536 |
+
|
537 |
+
#: testimonials-widget.php:1292
|
538 |
+
msgid "Custom field updated."
|
539 |
+
msgstr ""
|
540 |
+
|
541 |
+
#: testimonials-widget.php:1293
|
542 |
+
msgid "Custom field deleted."
|
543 |
+
msgstr ""
|
544 |
+
|
545 |
+
#: testimonials-widget.php:1294
|
546 |
+
msgid "Testimonial updated."
|
547 |
+
msgstr ""
|
548 |
+
|
549 |
+
#. translators: %s: date and time of the revision
|
550 |
+
#: testimonials-widget.php:1296
|
551 |
+
msgid "Testimonial restored to revision from %s"
|
552 |
+
msgstr ""
|
553 |
+
|
554 |
+
#: testimonials-widget.php:1297
|
555 |
+
msgid "Testimonial published. <a href=\"%s\">View testimonial</a>"
|
556 |
+
msgstr ""
|
557 |
+
|
558 |
+
#: testimonials-widget.php:1298
|
559 |
+
msgid "Testimonial saved."
|
560 |
+
msgstr ""
|
561 |
+
|
562 |
+
#: testimonials-widget.php:1299
|
563 |
+
msgid ""
|
564 |
+
"Testimonial submitted. <a target=\"_blank\" href=\"%s\">Preview testimonial</"
|
565 |
+
"a>"
|
566 |
+
msgstr ""
|
567 |
+
|
568 |
+
#: testimonials-widget.php:1300
|
569 |
+
msgid ""
|
570 |
+
"Testimonial scheduled for: <strong>%1$s</strong>. <a target=\"_blank\" href="
|
571 |
+
"\"%2$s\">Preview testimonial</a>"
|
572 |
+
msgstr ""
|
573 |
+
|
574 |
+
#: testimonials-widget.php:1301
|
575 |
+
msgid ""
|
576 |
+
"Testimonial draft updated. <a target=\"_blank\" href=\"%s\">Preview "
|
577 |
+
"testimonial</a>"
|
578 |
msgstr ""
|
579 |
|
580 |
+
#. Plugin URI of the plugin/theme
|
581 |
+
msgid "http://wordpress.org/extend/plugins/testimonials-widget/"
|
582 |
msgstr ""
|
583 |
|
584 |
#. Description of the plugin/theme
|
585 |
msgid ""
|
586 |
+
"Testimonials Widget plugin allows you to display random or rotating "
|
587 |
+
"portfolio, quotes, reviews, showcases, or text with images on your WordPress "
|
588 |
+
"blog."
|
589 |
msgstr ""
|
590 |
|
591 |
#. Author of the plugin/theme
|
593 |
msgstr ""
|
594 |
|
595 |
#. Author URI of the plugin/theme
|
596 |
+
msgid "http://aihr.us/about-aihrus/michael-cannon-resume/"
|
597 |
msgstr ""
|
lib/metabox.class.php
ADDED
@@ -0,0 +1,1458 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @Author Anonymous
|
4 |
+
* @link http://www.redrokk.com
|
5 |
+
* @Package Wordpress
|
6 |
+
* @SubPackage RedRokk Library
|
7 |
+
*
|
8 |
+
* @version 2.0
|
9 |
+
*/
|
10 |
+
|
11 |
+
//security
|
12 |
+
defined('ABSPATH') or die('You\'re not supposed to be here.');
|
13 |
+
|
14 |
+
/**
|
15 |
+
*
|
16 |
+
*
|
17 |
+
* @author Anonymous
|
18 |
+
* @example
|
19 |
+
|
20 |
+
$gallery = redrokk_metabox_class::getInstance('gallery');
|
21 |
+
|
22 |
+
*/
|
23 |
+
if (!class_exists('redrokk_metabox_class')):
|
24 |
+
class redrokk_metabox_class
|
25 |
+
{
|
26 |
+
/**
|
27 |
+
* HTML 'id' attribute of the edit screen section
|
28 |
+
*
|
29 |
+
* @var string
|
30 |
+
*/
|
31 |
+
var $_id;
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Save the form fields here that will be displayed to the user
|
35 |
+
*
|
36 |
+
* @var array
|
37 |
+
*/
|
38 |
+
var $_fields;
|
39 |
+
|
40 |
+
/**
|
41 |
+
* Title of the edit screen section, visible to user
|
42 |
+
* Default: None
|
43 |
+
*
|
44 |
+
* @var string
|
45 |
+
*/
|
46 |
+
var $title;
|
47 |
+
|
48 |
+
/**
|
49 |
+
* Function that prints out the HTML for the edit screen section. Pass
|
50 |
+
* function name as a string. Within a class, you can instead pass an
|
51 |
+
* array to call one of the class's methods. See the second example under
|
52 |
+
* Example below.
|
53 |
+
* Default: None
|
54 |
+
*
|
55 |
+
* @var callback
|
56 |
+
*/
|
57 |
+
var $callback = null;
|
58 |
+
|
59 |
+
/**
|
60 |
+
* The part of the page where the edit screen section should be shown
|
61 |
+
* ('normal', 'advanced', or 'side'). (Note that 'side' doesn't exist before 2.7)
|
62 |
+
* Default: 'advanced'
|
63 |
+
*
|
64 |
+
* @var string
|
65 |
+
*/
|
66 |
+
var $context = 'normal';
|
67 |
+
|
68 |
+
/**
|
69 |
+
* The priority within the context where the boxes should show
|
70 |
+
* ('high', 'core', 'default' or 'low')
|
71 |
+
* Default: 'default'
|
72 |
+
*
|
73 |
+
* @var string
|
74 |
+
*/
|
75 |
+
var $priority = 'default';
|
76 |
+
|
77 |
+
/**
|
78 |
+
* Arguments to pass into your callback function. The callback will receive the
|
79 |
+
* $post object and whatever parameters are passed through this variable.
|
80 |
+
* Default: null
|
81 |
+
*
|
82 |
+
* @var array
|
83 |
+
*/
|
84 |
+
var $callback_args;
|
85 |
+
|
86 |
+
/**
|
87 |
+
* Prebuilt metaboxes can be activated by using this type
|
88 |
+
* Default: default
|
89 |
+
*
|
90 |
+
* (options:)
|
91 |
+
* default
|
92 |
+
* images
|
93 |
+
*
|
94 |
+
* @var string
|
95 |
+
*/
|
96 |
+
var $_type;
|
97 |
+
|
98 |
+
/**
|
99 |
+
*
|
100 |
+
* @var unknown_type
|
101 |
+
*/
|
102 |
+
var $_category_name;
|
103 |
+
|
104 |
+
/**
|
105 |
+
* The type of Write screen on which to show the edit screen section
|
106 |
+
* ('post', 'page', 'link', or 'custom_post_type' where custom_post_type
|
107 |
+
* is the custom post type slug)
|
108 |
+
* Default: None
|
109 |
+
*
|
110 |
+
* @var array
|
111 |
+
*/
|
112 |
+
var $_object_types = array();
|
113 |
+
|
114 |
+
/**
|
115 |
+
* Whether or not to make the fields available as wp-options
|
116 |
+
*
|
117 |
+
* @var bool
|
118 |
+
*/
|
119 |
+
var $_isAdminPage = false;
|
120 |
+
|
121 |
+
/**
|
122 |
+
* Constructor.
|
123 |
+
*
|
124 |
+
*/
|
125 |
+
function __construct( $options = array() )
|
126 |
+
{
|
127 |
+
//initializing
|
128 |
+
$this->setProperties($options);
|
129 |
+
$this->setOptionHooks();
|
130 |
+
|
131 |
+
if (!$this->callback) {
|
132 |
+
$this->callback = array(&$this, 'show');
|
133 |
+
}
|
134 |
+
if (!$this->title) {
|
135 |
+
$this->title = ucfirst($this->_id);
|
136 |
+
}
|
137 |
+
|
138 |
+
//registering this metabox
|
139 |
+
add_action( 'add_meta_boxes', array(&$this, '_register') );
|
140 |
+
|
141 |
+
// backwards compatible (before WP 3.0)
|
142 |
+
// add_action( 'admin_init', array($this, '_register'), 1 );
|
143 |
+
|
144 |
+
add_action( 'save_post', array(&$this, '_save') );
|
145 |
+
add_filter( 'wp_redirect', array(&$this, '_redirectIntervention'), 40, 1 );
|
146 |
+
}
|
147 |
+
|
148 |
+
/**
|
149 |
+
* Method properly inturprets the given parameter and sets it accordingly
|
150 |
+
*
|
151 |
+
* @param string|object $value
|
152 |
+
*/
|
153 |
+
function setObjectTypes( $value )
|
154 |
+
{
|
155 |
+
if (is_a($value, 'redrokk_post_class')) {
|
156 |
+
$value = $value->_post_type;
|
157 |
+
}
|
158 |
+
if (is_a($value, 'redrokk_admin_class')) {
|
159 |
+
$value = $value->id;
|
160 |
+
$this->_isAdminPage = $value;
|
161 |
+
}
|
162 |
+
if (is_array($value)) {
|
163 |
+
foreach($value as $v)
|
164 |
+
$this->_object_types[] = $v;
|
165 |
+
return $this;
|
166 |
+
}
|
167 |
+
|
168 |
+
$this->_object_types[] = $value;
|
169 |
+
return $this;
|
170 |
+
}
|
171 |
+
|
172 |
+
/**
|
173 |
+
* Method is designed to return the currently visible post type
|
174 |
+
*/
|
175 |
+
function getCurrentPostType()
|
176 |
+
{
|
177 |
+
$post_type = false;
|
178 |
+
if (isset($_REQUEST['post_type'])) {
|
179 |
+
$post_type = $_REQUEST['post_type'];
|
180 |
+
}
|
181 |
+
elseif (isset($_REQUEST['post'])) {
|
182 |
+
$post = get_post($_REQUEST['post']);
|
183 |
+
$post_type = $post->post_type;
|
184 |
+
}
|
185 |
+
elseif (isset($_REQUEST['page'])) {
|
186 |
+
$post_type = $_REQUEST['page'];
|
187 |
+
}
|
188 |
+
|
189 |
+
return $post_type;
|
190 |
+
}
|
191 |
+
|
192 |
+
/**
|
193 |
+
* Method properly prepares the metabox type by binding the necessary hooks
|
194 |
+
*
|
195 |
+
* @param mixed $value
|
196 |
+
*/
|
197 |
+
function setType( $value = 'default' )
|
198 |
+
{
|
199 |
+
$this->_type = $value;
|
200 |
+
|
201 |
+
switch ($this->_type)
|
202 |
+
{
|
203 |
+
default:
|
204 |
+
case 'default':
|
205 |
+
add_action('metabox-show-'.$this->_id, array(&$this, '_renderForm'), 20, 1 );
|
206 |
+
add_action('metabox-save-'.$this->_id, array(&$this, 'saveAsPostMeta'), 10, 2);
|
207 |
+
break;
|
208 |
+
case 'image':
|
209 |
+
case 'images':
|
210 |
+
$this->_fields = array(
|
211 |
+
array(
|
212 |
+
'name' => 'New Image',
|
213 |
+
'type' => 'title',
|
214 |
+
),
|
215 |
+
array(
|
216 |
+
'name' => 'Image Title',
|
217 |
+
'id' => $this->_id.'_post_title',
|
218 |
+
'type' => 'text',
|
219 |
+
),
|
220 |
+
array(
|
221 |
+
'name' => 'Description',
|
222 |
+
'id' => $this->_id.'_post_content',
|
223 |
+
'type' => 'textarea',
|
224 |
+
),
|
225 |
+
array(
|
226 |
+
'name' => 'Image File',
|
227 |
+
'id' => $this->_id.'_image',
|
228 |
+
'type' => 'image',
|
229 |
+
),
|
230 |
+
array(
|
231 |
+
'name' => 'Save Image',
|
232 |
+
'type' => 'submit',
|
233 |
+
),
|
234 |
+
);
|
235 |
+
add_action('metabox-show-'.$this->_id, array(&$this, '_renderListImageAttachments'), 20, 1 );
|
236 |
+
add_action('metabox-show-'.$this->_id, array(&$this, '_renderForm'), 20, 1 );
|
237 |
+
add_action('metabox-save-'.$this->_id, array(&$this, 'saveAsAttachment'), 1, 2);
|
238 |
+
break;
|
239 |
+
case 'video':
|
240 |
+
case 'videos':
|
241 |
+
$this->_fields = array(
|
242 |
+
array(
|
243 |
+
'name' => 'New Video',
|
244 |
+
'type' => 'title',
|
245 |
+
),
|
246 |
+
array(
|
247 |
+
'name' => 'Video Title',
|
248 |
+
'id' => $this->_id.'_post_title',
|
249 |
+
'type' => 'text',
|
250 |
+
),
|
251 |
+
array(
|
252 |
+
'name' => 'Description',
|
253 |
+
'id' => $this->_id.'_post_content',
|
254 |
+
'type' => 'textarea',
|
255 |
+
),
|
256 |
+
array(
|
257 |
+
'name' => 'Video File',
|
258 |
+
'id' => $this->_id.'_image',
|
259 |
+
'type' => 'image',
|
260 |
+
),
|
261 |
+
array(
|
262 |
+
'name' => 'Video Link',
|
263 |
+
'id' => $this->_id.'_link',
|
264 |
+
'type' => 'text',
|
265 |
+
),
|
266 |
+
array(
|
267 |
+
'name' => '_videocat',
|
268 |
+
'id' => $this->_id.'_videocat',
|
269 |
+
'default'=>$this->getCategory(),
|
270 |
+
'type' => 'hidden',
|
271 |
+
),
|
272 |
+
array(
|
273 |
+
'name' => '_metaid',
|
274 |
+
'id' => $this->_id.'_metaid',
|
275 |
+
'type' => 'hidden',
|
276 |
+
),
|
277 |
+
array(
|
278 |
+
'name' => 'Save Video',
|
279 |
+
'type' => 'submit',
|
280 |
+
),
|
281 |
+
);
|
282 |
+
add_action('metabox-show-'.$this->_id, array(&$this, '_renderListAttachments'), 20, 1 );
|
283 |
+
add_action('metabox-show-'.$this->_id, array(&$this, '_renderListVideoAttachments'), 20, 1 );
|
284 |
+
add_action('metabox-show-'.$this->_id, array(&$this, '_renderForm'), 20, 1 );
|
285 |
+
add_action('metabox-save-'.$this->_id, array(&$this, 'saveAsPostMeta'), 1, 2);
|
286 |
+
break;
|
287 |
+
}
|
288 |
+
}
|
289 |
+
|
290 |
+
/**
|
291 |
+
* Returns the category to use
|
292 |
+
*/
|
293 |
+
function getCategory()
|
294 |
+
{
|
295 |
+
return isset($this->_category_name)
|
296 |
+
? $this->_category_name
|
297 |
+
: '_videocat';
|
298 |
+
}
|
299 |
+
|
300 |
+
/**
|
301 |
+
* Method will save the posted content as an image attachment
|
302 |
+
*
|
303 |
+
*/
|
304 |
+
function saveAsAttachment( $source, $post_id )
|
305 |
+
{
|
306 |
+
if (empty($_FILES) || !isset($_REQUEST[$this->_id.'files'])) return $source;
|
307 |
+
|
308 |
+
// initializing
|
309 |
+
$property = $_REQUEST[$this->_id.'files'];
|
310 |
+
$post_data = array();
|
311 |
+
|
312 |
+
if (isset($source[$this->_id.'_post_title']) && $source[$this->_id.'_post_title']) {
|
313 |
+
$post_data['post_title'] = $source[$this->_id.'_post_title'];
|
314 |
+
}
|
315 |
+
|
316 |
+
if (isset($source[$this->_id.'_post_content']) && $source[$this->_id.'_post_content']) {
|
317 |
+
$post_data['post_content'] = $source[$this->_id.'_post_content'];
|
318 |
+
}
|
319 |
+
|
320 |
+
$id = media_handle_upload($property, $post_id, $post_data);
|
321 |
+
$source[$property] = $id;
|
322 |
+
|
323 |
+
$type = 'post';
|
324 |
+
if ($this->getCurrentPostType()) {
|
325 |
+
$type = $this->getCurrentPostType();
|
326 |
+
}
|
327 |
+
|
328 |
+
//saving the attachment ID to the taxonomy
|
329 |
+
if (!in_array($type, get_post_types(array('public' => false)))) {
|
330 |
+
$old = get_metadata($type, $post_id, $property, true);
|
331 |
+
if ($id && $id != $old) {
|
332 |
+
wp_delete_attachment( $old, true );
|
333 |
+
update_metadata($type, $post_id, $property, $id);
|
334 |
+
}
|
335 |
+
}
|
336 |
+
|
337 |
+
foreach ((array)$source as $property => $new)
|
338 |
+
{
|
339 |
+
//skip everything but the specially prefixed
|
340 |
+
if (strpos($property, $this->_id) !== 0) continue;
|
341 |
+
if (in_array($property, array(
|
342 |
+
$this->_id.'_post_title',
|
343 |
+
$this->_id.'_post_content',
|
344 |
+
))) continue;
|
345 |
+
|
346 |
+
$old = get_metadata($type, $id, $property, true);
|
347 |
+
if ($new && $new != $old) {
|
348 |
+
update_metadata($type, $id, $property, $new);
|
349 |
+
}
|
350 |
+
elseif (!$new) {
|
351 |
+
delete_metadata($type, $id, $property, $old);
|
352 |
+
}
|
353 |
+
}
|
354 |
+
|
355 |
+
return $source;
|
356 |
+
}
|
357 |
+
|
358 |
+
/**
|
359 |
+
* Method saves the data provided as post meta values
|
360 |
+
*
|
361 |
+
* @param array $source
|
362 |
+
* @param integer $post_id
|
363 |
+
*/
|
364 |
+
function saveAsPostMeta( $source, $post_id )
|
365 |
+
{
|
366 |
+
$type = 'post';
|
367 |
+
if (!$this->getCurrentPostType()) {
|
368 |
+
$type = $this->_table;
|
369 |
+
}
|
370 |
+
|
371 |
+
//save as a file
|
372 |
+
//if there's no FILES then we save as a meta
|
373 |
+
$source = $this->saveAsAttachment( $source, $post_id );
|
374 |
+
|
375 |
+
//get the ID of this meta set
|
376 |
+
$id = false;
|
377 |
+
if (isset($source[$this->_id.'_metaid']) && $source[$this->_id.'_metaid']) {
|
378 |
+
$id = $source[$this->_id.'_metaid'];
|
379 |
+
}
|
380 |
+
|
381 |
+
// if this is a built in metabox
|
382 |
+
if ($this->_type != 'default'
|
383 |
+
&& (!isset($source[$this->_id.'_image']) || !$source[$this->_id.'_image']))
|
384 |
+
return false;
|
385 |
+
|
386 |
+
// Saving only the specially prefixed items
|
387 |
+
foreach ((array)$source as $property => $new)
|
388 |
+
{
|
389 |
+
//skip everything but the specially prefixed
|
390 |
+
if (strpos($property, $this->_id) !== 0) continue;
|
391 |
+
|
392 |
+
//each meta set has it's own ID
|
393 |
+
$property = str_replace($this->_id, $this->_category_name.'_'.$id, $property);
|
394 |
+
|
395 |
+
$old = get_metadata($type, $post_id, $property, true);
|
396 |
+
if ($new && $new != $old) {
|
397 |
+
update_metadata($type, $post_id, $property, $new);
|
398 |
+
}
|
399 |
+
elseif (!$new) {
|
400 |
+
delete_metadata($type, $post_id, $property, $old);
|
401 |
+
}
|
402 |
+
}
|
403 |
+
|
404 |
+
// maybe there's a last id
|
405 |
+
if (!$id) {
|
406 |
+
if (!$id = get_metadata($type, $post_id, '_metaidlast', true)) {
|
407 |
+
$id = 0;
|
408 |
+
}
|
409 |
+
$id++;
|
410 |
+
update_metadata($type, $post_id, '_metaidlast', $id);
|
411 |
+
}
|
412 |
+
|
413 |
+
// saving all of the standard items
|
414 |
+
foreach ((array)$source as $property => $new)
|
415 |
+
{
|
416 |
+
//skip special properties that are prefixed with the id
|
417 |
+
if (strpos($property, $this->_id) === 0) continue;
|
418 |
+
|
419 |
+
$old = get_metadata($type, $post_id, $property, true);
|
420 |
+
update_metadata($type, $post_id, $property, $new);
|
421 |
+
|
422 |
+
// if ($new && $new != $old) {
|
423 |
+
// update_metadata($type, $post_id, $property, $new);
|
424 |
+
// }
|
425 |
+
// elseif (!$new) {
|
426 |
+
// delete_metadata($type, $post_id, $property, $old);
|
427 |
+
// }
|
428 |
+
|
429 |
+
}
|
430 |
+
|
431 |
+
return true;
|
432 |
+
}
|
433 |
+
|
434 |
+
/**
|
435 |
+
* Do something with the data entered
|
436 |
+
*
|
437 |
+
* @param integer $post_id
|
438 |
+
*/
|
439 |
+
function _save( $post_id )
|
440 |
+
{
|
441 |
+
//initializing
|
442 |
+
$post = get_post($post_id);
|
443 |
+
|
444 |
+
// verify if this is an auto save routine.
|
445 |
+
// If it is our form has not been submitted, so we dont want to do anything
|
446 |
+
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
|
447 |
+
return;
|
448 |
+
|
449 |
+
// verify this came from the our screen and with proper authorization,
|
450 |
+
// because save_post can be triggered at other times
|
451 |
+
if ( !isset($_REQUEST[ get_class().$this->_id ]) )
|
452 |
+
return;
|
453 |
+
|
454 |
+
if ( !wp_verify_nonce( $_REQUEST[ get_class().$this->_id ], plugin_basename( __FILE__ ) ) )
|
455 |
+
return;
|
456 |
+
|
457 |
+
// this metabox is to be displayed for a certain object type only
|
458 |
+
if ( !in_array($post->post_type, $this->_object_types) )
|
459 |
+
return;
|
460 |
+
|
461 |
+
// Check permissions
|
462 |
+
if ( 'page' == $post->post_type )
|
463 |
+
{
|
464 |
+
if ( !current_user_can( 'edit_page', $post->ID ) )
|
465 |
+
return;
|
466 |
+
}
|
467 |
+
else
|
468 |
+
{
|
469 |
+
if ( !current_user_can( 'edit_post', $post->ID ) )
|
470 |
+
return;
|
471 |
+
}
|
472 |
+
|
473 |
+
//saving the request data
|
474 |
+
if (!$this->_type) $this->setType();
|
475 |
+
do_action('metabox-save-'.$this->_id, $this->getRequestPostMetas(), $post->ID, $this );
|
476 |
+
return true;
|
477 |
+
}
|
478 |
+
|
479 |
+
/**
|
480 |
+
* Method returns the post meta
|
481 |
+
*
|
482 |
+
*/
|
483 |
+
function getRequestPostMetas()
|
484 |
+
{
|
485 |
+
$ignores = array('post_title', 'post_name', 'post_content', 'post_excerpt', 'post',
|
486 |
+
'post_status', 'post_type', 'post_author', 'ping_status', 'post_parent', 'message',
|
487 |
+
'post_category', 'comment_status', 'menu_order', 'to_ping', 'pinged', 'post_password',
|
488 |
+
'guid', 'post_content_filtered', 'import_id', 'post_date', 'post_date_gmt', 'tags_input',
|
489 |
+
'action');
|
490 |
+
|
491 |
+
$fields = array();
|
492 |
+
foreach ((array)$this->_fields as $field) {
|
493 |
+
if (!array_key_exists('id', $field)) continue;
|
494 |
+
$fields[] = $field['id'];
|
495 |
+
}
|
496 |
+
|
497 |
+
$requests = $_REQUEST;
|
498 |
+
foreach ((array)$requests as $k => $request)
|
499 |
+
{
|
500 |
+
if ((!empty($fields) && !in_array($k, $fields))
|
501 |
+
|| (in_array($k, $ignores) || strpos($k, 'nounce') !== false))
|
502 |
+
{
|
503 |
+
unset($requests[$k]);
|
504 |
+
}
|
505 |
+
}
|
506 |
+
|
507 |
+
return apply_filters('metabox-requests-'.$this->_id, $requests);
|
508 |
+
}
|
509 |
+
|
510 |
+
/**
|
511 |
+
* Display the inner contents of the metabox
|
512 |
+
*
|
513 |
+
* @param object $post
|
514 |
+
*/
|
515 |
+
function show( $post )
|
516 |
+
{
|
517 |
+
// Use nonce for verification
|
518 |
+
wp_nonce_field( plugin_basename( __FILE__ ), get_class().$this->_id );
|
519 |
+
do_action('metabox-show-'.$this->_id, $this->_fields, $this);
|
520 |
+
}
|
521 |
+
|
522 |
+
/**
|
523 |
+
* Method displays a list of attached images
|
524 |
+
*
|
525 |
+
*/
|
526 |
+
function _renderListImageAttachments()
|
527 |
+
{
|
528 |
+
global $post, $current_screen;
|
529 |
+
$images =& get_children( "post_parent=$post->ID&post_type=attachment&post_mime_type=image" );
|
530 |
+
|
531 |
+
// no images to render
|
532 |
+
if (empty($images)) {
|
533 |
+
?><p>No images have been saved.</p><?php
|
534 |
+
|
535 |
+
// rendering the images
|
536 |
+
} else {
|
537 |
+
|
538 |
+
?>
|
539 |
+
<table class="wp-list-table form-table widefat" style="border:none;">
|
540 |
+
<?php foreach ((array)$images as $post_id => $image): ?>
|
541 |
+
<?php $image_attributes = wp_get_attachment_image_src( $image->ID, 'thumbnail' ); ?>
|
542 |
+
<tbody id="the-list">
|
543 |
+
<tr>
|
544 |
+
<th scope="row" style="width: 140px">
|
545 |
+
<div style="padding:10px;background:whiteSmoke;">
|
546 |
+
<img src="<?php echo wp_get_attachment_thumb_url( $image->ID ); ?>" /></div>
|
547 |
+
</th>
|
548 |
+
<td>
|
549 |
+
<b><?php echo $image->post_title; ?></b>
|
550 |
+
<p><?php echo get_the_content($image->ID); ?></p>
|
551 |
+
|
552 |
+
<div class="row-actions">
|
553 |
+
<span class="inline">
|
554 |
+
<a href="<?php echo wp_nonce_url(
|
555 |
+
"media.php?attachment_id=$image->ID"
|
556 |
+
."&action=edit&_redirect="
|
557 |
+
.urlencode( $this->_currentPageURL() )
|
558 |
+
); ?>">
|
559 |
+
Edit</a> |
|
560 |
+
</span>
|
561 |
+
<span class="trash">
|
562 |
+
<a class="submitdelete"
|
563 |
+
onclick="return showNotice.warn();"
|
564 |
+
href="<?php echo wp_nonce_url(
|
565 |
+
"post.php?action=delete&_redirect="
|
566 |
+
.urlencode( $this->_currentPageURL() )
|
567 |
+
."&post=$image->ID",
|
568 |
+
'delete-attachment_' . $image->ID ); ?>">
|
569 |
+
Delete Permanently</a> |
|
570 |
+
</span>
|
571 |
+
<span class="inline">
|
572 |
+
<a target="_blank"
|
573 |
+
href="<?php echo get_attachment_link($image->ID); ?>">
|
574 |
+
View</a>
|
575 |
+
</span>
|
576 |
+
</div>
|
577 |
+
</td>
|
578 |
+
</tr>
|
579 |
+
</tbody>
|
580 |
+
<?php endforeach; ?>
|
581 |
+
</table>
|
582 |
+
<?php
|
583 |
+
}
|
584 |
+
return;
|
585 |
+
}
|
586 |
+
|
587 |
+
/**
|
588 |
+
* Return a clean list of meta listings created by this system
|
589 |
+
*
|
590 |
+
* @param string $category
|
591 |
+
* $param object $post
|
592 |
+
*/
|
593 |
+
public static function getMetaListings( $category, $post = null )
|
594 |
+
{
|
595 |
+
// initializing
|
596 |
+
if ($post === NULL) {
|
597 |
+
global $post;
|
598 |
+
}
|
599 |
+
$custom = get_post_custom($post->ID);
|
600 |
+
$return = array();
|
601 |
+
|
602 |
+
//looping all values to build our return array
|
603 |
+
foreach((array)$custom as $property => $value)
|
604 |
+
{
|
605 |
+
$parts = explode('_',$property);
|
606 |
+
if (!isset($parts[0]) || !isset($parts[1]) || !isset($parts[2])) continue;
|
607 |
+
if ($parts[0] != $category) continue;
|
608 |
+
|
609 |
+
$pro = str_replace($parts[0].'_'.$parts[1].'_', '', $property);
|
610 |
+
$return[$parts[1]][$pro] = $value;
|
611 |
+
}
|
612 |
+
|
613 |
+
return $return;
|
614 |
+
}
|
615 |
+
|
616 |
+
/**
|
617 |
+
* Function removes a specific category meta
|
618 |
+
*
|
619 |
+
* @param string $category
|
620 |
+
* $param string $meta_id
|
621 |
+
* $param object $post
|
622 |
+
*/
|
623 |
+
public static function deleteMetaListing( $category, $meta_id, $post = null )
|
624 |
+
{
|
625 |
+
// initializing
|
626 |
+
if ($post === NULL) {
|
627 |
+
global $post;
|
628 |
+
}
|
629 |
+
$listings = redrokk_metabox_class::getMetaListings( $category, $post );
|
630 |
+
if (!isset($listings[$meta_id])) return false;
|
631 |
+
|
632 |
+
$type = 'post';
|
633 |
+
|
634 |
+
foreach((array)$listings[$meta_id] as $property => $value) {
|
635 |
+
$pro = $category.'_'.$meta_id.'_'.$property;
|
636 |
+
delete_metadata($type, $post->ID, $pro, $value[0]);
|
637 |
+
}
|
638 |
+
return true;
|
639 |
+
}
|
640 |
+
|
641 |
+
/**
|
642 |
+
* Method displays a list of meta attachments
|
643 |
+
*
|
644 |
+
*/
|
645 |
+
function _renderListAttachments()
|
646 |
+
{
|
647 |
+
global $post;
|
648 |
+
|
649 |
+
//delete action prior to pulling new listings
|
650 |
+
if (isset($_REQUEST['redrokkdelete']) && $_REQUEST['redrokkdelete']) {
|
651 |
+
redrokk_metabox_class::deleteMetaListing($this->_category_name, $_REQUEST['redrokkdelete'], $post);
|
652 |
+
}
|
653 |
+
|
654 |
+
//pull new listings
|
655 |
+
$metaListings = redrokk_metabox_class::getMetaListings($this->_category_name, $post);
|
656 |
+
|
657 |
+
if (!empty($metaListings)) {
|
658 |
+
?>
|
659 |
+
<table class="wp-list-table form-table widefat" style="border:none;">
|
660 |
+
<tbody id="the-list">
|
661 |
+
<?php foreach ((array)$metaListings as $meta_id => $video): ?>
|
662 |
+
<?php $video = apply_filters('redrokk_metabox_class::_renderListAttachments', $video, $meta_id);?>
|
663 |
+
|
664 |
+
<tr id="<?php echo $this->_category_name; ?>_<?php echo $meta_id; ?>">
|
665 |
+
<th scope="row" style="width: 140px">
|
666 |
+
<div style="padding:10px;background:whiteSmoke;">
|
667 |
+
<?php if(isset($video['link'])) echo apply_filters('the_content', $video['link'][0]); ?>
|
668 |
+
</div>
|
669 |
+
</th>
|
670 |
+
<td>
|
671 |
+
<b><?php if(isset($video['post_title'])) echo $video['post_title'][0]; ?></b>
|
672 |
+
<p><?php if(isset($video['post_content'])) echo $video['post_content'][0]; ?></p>
|
673 |
+
|
674 |
+
<div class="row-actions">
|
675 |
+
<span class="inline">
|
676 |
+
<a href="#" id="edit_<?php echo $this->_category_name; ?>_<?php echo $meta_id; ?>">
|
677 |
+
Edit</a> |
|
678 |
+
</span>
|
679 |
+
<span class="trash">
|
680 |
+
<a class="submitdelete"
|
681 |
+
onclick="return showNotice.warn();"
|
682 |
+
href="<?php echo site_url( "wp-admin/post.php?post={$post->ID}"
|
683 |
+
."&action=edit"
|
684 |
+
."&redrokkdelete=$meta_id"
|
685 |
+
); ?>">
|
686 |
+
Delete Permanently</a>
|
687 |
+
</span>
|
688 |
+
</div>
|
689 |
+
<script>
|
690 |
+
jQuery('#edit_<?php echo $this->_category_name; ?>_<?php echo $meta_id; ?>').click(function(){
|
691 |
+
var data = {
|
692 |
+
<?php
|
693 |
+
$data = array();
|
694 |
+
|
695 |
+
//making sure all fields will be cleared
|
696 |
+
foreach ((array)$this->_fields as $field) {
|
697 |
+
if (!isset($field['id']) || !isset($field['type'])) continue;
|
698 |
+
if (!in_array($field['type'], array('text','file','image','textarea','hidden')))
|
699 |
+
continue;
|
700 |
+
|
701 |
+
$id = str_replace($this->_id.'_', '', $field['id']);
|
702 |
+
$data[$id] = "'$id':''";
|
703 |
+
}
|
704 |
+
|
705 |
+
//adding our values to the array
|
706 |
+
foreach((array)$video as $vp => $vv)
|
707 |
+
{
|
708 |
+
if (isset($vv[0])) $vv = $vv[0];
|
709 |
+
$data[$vp] = "'$vp':'$vv'";
|
710 |
+
}
|
711 |
+
|
712 |
+
//adding the meta ID to the array
|
713 |
+
$data[$id] = "'metaid':'$meta_id'";
|
714 |
+
|
715 |
+
echo implode(',',$data);
|
716 |
+
?>
|
717 |
+
};
|
718 |
+
|
719 |
+
jQuery.each(data, function(key, value){
|
720 |
+
jQuery('#<?php echo $this->_id; ?>_'+key).val( value );
|
721 |
+
});
|
722 |
+
return false;
|
723 |
+
});
|
724 |
+
</script>
|
725 |
+
</td>
|
726 |
+
<?php do_action('redrokk_metabox_class::_renderListAttachments::rows', $video, $meta_id, $this); ?>
|
727 |
+
</tr>
|
728 |
+
<?php endforeach; ?>
|
729 |
+
</tbody>
|
730 |
+
</table>
|
731 |
+
<?php
|
732 |
+
}
|
733 |
+
|
734 |
+
}
|
735 |
+
|
736 |
+
/**
|
737 |
+
* Method displays a list of attached videos
|
738 |
+
*
|
739 |
+
*/
|
740 |
+
function _renderListVideoAttachments()
|
741 |
+
{
|
742 |
+
global $post;
|
743 |
+
|
744 |
+
//pull new listings
|
745 |
+
$videos =& get_children( "post_parent=$post->ID&post_type=attachment&post_mime_type=video/mp4" );
|
746 |
+
|
747 |
+
// no images to render
|
748 |
+
if (!empty($videos)) {
|
749 |
+
?>
|
750 |
+
<table class="wp-list-table form-table widefat" style="border:none;">
|
751 |
+
<tbody id="the-list">
|
752 |
+
<?php foreach ((array)$videos as $post_id => $video): ?>
|
753 |
+
<?php $image_attributes = wp_get_attachment_link( $video->ID ); ?>
|
754 |
+
<tr>
|
755 |
+
<th scope="row" style="width: 140px">
|
756 |
+
<div style="padding:10px;background:whiteSmoke;">
|
757 |
+
<?php echo $image_attributes; ?>
|
758 |
+
</div>
|
759 |
+
</th>
|
760 |
+
<td>
|
761 |
+
<b><?php echo $video->post_title; ?></b>
|
762 |
+
<p><?php echo get_the_content($video->ID); ?></p>
|
763 |
+
|
764 |
+
<div class="row-actions">
|
765 |
+
<span class="inline">
|
766 |
+
<a href="<?php echo wp_nonce_url(
|
767 |
+
"media.php?attachment_id=$meta_id"
|
768 |
+
."&action=edit&_redirect="
|
769 |
+
.urlencode( $this->_currentPageURL() )
|
770 |
+
); ?>">
|
771 |
+
Edit</a> |
|
772 |
+
</span>
|
773 |
+
<span class="trash">
|
774 |
+
<a class="submitdelete"
|
775 |
+
onclick="return showNotice.warn();"
|
776 |
+
href="<?php echo wp_nonce_url(
|
777 |
+
"post.php?action=delete&_redirect="
|
778 |
+
.urlencode( $this->_currentPageURL() )
|
779 |
+
."&post=$video->ID",
|
780 |
+
'delete-attachment_' . $video->ID ); ?>">
|
781 |
+
Delete Permanently</a>
|
782 |
+
</span>
|
783 |
+
</div>
|
784 |
+
</td>
|
785 |
+
</tr>
|
786 |
+
<?php endforeach; ?>
|
787 |
+
</tbody>
|
788 |
+
</table>
|
789 |
+
<?php
|
790 |
+
}
|
791 |
+
}
|
792 |
+
|
793 |
+
/**
|
794 |
+
* Method renders the form from any source
|
795 |
+
*
|
796 |
+
* @param array $fields
|
797 |
+
*/
|
798 |
+
function _renderForm( $fields = array() )
|
799 |
+
{
|
800 |
+
//initializing
|
801 |
+
global $post;
|
802 |
+
$defaults = array(
|
803 |
+
'name' => '',
|
804 |
+
'desc' => '',
|
805 |
+
'id' => '',
|
806 |
+
'type' => 'text',
|
807 |
+
'options' => array(),
|
808 |
+
'default' => '',
|
809 |
+
'value' => '',
|
810 |
+
'class' => '',
|
811 |
+
'multiple' => '',
|
812 |
+
'args' => array(
|
813 |
+
'hide_empty' => 0,
|
814 |
+
'name' => 'element_name',
|
815 |
+
'hierarchical' => true
|
816 |
+
),
|
817 |
+
'attributes' => ''
|
818 |
+
);
|
819 |
+
|
820 |
+
// no fields to render
|
821 |
+
if (empty($fields)) {
|
822 |
+
?>
|
823 |
+
<p>No form fields have been defined. Use <pre>
|
824 |
+
$metabox->set('_fields', array(
|
825 |
+
array(
|
826 |
+
'name' => 'Title',
|
827 |
+
'type' => 'title',
|
828 |
+
),
|
829 |
+
array(
|
830 |
+
'name' => 'Title',
|
831 |
+
'desc' => '',
|
832 |
+
'id' => 'title',
|
833 |
+
'type' => 'text',
|
834 |
+
'std' => ''
|
835 |
+
),
|
836 |
+
array(
|
837 |
+
'name' => 'image',
|
838 |
+
'desc' => '',
|
839 |
+
'id' => 'imagefile',
|
840 |
+
'type' => 'image',
|
841 |
+
'std' => ''
|
842 |
+
),
|
843 |
+
array(
|
844 |
+
'name' => 'Textarea',
|
845 |
+
'desc' => 'Enter big text here',
|
846 |
+
'id' => 'textarea_id',
|
847 |
+
'type' => 'textarea',
|
848 |
+
'std' => 'Default value 2'
|
849 |
+
),
|
850 |
+
array(
|
851 |
+
'name' => 'Select box',
|
852 |
+
'id' => 'select_id',
|
853 |
+
'type' => 'select',
|
854 |
+
'options'=> array(
|
855 |
+
'value1' => 'Value 1',
|
856 |
+
'value2' => 'Value 2',
|
857 |
+
'value3' => 'Value 3',
|
858 |
+
'value4' => 'Value 4',
|
859 |
+
)
|
860 |
+
),
|
861 |
+
array(
|
862 |
+
'name' => 'Radio',
|
863 |
+
'id' => 'radio_id',
|
864 |
+
'type' => 'radio',
|
865 |
+
'value' => 'test',
|
866 |
+
'desc' => 'Check this box if you want its value saved',
|
867 |
+
),
|
868 |
+
array(
|
869 |
+
'name' => '',
|
870 |
+
'id' => 'radio_id',
|
871 |
+
'type' => 'radio',
|
872 |
+
'value' => 'test2',
|
873 |
+
'desc' => 'Check this box if you want its value saved',
|
874 |
+
),
|
875 |
+
array(
|
876 |
+
'name' => 'Checkbox',
|
877 |
+
'id' => 'checkbox_id',
|
878 |
+
'type' => 'checkbox',
|
879 |
+
'desc' => 'Check this box if you want its value saved',
|
880 |
+
),
|
881 |
+
));</pre>
|
882 |
+
</p>
|
883 |
+
<?php
|
884 |
+
|
885 |
+
// rendering the fields
|
886 |
+
} else {
|
887 |
+
?>
|
888 |
+
<table class="form-table">
|
889 |
+
<?php
|
890 |
+
// do_action("{$this->_class}_before");
|
891 |
+
$custom = get_post_custom($this->_id);
|
892 |
+
|
893 |
+
foreach ((array)$fields as $field):
|
894 |
+
$field = wp_parse_args($field, $defaults);
|
895 |
+
$field['args'] = wp_parse_args($field['args'], $defaults['args']);
|
896 |
+
|
897 |
+
extract($field);
|
898 |
+
$field['args']['name'] = $element_name = $id;
|
899 |
+
|
900 |
+
// grabbing the meta value
|
901 |
+
if (array_key_exists($id, $custom)) {
|
902 |
+
if (isset($custom[$id][0]))
|
903 |
+
$meta = esc_attr( $custom[$id][0] );
|
904 |
+
else
|
905 |
+
$meta = esc_attr( $custom[$id] );
|
906 |
+
} else {
|
907 |
+
$meta = $default;
|
908 |
+
}
|
909 |
+
|
910 |
+
$id = sanitize_title($id);
|
911 |
+
|
912 |
+
if (array_key_exists('deleteattachment', $_GET)
|
913 |
+
&& $id == $_GET['fileproperty']
|
914 |
+
&& $meta == $_GET['deleteattachment'])
|
915 |
+
{
|
916 |
+
wp_delete_attachment( $_GET['deleteattachment'], $force_delete = true );
|
917 |
+
update_post_meta($post->ID, $id, '');
|
918 |
+
}
|
919 |
+
?>
|
920 |
+
<?php switch ($type){ default: ?>
|
921 |
+
<?php if (is_callable($type) && function_exists($type)) : ?>
|
922 |
+
<tr>
|
923 |
+
<th scope="row" style="width: 140px">
|
924 |
+
<label for="<?php echo $id; ?>"><?php echo $name; ?></label>
|
925 |
+
</th>
|
926 |
+
<td>
|
927 |
+
<?php call_user_func($type, $args); ?>
|
928 |
+
<span class="description"><?php echo $desc; ?></span>
|
929 |
+
</td>
|
930 |
+
</tr>
|
931 |
+
<?php break; endif; ?>
|
932 |
+
<?php case 'text': ?>
|
933 |
+
<tr>
|
934 |
+
<th scope="row" style="width: 140px">
|
935 |
+
<label for="<?php echo $id; ?>"><?php echo $name; ?></label>
|
936 |
+
</th>
|
937 |
+
<td>
|
938 |
+
<input <?php echo $attributes ?>
|
939 |
+
id="<?php echo $id; ?>"
|
940 |
+
value="<?php echo $meta; ?>"
|
941 |
+
type="<?php echo $type; ?>"
|
942 |
+
name="<?php echo $id; ?>"
|
943 |
+
class="text large-text <?php echo $class; ?>" />
|
944 |
+
<span class="description"><?php echo $desc; ?></span>
|
945 |
+
</td>
|
946 |
+
</tr>
|
947 |
+
<?php break; ?>
|
948 |
+
<?php case 'submit': ?>
|
949 |
+
<?php case 'button': ?>
|
950 |
+
<tr>
|
951 |
+
<td colspan="2">
|
952 |
+
<input <?php echo $attributes ?>
|
953 |
+
id="<?php echo $id; ?>"
|
954 |
+
value="<?php echo $name; ?>"
|
955 |
+
type="submit"
|
956 |
+
name="submit"
|
957 |
+
class="button-primary <?php echo $class; ?>" />
|
958 |
+
<span class="description"><?php echo $desc; ?></span>
|
959 |
+
</td>
|
960 |
+
</tr>
|
961 |
+
<?php break; ?>
|
962 |
+
<?php case 'file': ?>
|
963 |
+
<?php case 'image': ?>
|
964 |
+
<tr>
|
965 |
+
<th scope="row" style="width: 140px">
|
966 |
+
<label for="<?php echo $id; ?>"><?php echo $name; ?></label>
|
967 |
+
</th>
|
968 |
+
<td>
|
969 |
+
<?php if ($meta && wp_get_attachment_url( $meta )): ?>
|
970 |
+
<?php echo wp_get_attachment_image( $meta ); ?>
|
971 |
+
<span><a href="<?php echo add_query_arg('fileproperty', $id, add_query_arg('deleteattachment', $meta, $this->_currentPageURL())); ?>">Delete Image</a></span>
|
972 |
+
<?php else: ?>
|
973 |
+
<input type="hidden" name="<?php echo $this->_id; ?>files" value="<?php echo $id; ?>" />
|
974 |
+
<!-- first hidden input forces this item to be submitted when it is not checked -->
|
975 |
+
<input <?php echo $attributes ?>
|
976 |
+
id="<?php echo $id; ?>"
|
977 |
+
type="file"
|
978 |
+
name="<?php echo $id; ?>"
|
979 |
+
onChange="jQuery(this).closest('form').attr('enctype', 'multipart/form-data');"
|
980 |
+
class="<?php echo $class; ?>" />
|
981 |
+
<?php endif; ?>
|
982 |
+
<span class="description"><?php echo $desc; ?></span>
|
983 |
+
</td>
|
984 |
+
</tr>
|
985 |
+
<?php break; ?>
|
986 |
+
<?php case 'title': ?>
|
987 |
+
<tr>
|
988 |
+
<th colspan="2" scope="row">
|
989 |
+
<h3 <?php echo $attributes ?> style="border: 1px solid #ddd;
|
990 |
+
padding: 10px;
|
991 |
+
background: #eee;
|
992 |
+
border-radius: 2px;
|
993 |
+
color: #666;
|
994 |
+
margin: 0;"><?php echo $name; ?>
|
995 |
+
</h3>
|
996 |
+
</th>
|
997 |
+
</tr>
|
998 |
+
<?php break; ?>
|
999 |
+
<?php case 'checkbox': ?>
|
1000 |
+
<tr>
|
1001 |
+
<th scope="row" style="width: 140px">
|
1002 |
+
<label for="<?php echo $id; ?>"><?php echo $name; ?></label>
|
1003 |
+
</th>
|
1004 |
+
<td>
|
1005 |
+
<input type="hidden" name="<?php echo $id; ?>" value="" />
|
1006 |
+
<!-- first hidden input forces this item to be submitted when it is not checked -->
|
1007 |
+
|
1008 |
+
<?php foreach ((array)$options as $_value => $_name): ?>
|
1009 |
+
<input value="<?php echo $_value; ?>" type="checkbox" <?php echo $attributes ?>
|
1010 |
+
name="<?php echo $element_name; ?>" id="<?php echo $id; ?>"
|
1011 |
+
<?php echo $meta == $_value? 'checked="checked"' :''; ?>
|
1012 |
+
class="<?php echo $class; ?>" />
|
1013 |
+
<?php echo $_name; ?>
|
1014 |
+
<?php endforeach; ?>
|
1015 |
+
<span class="description"><?php echo $desc; ?></span>
|
1016 |
+
</td>
|
1017 |
+
</tr>
|
1018 |
+
<?php break; ?>
|
1019 |
+
<?php case 'radio': ?>
|
1020 |
+
<tr>
|
1021 |
+
<th scope="row" style="width: 140px">
|
1022 |
+
<label for="<?php echo $id; ?>"><?php echo $name; ?></label>
|
1023 |
+
</th>
|
1024 |
+
<td>
|
1025 |
+
<?php foreach ((array)$options as $_value => $_name): ?>
|
1026 |
+
<input name="<?php echo $element_name; ?>" id="<?php echo $id; ?>"
|
1027 |
+
value="<?php echo $_value; ?>" type="<?php echo $type; ?>"
|
1028 |
+
<?php echo $meta == $_value?'checked="checked"' :''; ?>
|
1029 |
+
<?php echo $attributes ?> class="<?php echo $class; ?>" />
|
1030 |
+
<?php echo $_name; ?>
|
1031 |
+
<?php endforeach; ?>
|
1032 |
+
<span class="description"><?php echo $desc; ?></span>
|
1033 |
+
</td>
|
1034 |
+
</tr>
|
1035 |
+
<?php break; ?>
|
1036 |
+
<?php case 'textarea': ?>
|
1037 |
+
<tr>
|
1038 |
+
<th scope="row" style="width: 140px">
|
1039 |
+
<label for="<?php echo $id; ?>"><?php echo $name; ?></label>
|
1040 |
+
</th>
|
1041 |
+
<td>
|
1042 |
+
<textarea <?php echo $attributes ?>
|
1043 |
+
id="<?php echo $id; ?>"
|
1044 |
+
name="<?php echo $id; ?>"
|
1045 |
+
class="large-text <?php echo $class; ?>"
|
1046 |
+
><?php echo $meta; ?></textarea>
|
1047 |
+
<span class="description"><?php echo $desc; ?></span>
|
1048 |
+
</td>
|
1049 |
+
</tr>
|
1050 |
+
<?php break; ?>
|
1051 |
+
<?php case 'wpeditor': ?>
|
1052 |
+
<tr>
|
1053 |
+
<th scope="row" style="width: 140px">
|
1054 |
+
<label for="<?php echo $id; ?>"><?php echo $name; ?></label>
|
1055 |
+
</th>
|
1056 |
+
<td>
|
1057 |
+
<?php wp_editor( $meta, $id, $settings = array() ); ?>
|
1058 |
+
<span class="description"><?php echo $desc; ?></span>
|
1059 |
+
</td>
|
1060 |
+
</tr>
|
1061 |
+
<?php break; ?>
|
1062 |
+
<?php case 'select_capabilities': ?>
|
1063 |
+
<?php $options = $type=='select_capabilities' ?$this->get_options_capabilities()+$options :$options; ?>
|
1064 |
+
|
1065 |
+
<?php case 'select_roles': ?>
|
1066 |
+
<?php $options = $type=='select_roles' ?$this->get_options_roles()+$options :$options; ?>
|
1067 |
+
|
1068 |
+
<?php case 'select_menu': ?>
|
1069 |
+
<?php $options = $type=='select_menu' ?$this->get_options_menus()+$options :$options; ?>
|
1070 |
+
|
1071 |
+
<?php case 'select_pages': ?>
|
1072 |
+
<?php $options = $type=='select_pages' ?$this->get_options_pages()+$options :$options; ?>
|
1073 |
+
|
1074 |
+
<?php case 'select_users': ?>
|
1075 |
+
<?php $options = $type=='select_users' ?$this->get_options_users()+$options :$options; ?>
|
1076 |
+
|
1077 |
+
<?php case 'select_categories': ?>
|
1078 |
+
<?php case 'select': ?>
|
1079 |
+
<tr>
|
1080 |
+
<th scope="row" style="width: 140px">
|
1081 |
+
<label for="<?php echo $id; ?>"><?php echo $name; ?></label>
|
1082 |
+
</th>
|
1083 |
+
<td>
|
1084 |
+
<?php if ($type == 'select_categories'): ?>
|
1085 |
+
<?php wp_dropdown_categories($args); ?>
|
1086 |
+
|
1087 |
+
<?php else: ?>
|
1088 |
+
|
1089 |
+
<select <?php echo $attributes ?>
|
1090 |
+
id="<?php echo $id; ?>"
|
1091 |
+
name="<?php echo $id; ?>"
|
1092 |
+
class="<?php echo $class; ?>"
|
1093 |
+
<?php echo $multiple ?"MULTIPLE SIZE='$multiple'" :''; ?>
|
1094 |
+
><?php foreach ((array)$options as $_value => $_name): ?>
|
1095 |
+
|
1096 |
+
<option
|
1097 |
+
value="<?php echo $_value; ?>"
|
1098 |
+
<?php echo $meta == $_value ?' selected="selected"' :''; ?>
|
1099 |
+
><?php echo $_name; ?></option>
|
1100 |
+
|
1101 |
+
<?php endforeach; ?></select>
|
1102 |
+
<?php endif; ?>
|
1103 |
+
<span class="description"><?php echo $desc; ?></span>
|
1104 |
+
</td>
|
1105 |
+
</tr>
|
1106 |
+
<?php break; ?>
|
1107 |
+
<?php case 'hidden': ?>
|
1108 |
+
<tr>
|
1109 |
+
<td colspan="2">
|
1110 |
+
<input <?php echo $attributes ?>
|
1111 |
+
id="<?php echo $id; ?>"
|
1112 |
+
value="<?php echo $meta ?$meta :$default; ?>"
|
1113 |
+
type="<?php echo $type; ?>"
|
1114 |
+
name="<?php echo $id; ?>"
|
1115 |
+
style="visibility:hidden;" />
|
1116 |
+
</td>
|
1117 |
+
</tr>
|
1118 |
+
<?php break; ?>
|
1119 |
+
<?php case 'custom': ?>
|
1120 |
+
<tr>
|
1121 |
+
<td colspan="2">
|
1122 |
+
<?php echo $desc.$default; ?>
|
1123 |
+
</td>
|
1124 |
+
</tr>
|
1125 |
+
<?php } ?>
|
1126 |
+
<?php endforeach; ?>
|
1127 |
+
</table>
|
1128 |
+
<?php
|
1129 |
+
}
|
1130 |
+
return $this;
|
1131 |
+
}
|
1132 |
+
|
1133 |
+
/**
|
1134 |
+
* Returns an options list of menus
|
1135 |
+
*/
|
1136 |
+
function get_options_pages()
|
1137 |
+
{
|
1138 |
+
// initializing
|
1139 |
+
$options = array('0'=>' -- ');
|
1140 |
+
$pages = get_pages(array('post_type' => 'page', 'post_status' => 'publish'));
|
1141 |
+
|
1142 |
+
foreach($pages as $page) {
|
1143 |
+
$options[$page->ID] = $page->post_title;
|
1144 |
+
}
|
1145 |
+
|
1146 |
+
return $options;
|
1147 |
+
}
|
1148 |
+
|
1149 |
+
/**
|
1150 |
+
* Returns an options list of menus
|
1151 |
+
*/
|
1152 |
+
function get_options_menus()
|
1153 |
+
{
|
1154 |
+
// initializing
|
1155 |
+
$options = array('0'=>' -- ');
|
1156 |
+
$menus = get_terms('nav_menu', array(
|
1157 |
+
'hide_empty' => 0
|
1158 |
+
));
|
1159 |
+
|
1160 |
+
foreach($menus as $menu) {
|
1161 |
+
$options[$menu->slug] = $menu->name;
|
1162 |
+
}
|
1163 |
+
|
1164 |
+
return $options;
|
1165 |
+
}
|
1166 |
+
|
1167 |
+
/**
|
1168 |
+
* Returns an options list of users
|
1169 |
+
*/
|
1170 |
+
function get_options_users()
|
1171 |
+
{
|
1172 |
+
// initializing
|
1173 |
+
global $wpdb;
|
1174 |
+
|
1175 |
+
$options = array('0'=>' -- ');
|
1176 |
+
$query = $wpdb->prepare("SELECT $wpdb->users.ID, $wpdb->users.display_name FROM $wpdb->users");
|
1177 |
+
$results = $wpdb->get_results( $query );
|
1178 |
+
|
1179 |
+
foreach ((array)$results as $result)
|
1180 |
+
{
|
1181 |
+
$options[$result->ID] = $result->display_name;
|
1182 |
+
}
|
1183 |
+
|
1184 |
+
return $options;
|
1185 |
+
}
|
1186 |
+
|
1187 |
+
/**
|
1188 |
+
* Returns an options list of capabilities
|
1189 |
+
*/
|
1190 |
+
function get_options_capabilities()
|
1191 |
+
{
|
1192 |
+
// initializing
|
1193 |
+
global $wpdb;
|
1194 |
+
|
1195 |
+
$options = array();
|
1196 |
+
$roles = get_option($wpdb->prefix . 'user_roles');
|
1197 |
+
|
1198 |
+
foreach ((array)$roles as $role)
|
1199 |
+
{
|
1200 |
+
if(!isset($role['capabilities'])) continue;
|
1201 |
+
foreach ((array)$role['capabilities'] as $cap => $v)
|
1202 |
+
{
|
1203 |
+
$options[$role['name']."::$cap"] = $role['name']."::$cap";
|
1204 |
+
}
|
1205 |
+
}
|
1206 |
+
|
1207 |
+
return $options;
|
1208 |
+
}
|
1209 |
+
|
1210 |
+
/**
|
1211 |
+
* Returns an options list of roles
|
1212 |
+
*/
|
1213 |
+
function get_options_roles()
|
1214 |
+
{
|
1215 |
+
// initializing
|
1216 |
+
global $wpdb;
|
1217 |
+
|
1218 |
+
$options = array(
|
1219 |
+
'read' => 'Public'
|
1220 |
+
);
|
1221 |
+
$roles = get_option($wpdb->prefix . 'user_roles');
|
1222 |
+
|
1223 |
+
foreach ((array)$roles as $role)
|
1224 |
+
{
|
1225 |
+
$options[strtolower($role['name'])] = $role['name'];
|
1226 |
+
}
|
1227 |
+
|
1228 |
+
return $options;
|
1229 |
+
}
|
1230 |
+
|
1231 |
+
/**
|
1232 |
+
* Adds a box to the main column on the Post and Page edit screens
|
1233 |
+
*
|
1234 |
+
*/
|
1235 |
+
function _register()
|
1236 |
+
{
|
1237 |
+
// this metabox is to be displayed for a certain object type only
|
1238 |
+
if (!empty($this->_object_types) && !in_array($this->getCurrentPostType(), $this->_object_types) )
|
1239 |
+
return;
|
1240 |
+
|
1241 |
+
if (!$this->callback_args) {
|
1242 |
+
$this->callback_args = $this;
|
1243 |
+
}
|
1244 |
+
|
1245 |
+
// if the user has not already set the type of this metabox,
|
1246 |
+
// then we need to do that now
|
1247 |
+
if (!$this->_type) {
|
1248 |
+
$this->setType();
|
1249 |
+
}
|
1250 |
+
|
1251 |
+
add_meta_box(
|
1252 |
+
$this->_id,
|
1253 |
+
$this->title,
|
1254 |
+
$this->callback,
|
1255 |
+
$this->getCurrentPostType(),
|
1256 |
+
$this->context,
|
1257 |
+
$this->priority,
|
1258 |
+
$this->callback_args
|
1259 |
+
);
|
1260 |
+
}
|
1261 |
+
|
1262 |
+
/**
|
1263 |
+
* Method set's the hooks for the options creted by this metabox
|
1264 |
+
*
|
1265 |
+
*/
|
1266 |
+
function setOptionHooks()
|
1267 |
+
{
|
1268 |
+
foreach ((array)$this->_fields as $field)
|
1269 |
+
{
|
1270 |
+
if (!isset($field['id'])) continue;
|
1271 |
+
|
1272 |
+
//creating the callback for the admin page
|
1273 |
+
$function = create_function('$default','
|
1274 |
+
return redrokk_admin_class::getInstance("'.$this->_isAdminPage.'")
|
1275 |
+
->getOption("'.$field['id'].'", $default, true);
|
1276 |
+
');
|
1277 |
+
add_filter("pre_option_{$field['id']}", $function, 20, 2);
|
1278 |
+
}
|
1279 |
+
}
|
1280 |
+
|
1281 |
+
/**
|
1282 |
+
* Method redirects the user if we have added a request redirect
|
1283 |
+
* in the url
|
1284 |
+
*
|
1285 |
+
* @param string $location
|
1286 |
+
*/
|
1287 |
+
function _redirectIntervention( $location )
|
1288 |
+
{
|
1289 |
+
if (isset($_GET['_redirect'])) {
|
1290 |
+
$location = urldecode($_GET['_redirect']);
|
1291 |
+
}
|
1292 |
+
return $location;
|
1293 |
+
}
|
1294 |
+
|
1295 |
+
/**
|
1296 |
+
* Get the current page url
|
1297 |
+
*/
|
1298 |
+
function _currentPageURL()
|
1299 |
+
{
|
1300 |
+
$pageURL = 'http';
|
1301 |
+
if (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
|
1302 |
+
$pageURL .= "://";
|
1303 |
+
if ($_SERVER["SERVER_PORT"] != "80") {
|
1304 |
+
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
|
1305 |
+
} else {
|
1306 |
+
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
|
1307 |
+
}
|
1308 |
+
return $pageURL;
|
1309 |
+
}
|
1310 |
+
|
1311 |
+
/**
|
1312 |
+
* Method to bind an associative array or object to the JTable instance.This
|
1313 |
+
* method only binds properties that are publicly accessible and optionally
|
1314 |
+
* takes an array of properties to ignore when binding.
|
1315 |
+
*
|
1316 |
+
* @param mixed $src An associative array or object to bind to the JTable instance.
|
1317 |
+
* @param mixed $ignore An optional array or space separated list of properties to ignore while binding.
|
1318 |
+
*
|
1319 |
+
* @return boolean True on success.
|
1320 |
+
*
|
1321 |
+
* @link http://docs.joomla.org/JTable/bind
|
1322 |
+
* @since 11.1
|
1323 |
+
*/
|
1324 |
+
public function bind($src, $ignore = array())
|
1325 |
+
{
|
1326 |
+
// If the source value is not an array or object return false.
|
1327 |
+
if (!is_object($src) && !is_array($src))
|
1328 |
+
{
|
1329 |
+
trigger_error('Bind failed as the provided source is not an array.');
|
1330 |
+
return false;
|
1331 |
+
}
|
1332 |
+
|
1333 |
+
// If the source value is an object, get its accessible properties.
|
1334 |
+
if (is_object($src))
|
1335 |
+
{
|
1336 |
+
$src = get_object_vars($src);
|
1337 |
+
}
|
1338 |
+
|
1339 |
+
// If the ignore value is a string, explode it over spaces.
|
1340 |
+
if (!is_array($ignore))
|
1341 |
+
{
|
1342 |
+
$ignore = explode(' ', $ignore);
|
1343 |
+
}
|
1344 |
+
|
1345 |
+
// Bind the source value, excluding the ignored fields.
|
1346 |
+
foreach ($this->getProperties() as $k => $v)
|
1347 |
+
{
|
1348 |
+
// Only process fields not in the ignore array.
|
1349 |
+
if (!in_array($k, $ignore))
|
1350 |
+
{
|
1351 |
+
if (isset($src[$k]))
|
1352 |
+
{
|
1353 |
+
$this->$k = $src[$k];
|
1354 |
+
}
|
1355 |
+
}
|
1356 |
+
}
|
1357 |
+
|
1358 |
+
return true;
|
1359 |
+
}
|
1360 |
+
|
1361 |
+
/**
|
1362 |
+
* Set the object properties based on a named array/hash.
|
1363 |
+
*
|
1364 |
+
* @param mixed $properties Either an associative array or another object.
|
1365 |
+
*
|
1366 |
+
* @return boolean
|
1367 |
+
*
|
1368 |
+
* @since 11.1
|
1369 |
+
*
|
1370 |
+
* @see set()
|
1371 |
+
*/
|
1372 |
+
public function setProperties($properties)
|
1373 |
+
{
|
1374 |
+
if (is_array($properties) || is_object($properties))
|
1375 |
+
{
|
1376 |
+
foreach ((array) $properties as $k => $v)
|
1377 |
+
{
|
1378 |
+
// Use the set function which might be overridden.
|
1379 |
+
$this->set($k, $v);
|
1380 |
+
}
|
1381 |
+
return true;
|
1382 |
+
}
|
1383 |
+
|
1384 |
+
return false;
|
1385 |
+
}
|
1386 |
+
|
1387 |
+
/**
|
1388 |
+
* Modifies a property of the object, creating it if it does not already exist.
|
1389 |
+
*
|
1390 |
+
* @param string $property The name of the property.
|
1391 |
+
* @param mixed $value The value of the property to set.
|
1392 |
+
*
|
1393 |
+
* @return mixed Previous value of the property.
|
1394 |
+
*
|
1395 |
+
* @since 11.1
|
1396 |
+
*/
|
1397 |
+
public function set($property, $value = null)
|
1398 |
+
{
|
1399 |
+
$_property = 'set'.str_replace(' ', '', ucwords(str_replace('_', ' ', $property)));
|
1400 |
+
if (method_exists($this, $_property)) {
|
1401 |
+
return $this->$_property($value);
|
1402 |
+
}
|
1403 |
+
|
1404 |
+
$previous = isset($this->$property) ? $this->$property : null;
|
1405 |
+
$this->$property = $value;
|
1406 |
+
return $previous;
|
1407 |
+
}
|
1408 |
+
|
1409 |
+
/**
|
1410 |
+
* Returns an associative array of object properties.
|
1411 |
+
*
|
1412 |
+
* @param boolean $public If true, returns only the public properties.
|
1413 |
+
*
|
1414 |
+
* @return array
|
1415 |
+
*
|
1416 |
+
* @see get()
|
1417 |
+
*/
|
1418 |
+
public function getProperties($public = true)
|
1419 |
+
{
|
1420 |
+
$vars = get_object_vars($this);
|
1421 |
+
if ($public)
|
1422 |
+
{
|
1423 |
+
foreach ($vars as $key => $value)
|
1424 |
+
{
|
1425 |
+
if ('_' == substr($key, 0, 1))
|
1426 |
+
{
|
1427 |
+
unset($vars[$key]);
|
1428 |
+
}
|
1429 |
+
}
|
1430 |
+
}
|
1431 |
+
|
1432 |
+
return $vars;
|
1433 |
+
}
|
1434 |
+
|
1435 |
+
/**
|
1436 |
+
*
|
1437 |
+
* contains the current instance of this class
|
1438 |
+
* @var object
|
1439 |
+
*/
|
1440 |
+
static $_instances = null;
|
1441 |
+
|
1442 |
+
/**
|
1443 |
+
* Method is called when we need to instantiate this class
|
1444 |
+
*
|
1445 |
+
* @param array $options
|
1446 |
+
*/
|
1447 |
+
public static function getInstance( $_id, $options = array() )
|
1448 |
+
{
|
1449 |
+
if (!isset(self::$_instances[$_id]))
|
1450 |
+
{
|
1451 |
+
$options['_id'] = $_id;
|
1452 |
+
$class = get_class();
|
1453 |
+
self::$_instances[$_id] =& new $class($options);
|
1454 |
+
}
|
1455 |
+
return self::$_instances[$_id];
|
1456 |
+
}
|
1457 |
+
}
|
1458 |
+
endif;
|
lib/settings.css
ADDED
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.ui-tabs-nav {
|
2 |
+
border-bottom: 1px solid #ccc;
|
3 |
+
height: 27px;
|
4 |
+
margin: 20px 0;
|
5 |
+
padding: 0;
|
6 |
+
}
|
7 |
+
|
8 |
+
.ui-tabs-nav li {
|
9 |
+
display: block;
|
10 |
+
float: left;
|
11 |
+
margin: 0;
|
12 |
+
}
|
13 |
+
|
14 |
+
.ui-tabs-nav li a {
|
15 |
+
padding: 4px 20px 6px;
|
16 |
+
font-weight: bold;
|
17 |
+
}
|
18 |
+
|
19 |
+
.ui-tabs-nav li a {
|
20 |
+
border-style: solid;
|
21 |
+
border-color: #CCC #CCC #F9F9F9;
|
22 |
+
border-width: 1px 1px 0;
|
23 |
+
color: #C1C1C1;
|
24 |
+
text-shadow: rgba(255, 255, 255, 1) 0 1px 0;
|
25 |
+
display: inline-block;
|
26 |
+
padding: 4px 14px 6px;
|
27 |
+
text-decoration: none;
|
28 |
+
margin: 0 6px -1px 0;
|
29 |
+
-moz-border-radius: 5px 5px 0 0;
|
30 |
+
-webkit-border-top-left-radius: 5px;
|
31 |
+
-webkit-border-top-right-radius: 5px;
|
32 |
+
-khtml-border-top-left-radius: 5px;
|
33 |
+
-khtml-border-top-right-radius: 5px;
|
34 |
+
border-top-left-radius: 5px;
|
35 |
+
border-top-right-radius: 5px;
|
36 |
+
}
|
37 |
+
|
38 |
+
.ui-tabs-nav li.ui-tabs-selected a,
|
39 |
+
.ui-tabs-nav li.ui-state-active a {
|
40 |
+
border-width: 1px;
|
41 |
+
color: #464646;
|
42 |
+
}
|
43 |
+
|
44 |
+
.ui-tabs-panel {
|
45 |
+
clear: both;
|
46 |
+
}
|
47 |
+
|
48 |
+
.ui-tabs-panel h3 {
|
49 |
+
font: italic normal normal 24px/29px Georgia,"Times New Roman","Bitstream Charter",Times,serif;
|
50 |
+
margin: 0;
|
51 |
+
padding: 0 0 5px;
|
52 |
+
line-height: 35px;
|
53 |
+
text-shadow: 0 1px 0 #fff;
|
54 |
+
}
|
55 |
+
|
56 |
+
.ui-tabs-panel h4 {
|
57 |
+
font-size: 15px;
|
58 |
+
font-weight: bold;
|
59 |
+
margin: 1em 0;
|
60 |
+
}
|
61 |
+
|
62 |
+
.wrap h3, .wrap table {
|
63 |
+
display: none;
|
64 |
+
}
|
65 |
+
div.ready {
|
66 |
+
font-weight: bold;
|
67 |
+
clear: both;
|
68 |
+
padding-top: 1em;
|
69 |
+
}
|
70 |
+
p.submit {
|
71 |
+
padding-bottom: 2em;
|
72 |
+
}
|
73 |
+
div.copyright {
|
74 |
+
clear: both;
|
75 |
+
padding-top: 1em;
|
76 |
+
}
|
lib/settings.testimonials-widget.php
ADDED
@@ -0,0 +1,808 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Testimonials Widget settings class
|
5 |
+
*
|
6 |
+
* Based upon http://alisothegeek.com/2011/01/wordpress-settings-api-tutorial-1/
|
7 |
+
*/
|
8 |
+
class Testimonials_Widget_Settings {
|
9 |
+
const id = 'testimonialswidget_settings';
|
10 |
+
|
11 |
+
public static $default = array(
|
12 |
+
'id' => 'default_field',
|
13 |
+
'section' => 'general',
|
14 |
+
'title' => '',
|
15 |
+
'desc' => '',
|
16 |
+
'type' => 'text',
|
17 |
+
'choices' => array(),
|
18 |
+
'std' => '',
|
19 |
+
'class' => ''
|
20 |
+
);
|
21 |
+
public static $defaults = array();
|
22 |
+
public static $sections = array();
|
23 |
+
public static $settings = array();
|
24 |
+
public static $version = null;
|
25 |
+
|
26 |
+
|
27 |
+
public function __construct() {
|
28 |
+
self::load_sections();
|
29 |
+
self::load_settings();
|
30 |
+
|
31 |
+
add_action( 'admin_init', array( &$this, 'admin_init' ) );
|
32 |
+
add_action( 'admin_menu', array( &$this, 'admin_menu' ) );
|
33 |
+
load_plugin_textdomain( 'testimonials-widget', false, '/testimonials-widget/languages/' );
|
34 |
+
}
|
35 |
+
|
36 |
+
|
37 |
+
public static function load_sections() {
|
38 |
+
self::$sections['general'] = __( 'General' , 'testimonials-widget');
|
39 |
+
self::$sections['selection'] = __( 'Selection' , 'testimonials-widget');
|
40 |
+
self::$sections['ordering'] = __( 'Ordering' , 'testimonials-widget');
|
41 |
+
self::$sections['widget'] = __( 'Widget' , 'testimonials-widget');
|
42 |
+
// self::$sections['testing'] = __( 'Testing' , 'testimonials-widget');
|
43 |
+
self::$sections['post_type'] = __( 'Post Type' , 'testimonials-widget');
|
44 |
+
self::$sections['reset'] = __( 'Reset' , 'testimonials-widget');
|
45 |
+
self::$sections['about'] = __( 'About Testimonials Widget' , 'testimonials-widget');
|
46 |
+
|
47 |
+
self::$sections = apply_filters( 'testimonials_widget_sections', self::$sections );
|
48 |
+
}
|
49 |
+
|
50 |
+
|
51 |
+
public static function load_settings() {
|
52 |
+
// Widget
|
53 |
+
self::$settings['title'] = array(
|
54 |
+
'section' => 'widget',
|
55 |
+
'title' => __( 'Widget Title', 'testimonials-widget' ),
|
56 |
+
'std' => __( 'Testimonials', 'testimonials-widget' ),
|
57 |
+
);
|
58 |
+
|
59 |
+
self::$settings['title_link'] = array(
|
60 |
+
'section' => 'widget',
|
61 |
+
'title' => __( 'Title Link', 'testimonials-widget' ),
|
62 |
+
'desc' => __( 'URL or Post ID to link widget title to. Ex: 123 or http://example.com', 'testimonials-widget' ),
|
63 |
+
);
|
64 |
+
|
65 |
+
self::$settings['keep_whitespace'] = array(
|
66 |
+
'section' => 'widget',
|
67 |
+
'title' => __( 'Keep Whitespace?', 'testimonials-widget' ),
|
68 |
+
'desc' => __( 'Keeps testimonials looking as entered than sans auto-formatting', 'testimonials-widget' ),
|
69 |
+
'type' => 'checkbox',
|
70 |
+
);
|
71 |
+
|
72 |
+
self::$settings['min_height'] = array(
|
73 |
+
'section' => 'widget',
|
74 |
+
'title' => __( 'Minimum Height', 'testimonials-widget' ),
|
75 |
+
'desc' => __( 'Set for minimum display height, in pixels', 'testimonials-widget' ),
|
76 |
+
);
|
77 |
+
|
78 |
+
self::$settings['max_height'] = array(
|
79 |
+
'section' => 'widget',
|
80 |
+
'title' => __( 'Maximum Height', 'testimonials-widget' ),
|
81 |
+
'desc' => __( 'Set for maximum display height, in pixels', 'testimonials-widget' ),
|
82 |
+
);
|
83 |
+
|
84 |
+
self::$settings['refresh_interval'] = array(
|
85 |
+
'section' => 'widget',
|
86 |
+
'title' => __( 'Rotation Speed', 'testimonials-widget' ),
|
87 |
+
'desc' => __( 'Number of seconds between testimonial rotations or 0 for no rotation at all refresh', 'testimonials-widget' ),
|
88 |
+
'std' => 5,
|
89 |
+
);
|
90 |
+
|
91 |
+
// General
|
92 |
+
self::$settings['general_expand_begin'] = array(
|
93 |
+
'desc' => __( 'General Options', 'testimonials-widget' ),
|
94 |
+
'type' => 'expand_begin',
|
95 |
+
);
|
96 |
+
|
97 |
+
self::$settings['char_limit'] = array(
|
98 |
+
'title' => __( 'Character Limit', 'testimonials-widget' ),
|
99 |
+
'desc' => __( 'Number of characters to limit non-single testimonial views to', 'testimonials-widget' ),
|
100 |
+
);
|
101 |
+
|
102 |
+
self::$settings['hide_not_found'] = array(
|
103 |
+
'title' => __( 'Hide "Testimonials Not Found"?', 'testimonials-widget' ),
|
104 |
+
'type' => 'checkbox',
|
105 |
+
);
|
106 |
+
|
107 |
+
self::$settings['hide_gravatar'] = array(
|
108 |
+
'title' => __( 'Hide Gravatar Image?', 'testimonials-widget' ),
|
109 |
+
'type' => 'checkbox',
|
110 |
+
);
|
111 |
+
|
112 |
+
self::$settings['hide_image'] = array(
|
113 |
+
'title' => __( 'Hide Image?', 'testimonials-widget' ),
|
114 |
+
'type' => 'checkbox',
|
115 |
+
);
|
116 |
+
|
117 |
+
self::$settings['hide_content'] = array(
|
118 |
+
'title' => __( 'Hide Testimonial Content?', 'testimonials-widget' ),
|
119 |
+
'type' => 'checkbox',
|
120 |
+
);
|
121 |
+
|
122 |
+
self::$settings['hide_source'] = array(
|
123 |
+
'title' => __( 'Hide Author/Source?', 'testimonials-widget' ),
|
124 |
+
'type' => 'checkbox',
|
125 |
+
'desc' => __( 'Don\'t display "Post Title" in cite', 'testimonials-widget' ),
|
126 |
+
);
|
127 |
+
|
128 |
+
self::$settings['hide_email'] = array(
|
129 |
+
'title' => __( 'Hide Email?', 'testimonials-widget' ),
|
130 |
+
'type' => 'checkbox',
|
131 |
+
'std' => 1,
|
132 |
+
);
|
133 |
+
|
134 |
+
self::$settings['hide_title'] = array(
|
135 |
+
'title' => __( 'Hide Title?', 'testimonials-widget' ),
|
136 |
+
'type' => 'checkbox',
|
137 |
+
);
|
138 |
+
|
139 |
+
self::$settings['hide_company'] = array(
|
140 |
+
'title' => __( 'Hide Company?', 'testimonials-widget' ),
|
141 |
+
'type' => 'checkbox',
|
142 |
+
);
|
143 |
+
|
144 |
+
self::$settings['hide_url'] = array(
|
145 |
+
'title' => __( 'Hide URL?', 'testimonials-widget' ),
|
146 |
+
'type' => 'checkbox',
|
147 |
+
);
|
148 |
+
|
149 |
+
self::$settings['target'] = array(
|
150 |
+
'title' => __( 'URL Target', 'testimonials-widget' ),
|
151 |
+
'desc' => __( 'Adds target to all URLs; leave blank if none', 'testimonials-widget' ),
|
152 |
+
);
|
153 |
+
|
154 |
+
self::$settings['bottom_text'] = array(
|
155 |
+
'title' => __( 'Testimonial Bottom Text', 'testimonials-widget' ),
|
156 |
+
'desc' => __( 'Custom text or HTML for bottom of testimonials', 'testimonials-widget' ),
|
157 |
+
'type' => 'textarea',
|
158 |
+
);
|
159 |
+
|
160 |
+
self::$settings['paging'] = array(
|
161 |
+
'title' => __( 'Enable Paging?', 'testimonials-widget' ),
|
162 |
+
'desc' => __( 'For `[testimonialswidget_list]`', 'testimonials-widget' ),
|
163 |
+
'type' => 'select',
|
164 |
+
'choices' => array(
|
165 |
+
'' => __( 'Disable', 'testimonials-widget' ),
|
166 |
+
1 => __( 'Enable', 'testimonials-widget' ),
|
167 |
+
'before' => __( 'Before testimonials', 'testimonials-widget' ),
|
168 |
+
'after' => __( 'After testimonials', 'testimonials-widget' ),
|
169 |
+
),
|
170 |
+
'std' => 1,
|
171 |
+
);
|
172 |
+
|
173 |
+
self::$settings['remove_hentry'] = array(
|
174 |
+
'title' => __( 'Remove `.hentry` CSS?', 'testimonials-widget' ),
|
175 |
+
'desc' => __( 'Some themes use class `.hentry` in a manner that breaks Testimonials Widgets CSS', 'testimonials-widget' ),
|
176 |
+
'type' => 'checkbox',
|
177 |
+
);
|
178 |
+
|
179 |
+
self::$settings['general_expand_end'] = array(
|
180 |
+
'type' => 'expand_end',
|
181 |
+
);
|
182 |
+
|
183 |
+
// Selection
|
184 |
+
self::$settings['selection_expand_begin'] = array(
|
185 |
+
'section' => 'selection',
|
186 |
+
'desc' => __( 'Selection Options', 'testimonials-widget' ),
|
187 |
+
'type' => 'expand_begin',
|
188 |
+
);
|
189 |
+
|
190 |
+
self::$settings['category'] = array(
|
191 |
+
'section' => 'selection',
|
192 |
+
'title' => __( 'Category Filter', 'testimonials-widget' ),
|
193 |
+
'desc' => __( 'Comma separated category slug-names. Ex: category-a, another-category', 'testimonials-widget' ),
|
194 |
+
);
|
195 |
+
|
196 |
+
self::$settings['tags'] = array(
|
197 |
+
'section' => 'selection',
|
198 |
+
'title' => __( 'Tags Filter', 'testimonials-widget' ),
|
199 |
+
'desc' => __( 'Comma separated tag slug-names. Ex: tag-a, another-tag', 'testimonials-widget' ),
|
200 |
+
);
|
201 |
+
|
202 |
+
self::$settings['tags_all'] = array(
|
203 |
+
'section' => 'selection',
|
204 |
+
'title' => __( 'Require All Tags?', 'testimonials-widget' ),
|
205 |
+
'desc' => __( 'Select only testimonials with all of the given tags', 'testimonials-widget' ),
|
206 |
+
'type' => 'checkbox',
|
207 |
+
);
|
208 |
+
|
209 |
+
self::$settings['ids'] = array(
|
210 |
+
'section' => 'selection',
|
211 |
+
'title' => __( 'Include IDs Filter', 'testimonials-widget' ),
|
212 |
+
'desc' => __( 'Comma separated testimonial IDs. Ex: 3,1,2', 'testimonials-widget' ),
|
213 |
+
);
|
214 |
+
|
215 |
+
self::$settings['exclude'] = array(
|
216 |
+
'section' => 'selection',
|
217 |
+
'title' => __( 'Exclude IDs Filter', 'testimonials-widget' ),
|
218 |
+
'desc' => __( 'Comma separated testimonial IDs. Ex: 3,1,2', 'testimonials-widget' ),
|
219 |
+
);
|
220 |
+
|
221 |
+
self::$settings['limit'] = array(
|
222 |
+
'section' => 'selection',
|
223 |
+
'title' => __( 'Limit', 'testimonials-widget' ),
|
224 |
+
'desc' => __( 'Number of testimonials to select per instance', 'testimonials-widget' ),
|
225 |
+
'std' => 10,
|
226 |
+
);
|
227 |
+
|
228 |
+
self::$settings['selection_expand_end'] = array(
|
229 |
+
'section' => 'selection',
|
230 |
+
'type' => 'expand_end',
|
231 |
+
);
|
232 |
+
|
233 |
+
// Ordering
|
234 |
+
self::$settings['ordering_expand_begin'] = array(
|
235 |
+
'section' => 'ordering',
|
236 |
+
'desc' => __( 'Ordering Options', 'testimonials-widget' ),
|
237 |
+
'type' => 'expand_begin',
|
238 |
+
);
|
239 |
+
|
240 |
+
self::$settings['random'] = array(
|
241 |
+
'section' => 'ordering',
|
242 |
+
'title' => __( 'Random Order?', 'testimonials-widget' ),
|
243 |
+
'desc' => __( 'If checked, ignores ORDER BY, ORDER BY meta_key, and ORDER BY Order. Widgets are random by default automatically', 'testimonials-widget' ),
|
244 |
+
'type' => 'checkbox',
|
245 |
+
);
|
246 |
+
|
247 |
+
self::$settings['orderby'] = array(
|
248 |
+
'section' => 'ordering',
|
249 |
+
'title' => __( 'ORDER BY', 'testimonials-widget' ),
|
250 |
+
'desc' => __( 'Used when "Random Order" is disabled', 'testimonials-widget' ),
|
251 |
+
'type' => 'select',
|
252 |
+
'choices' => array(
|
253 |
+
'ID' => __( 'Testimonial ID', 'testimonials-widget' ),
|
254 |
+
'author' => __( 'Author', 'testimonials-widget' ),
|
255 |
+
'title' => __( 'Source', 'testimonials-widget' ),
|
256 |
+
'date' => __( 'Date', 'testimonials-widget' ),
|
257 |
+
'none' => __( 'No order', 'testimonials-widget' ),
|
258 |
+
),
|
259 |
+
'std' => 'ID',
|
260 |
+
);
|
261 |
+
|
262 |
+
self::$settings['meta_key'] = array(
|
263 |
+
'section' => 'ordering',
|
264 |
+
'title' => __( 'ORDER BY meta_key', 'testimonials-widget' ),
|
265 |
+
'desc' => __( 'Used when "Random Order" is disabled and sorting by a testimonials meta key is needed. Overrides ORDER BY', 'testimonials-widget' ),
|
266 |
+
'type' => 'select',
|
267 |
+
'choices' => array(
|
268 |
+
'' => __( 'None' , 'testimonials-widget'),
|
269 |
+
'testimonials-widget-title' => __( 'Title' , 'testimonials-widget'),
|
270 |
+
'testimonials-widget-email' => __( 'Email' , 'testimonials-widget'),
|
271 |
+
'testimonials-widget-company' => __( 'Company' , 'testimonials-widget'),
|
272 |
+
'testimonials-widget-url' => __( 'URL' , 'testimonials-widget'),
|
273 |
+
),
|
274 |
+
);
|
275 |
+
|
276 |
+
self::$settings['order'] = array(
|
277 |
+
'section' => 'ordering',
|
278 |
+
'title' => __( 'ORDER BY Order', 'testimonials-widget' ),
|
279 |
+
'type' => 'select',
|
280 |
+
'choices' => array(
|
281 |
+
'DESC' => __( 'Descending', 'testimonials-widget' ),
|
282 |
+
'ASC' => __( 'Ascending', 'testimonials-widget' ),
|
283 |
+
),
|
284 |
+
'std' => 'DESC',
|
285 |
+
);
|
286 |
+
|
287 |
+
self::$settings['ordering_expand_end'] = array(
|
288 |
+
'section' => 'ordering',
|
289 |
+
'type' => 'expand_end',
|
290 |
+
);
|
291 |
+
|
292 |
+
// Debug
|
293 |
+
self::$settings['debug_mode'] = array(
|
294 |
+
'section' => 'testing',
|
295 |
+
'title' => __( 'Debug Mode?' , 'testimonials-widget'),
|
296 |
+
'desc' => __( 'Not implemented yet', 'testimonials-widget' ),
|
297 |
+
'type' => 'checkbox',
|
298 |
+
);
|
299 |
+
|
300 |
+
// Post Type
|
301 |
+
self::$settings['allow_comments'] = array(
|
302 |
+
'section' => 'post_type',
|
303 |
+
'title' => __( 'Allow Comments?' , 'testimonials-widget'),
|
304 |
+
'desc' => __( 'If checked, allows commenting on testimonial single-view pages', 'testimonials-widget' ),
|
305 |
+
'type' => 'checkbox',
|
306 |
+
);
|
307 |
+
|
308 |
+
$desc = __( 'URL slug-name for <a href="%1s">testimonials archive</a> page. After changing, you must click "Save Changes" on <a href="%2s">Permalink Settings</a> to update them.', 'testimonials-widget' );
|
309 |
+
$has_archive = tw_get_option( 'has_archive', '' );
|
310 |
+
$site_url = site_url( '/' . $has_archive );
|
311 |
+
$url = admin_url( 'options-permalink.php' );
|
312 |
+
self::$settings['has_archive'] = array(
|
313 |
+
'section' => 'post_type',
|
314 |
+
'title' => __( 'Archive Page URL' , 'testimonials-widget'),
|
315 |
+
'desc' => sprintf( $desc, $site_url, $url ),
|
316 |
+
'std' => 'testimonials',
|
317 |
+
);
|
318 |
+
|
319 |
+
$desc = __( 'URL slug-name for testimonial view pages. After changing, you must click "Save Changes" on <a href="%1s">Permalink Settings</a> to update them.', 'testimonials-widget' );
|
320 |
+
self::$settings['rewrite_slug'] = array(
|
321 |
+
'section' => 'post_type',
|
322 |
+
'title' => __( 'Testimonial Page URL' , 'testimonials-widget'),
|
323 |
+
'desc' => sprintf( $desc, $url ),
|
324 |
+
'std' => 'testimonial',
|
325 |
+
);
|
326 |
+
|
327 |
+
// Reset
|
328 |
+
self::$settings['reset_defaults'] = array(
|
329 |
+
'section' => 'reset',
|
330 |
+
'title' => __( 'Reset to Defaults?' , 'testimonials-widget'),
|
331 |
+
'type' => 'checkbox',
|
332 |
+
'class' => 'warning', // Custom class for CSS
|
333 |
+
'desc' => __( 'Check this box to reset options to their defaults' , 'testimonials-widget')
|
334 |
+
);
|
335 |
+
|
336 |
+
// Reference
|
337 |
+
if ( false ) {
|
338 |
+
self::$settings['example_text'] = array(
|
339 |
+
'title' => __( 'Example Text Input' , 'testimonials-widget'),
|
340 |
+
'desc' => __( 'This is a description for the text input.' , 'testimonials-widget'),
|
341 |
+
'std' => 'Default value',
|
342 |
+
);
|
343 |
+
|
344 |
+
self::$settings['example_textarea'] = array(
|
345 |
+
'title' => __( 'Example Textarea Input' , 'testimonials-widget'),
|
346 |
+
'desc' => __( 'This is a description for the textarea input.' , 'testimonials-widget'),
|
347 |
+
'std' => 'Default value',
|
348 |
+
'type' => 'textarea',
|
349 |
+
);
|
350 |
+
|
351 |
+
self::$settings['example_checkbox'] = array(
|
352 |
+
'title' => __( 'Example Checkbox' , 'testimonials-widget'),
|
353 |
+
'desc' => __( 'This is a description for the checkbox.' , 'testimonials-widget'),
|
354 |
+
'type' => 'checkbox',
|
355 |
+
'std' => 1 // Set to 1 to be checked by default, 0 to be unchecked by default.
|
356 |
+
);
|
357 |
+
|
358 |
+
self::$settings['example_heading'] = array(
|
359 |
+
'title' => '', // Not used for headings.
|
360 |
+
'desc' => 'Example Heading',
|
361 |
+
'type' => 'heading'
|
362 |
+
);
|
363 |
+
|
364 |
+
self::$settings['example_radio'] = array(
|
365 |
+
'title' => __( 'Example Radio' , 'testimonials-widget'),
|
366 |
+
'desc' => __( 'This is a description for the radio buttons.' , 'testimonials-widget'),
|
367 |
+
'type' => 'radio',
|
368 |
+
'choices' => array(
|
369 |
+
'choice1' => 'Choice 1',
|
370 |
+
'choice2' => 'Choice 2',
|
371 |
+
'choice3' => 'Choice 3'
|
372 |
+
)
|
373 |
+
);
|
374 |
+
|
375 |
+
self::$settings['example_select'] = array(
|
376 |
+
'title' => __( 'Example Select' , 'testimonials-widget'),
|
377 |
+
'desc' => __( 'This is a description for the drop-down.' , 'testimonials-widget'),
|
378 |
+
'type' => 'select',
|
379 |
+
'choices' => array(
|
380 |
+
'choice1' => 'Other Choice 1',
|
381 |
+
'choice2' => 'Other Choice 2',
|
382 |
+
'choice3' => 'Other Choice 3'
|
383 |
+
)
|
384 |
+
);
|
385 |
+
}
|
386 |
+
|
387 |
+
self::$settings = apply_filters( 'testimonials_widget_settings', self::$settings );
|
388 |
+
|
389 |
+
foreach ( self::$settings as $id => $parts ) {
|
390 |
+
self::$settings[ $id ] = wp_parse_args( $parts, self::$default );
|
391 |
+
}
|
392 |
+
}
|
393 |
+
|
394 |
+
|
395 |
+
public static function get_defaults() {
|
396 |
+
if ( empty( self::$defaults ) )
|
397 |
+
self::load_settings();
|
398 |
+
|
399 |
+
foreach ( self::$settings as $id => $parts ) {
|
400 |
+
self::$defaults[$id] = isset( $parts[ 'std' ] ) ? $parts[ 'std' ] : '';
|
401 |
+
}
|
402 |
+
|
403 |
+
return self::$defaults;
|
404 |
+
}
|
405 |
+
|
406 |
+
|
407 |
+
public static function get_settings() {
|
408 |
+
if ( empty( self::$settings ) )
|
409 |
+
self::load_settings();
|
410 |
+
|
411 |
+
return self::$settings;
|
412 |
+
}
|
413 |
+
|
414 |
+
|
415 |
+
public function admin_init() {
|
416 |
+
$version = tw_get_option( 'version' );
|
417 |
+
self::$version = Testimonials_Widget::version;
|
418 |
+
self::$version = apply_filters( 'testimonials_widget_version', self::$version );
|
419 |
+
|
420 |
+
if ( $version != self::$version )
|
421 |
+
$this->initialize_settings();
|
422 |
+
|
423 |
+
$this->register_settings();
|
424 |
+
}
|
425 |
+
|
426 |
+
|
427 |
+
public function admin_menu() {
|
428 |
+
$admin_page = add_submenu_page( 'edit.php?post_type=' . Testimonials_Widget::pt, __( 'Testimonials Widget Settings', 'testimonials-widget' ), __( 'Settings', 'testimonials-widget' ), 'manage_options', self::id, array( 'Testimonials_Widget_Settings', 'display_page' ) );
|
429 |
+
|
430 |
+
add_action( 'admin_print_scripts-' . $admin_page, array( &$this, 'scripts' ) );
|
431 |
+
add_action( 'admin_print_styles-' . $admin_page, array( &$this, 'styles' ) );
|
432 |
+
}
|
433 |
+
|
434 |
+
|
435 |
+
public function create_setting( $args = array() ) {
|
436 |
+
extract( $args );
|
437 |
+
|
438 |
+
if ( preg_match( '#(_expand_begin|_expand_end)#', $id ) )
|
439 |
+
return;
|
440 |
+
|
441 |
+
$field_args = array(
|
442 |
+
'type' => $type,
|
443 |
+
'id' => $id,
|
444 |
+
'desc' => $desc,
|
445 |
+
'std' => $std,
|
446 |
+
'choices' => $choices,
|
447 |
+
'label_for' => $id,
|
448 |
+
'class' => $class
|
449 |
+
);
|
450 |
+
|
451 |
+
self::$defaults[$id] = $std;
|
452 |
+
|
453 |
+
add_settings_field( $id, $title, array( &$this, 'display_setting' ), self::id, $section, $field_args );
|
454 |
+
}
|
455 |
+
|
456 |
+
|
457 |
+
public function display_page() {
|
458 |
+
echo '<div class="wrap">
|
459 |
+
<div class="icon32" id="icon-options-general"></div>
|
460 |
+
<h2>' . __( 'Testimonials Widget Settings' , 'testimonials-widget') . '</h2>';
|
461 |
+
|
462 |
+
echo '<form action="options.php" method="post">';
|
463 |
+
|
464 |
+
settings_fields( self::id );
|
465 |
+
|
466 |
+
echo '<div class="ui-tabs">
|
467 |
+
<ul class="ui-tabs-nav">';
|
468 |
+
|
469 |
+
foreach ( self::$sections as $section_slug => $section )
|
470 |
+
echo '<li><a href="#' . $section_slug . '">' . $section . '</a></li>';
|
471 |
+
|
472 |
+
echo '</ul>';
|
473 |
+
|
474 |
+
do_settings_sections( self::id );
|
475 |
+
|
476 |
+
echo '</div>';
|
477 |
+
|
478 |
+
echo '
|
479 |
+
<p class="submit"><input name="Submit" type="submit" class="button-primary" value="' . __( 'Save Changes' , 'testimonials-widget') . '" /></p>
|
480 |
+
</form>
|
481 |
+
';
|
482 |
+
|
483 |
+
echo '
|
484 |
+
<p>When ready, <a href="'.get_admin_url().'edit.php?post_type=testimonials-widget">view</a>
|
485 |
+
or <a href="'.get_admin_url().'post-new.php?post_type=testimonials-widget">add</a> testimonials.</p>
|
486 |
+
|
487 |
+
<p>If you like this plugin, <a href="http://aihr.us/about-aihrus/donate/" title="Donate for Good Karma">please donate</a> or <a href="http://aihr.us/wordpress/testimonials-widget-premium/" title="purchase Testimonials Widget Premium">purchase Testimonials Widget Premium</a> to help fund further development and <a href="http://wordpress.org/support/plugin/testimonials-widget" title="Support forums">support</a>.</p>
|
488 |
+
';
|
489 |
+
|
490 |
+
$text = __( 'Copyright ©%1$s %2$s.' , 'testimonials-widget');
|
491 |
+
$link = '<a href="http://aihr.us">Aihrus</a>';
|
492 |
+
$copyright = '<div class="copyright">' . sprintf( $text, date( 'Y' ), $link ) . '</div>';
|
493 |
+
echo $copyright;
|
494 |
+
|
495 |
+
self::section_scripts();
|
496 |
+
|
497 |
+
echo '</div>';
|
498 |
+
}
|
499 |
+
|
500 |
+
|
501 |
+
public static function section_scripts() {
|
502 |
+
echo '<script type="text/javascript">
|
503 |
+
jQuery(document).ready(function($) {
|
504 |
+
var sections = [];';
|
505 |
+
|
506 |
+
foreach ( self::$sections as $section_slug => $section )
|
507 |
+
echo "sections['$section'] = '$section_slug';";
|
508 |
+
|
509 |
+
echo 'var wrapped = $(".wrap h3").wrap("<div class=\"ui-tabs-panel\">");
|
510 |
+
wrapped.each(function() {
|
511 |
+
$(this).parent().append($(this).parent().nextUntil("div.ui-tabs-panel"));
|
512 |
+
});
|
513 |
+
$(".ui-tabs-panel").each(function(index) {
|
514 |
+
$(this).attr("id", sections[$(this).children("h3").text()]);
|
515 |
+
if (index > 0)
|
516 |
+
$(this).addClass("ui-tabs-hide");
|
517 |
+
});
|
518 |
+
$(".ui-tabs").tabs({
|
519 |
+
fx: { opacity: "toggle", duration: "fast" }
|
520 |
+
});
|
521 |
+
|
522 |
+
$("input[type=text], textarea").each(function() {
|
523 |
+
if ($(this).val() == $(this).attr("placeholder") || $(this).val() == "")
|
524 |
+
$(this).css("color", "#999");
|
525 |
+
});
|
526 |
+
|
527 |
+
$("input[type=text], textarea").focus(function() {
|
528 |
+
if ($(this).val() == $(this).attr("placeholder") || $(this).val() == "") {
|
529 |
+
$(this).val("");
|
530 |
+
$(this).css("color", "#000");
|
531 |
+
}
|
532 |
+
}).blur(function() {
|
533 |
+
if ($(this).val() == "" || $(this).val() == $(this).attr("placeholder")) {
|
534 |
+
$(this).val($(this).attr("placeholder"));
|
535 |
+
$(this).css("color", "#999");
|
536 |
+
}
|
537 |
+
});
|
538 |
+
|
539 |
+
$(".wrap h3, .wrap table").show();
|
540 |
+
|
541 |
+
// This will make the "warning" checkbox class really stand out when checked.
|
542 |
+
// I use it here for the Reset checkbox.
|
543 |
+
$(".warning").change(function() {
|
544 |
+
if ($(this).is(":checked"))
|
545 |
+
$(this).parent().css("background", "#c00").css("color", "#fff").css("fontWeight", "bold");
|
546 |
+
else
|
547 |
+
$(this).parent().css("background", "none").css("color", "inherit").css("fontWeight", "normal");
|
548 |
+
});
|
549 |
+
|
550 |
+
// Browser compatibility
|
551 |
+
if ($.browser.mozilla)
|
552 |
+
$("form").attr("autocomplete", "off");
|
553 |
+
});
|
554 |
+
</script>';
|
555 |
+
}
|
556 |
+
|
557 |
+
|
558 |
+
public function display_section() {
|
559 |
+
// code
|
560 |
+
}
|
561 |
+
|
562 |
+
|
563 |
+
public function display_about_section() {
|
564 |
+
|
565 |
+
echo <<<EOD
|
566 |
+
<div style="width: 70%;">
|
567 |
+
<p><img class="alignright size-medium" title="Michael in Red Square, Moscow, Russia" src="/wp-content/plugins/testimonials-widget/media/michael-cannon-red-square-300x2251.jpg" alt="Michael in Red Square, Moscow, Russia" width="300" height="225" /><a href="http://wordpress.org/extend/plugins/testimonials-widget/">Testimonials Widget</a> is by <a href="http://aihr.us/about-aihrus/michael-cannon-resume/">Michael Cannon</a>. He's <a title="Lot's of stuff about Peichi Liu…" href="http://peimic.com/t/peichi-liu/">Peichi’s</a> smiling man, an adventurous <a title="Water rat" href="http://www.chinesehoroscope.org/chinese_zodiac/rat/" target="_blank">water-rat</a>, <a title="Aihrus – website support made easy since 1999" href="http://aihrus.localhost/">chief technology officer</a>, <a title="Road biker, cyclist, biking; whatever you call, I love to ride" href="http://peimic.com/c/biking/">cyclist</a>, <a title="Michael's poetic like literary ramblings" href="http://peimic.com/t/poetry/">poet</a>, <a title="World Wide Opportunities on Organic Farms" href="http://peimic.com/t/WWOOF/">WWOOF’er</a> and <a title="My traveled to country list, is more than my age." href="http://peimic.com/c/travel/">world traveler</a>.</p>
|
568 |
+
</div>
|
569 |
+
EOD;
|
570 |
+
|
571 |
+
}
|
572 |
+
|
573 |
+
|
574 |
+
public static function display_setting( $args = array() ) {
|
575 |
+
extract( $args );
|
576 |
+
|
577 |
+
$options = get_option( self::id );
|
578 |
+
|
579 |
+
if ( ! isset( $options[$id] ) && $type != 'checkbox' )
|
580 |
+
$options[$id] = $std;
|
581 |
+
elseif ( ! isset( $options[$id] ) )
|
582 |
+
$options[$id] = 0;
|
583 |
+
|
584 |
+
$field_class = '';
|
585 |
+
if ( ! empty( $class ) )
|
586 |
+
$field_class = ' ' . $class;
|
587 |
+
|
588 |
+
switch ( $type ) {
|
589 |
+
|
590 |
+
case 'heading':
|
591 |
+
echo '</td></tr><tr valign="top"><td colspan="2"><h4>' . $desc . '</h4>';
|
592 |
+
break;
|
593 |
+
|
594 |
+
case 'checkbox':
|
595 |
+
echo '<input class="checkbox' . $field_class . '" type="checkbox" id="' . $id . '" name="' . self::id . '[' . $id . ']" value="1" ' . checked( $options[$id], 1, false ) . ' /> ';
|
596 |
+
|
597 |
+
if ( ! empty( $desc ) )
|
598 |
+
echo '<label for="' . $id . '"><span class="description">' . $desc . '</span></label>';
|
599 |
+
|
600 |
+
break;
|
601 |
+
|
602 |
+
case 'select':
|
603 |
+
echo '<select class="select' . $field_class . '" name="' . self::id . '[' . $id . ']">';
|
604 |
+
|
605 |
+
foreach ( $choices as $value => $label )
|
606 |
+
echo '<option value="' . esc_attr( $value ) . '"' . selected( $options[$id], $value, false ) . '>' . $label . '</option>';
|
607 |
+
|
608 |
+
echo '</select>';
|
609 |
+
|
610 |
+
if ( ! empty( $desc ) )
|
611 |
+
echo '<br /><span class="description">' . $desc . '</span>';
|
612 |
+
|
613 |
+
break;
|
614 |
+
|
615 |
+
case 'radio':
|
616 |
+
$i = 0;
|
617 |
+
$count_options = count( $options ) - 1;
|
618 |
+
foreach ( $choices as $value => $label ) {
|
619 |
+
echo '<input class="radio' . $field_class . '" type="radio" name="' . self::id . '[' . $id . ']" id="' . $id . $i . '" value="' . esc_attr( $value ) . '" ' . checked( $options[$id], $value, false ) . '> <label for="' . $id . $i . '">' . $label . '</label>';
|
620 |
+
if ( $i < $count_options )
|
621 |
+
echo '<br />';
|
622 |
+
$i++;
|
623 |
+
}
|
624 |
+
|
625 |
+
if ( ! empty( $desc ) )
|
626 |
+
echo '<br /><span class="description">' . $desc . '</span>';
|
627 |
+
|
628 |
+
break;
|
629 |
+
|
630 |
+
case 'textarea':
|
631 |
+
echo '<textarea class="' . $field_class . '" id="' . $id . '" name="' . self::id . '[' . $id . ']" placeholder="' . $std . '" rows="5" cols="30">' . wp_htmledit_pre( $options[$id] ) . '</textarea>';
|
632 |
+
|
633 |
+
if ( ! empty( $desc ) )
|
634 |
+
echo '<br /><span class="description">' . $desc . '</span>';
|
635 |
+
|
636 |
+
break;
|
637 |
+
|
638 |
+
case 'password':
|
639 |
+
echo '<input class="regular-text' . $field_class . '" type="password" id="' . $id . '" name="' . self::id . '[' . $id . ']" value="' . esc_attr( $options[$id] ) . '" />';
|
640 |
+
|
641 |
+
if ( ! empty( $desc ) )
|
642 |
+
echo '<br /><span class="description">' . $desc . '</span>';
|
643 |
+
|
644 |
+
break;
|
645 |
+
|
646 |
+
case 'readonly':
|
647 |
+
echo '<input class="regular-text' . $field_class . '" type="text" id="' . $id . '" name="' . self::id . '[' . $id . ']" value="' . esc_attr( $options[$id] ) . '" readonly="readonly" />';
|
648 |
+
|
649 |
+
if ( ! empty( $desc ) )
|
650 |
+
echo '<br /><span class="description">' . $desc . '</span>';
|
651 |
+
|
652 |
+
break;
|
653 |
+
|
654 |
+
case 'text':
|
655 |
+
echo '<input class="regular-text' . $field_class . '" type="text" id="' . $id . '" name="' . self::id . '[' . $id . ']" placeholder="' . $std . '" value="' . esc_attr( $options[$id] ) . '" />';
|
656 |
+
|
657 |
+
if ( ! empty( $desc ) )
|
658 |
+
echo '<br /><span class="description">' . $desc . '</span>';
|
659 |
+
|
660 |
+
break;
|
661 |
+
|
662 |
+
default:
|
663 |
+
break;
|
664 |
+
}
|
665 |
+
}
|
666 |
+
|
667 |
+
|
668 |
+
public function initialize_settings() {
|
669 |
+
$defaults = self::get_defaults();
|
670 |
+
$defaults['version'] = self::$version;
|
671 |
+
|
672 |
+
update_option( self::id, $defaults );
|
673 |
+
}
|
674 |
+
|
675 |
+
|
676 |
+
public function register_settings() {
|
677 |
+
register_setting( self::id, self::id, array ( &$this, 'validate_settings' ) );
|
678 |
+
|
679 |
+
foreach ( self::$sections as $slug => $title ) {
|
680 |
+
if ( $slug == 'about' )
|
681 |
+
add_settings_section( $slug, $title, array( &$this, 'display_about_section' ), self::id );
|
682 |
+
else
|
683 |
+
add_settings_section( $slug, $title, array( &$this, 'display_section' ), self::id );
|
684 |
+
}
|
685 |
+
|
686 |
+
foreach ( self::$settings as $id => $setting ) {
|
687 |
+
$setting['id'] = $id;
|
688 |
+
$this->create_setting( $setting );
|
689 |
+
}
|
690 |
+
}
|
691 |
+
|
692 |
+
|
693 |
+
public function scripts() {
|
694 |
+
wp_print_scripts( 'jquery-ui-tabs' );
|
695 |
+
}
|
696 |
+
|
697 |
+
|
698 |
+
public function styles() {
|
699 |
+
wp_register_style( __CLASS__ . '-admin', plugins_url( 'settings.css', __FILE__ ) );
|
700 |
+
wp_enqueue_style( __CLASS__ . '-admin' );
|
701 |
+
}
|
702 |
+
|
703 |
+
|
704 |
+
public static function validate_settings( $input ) {
|
705 |
+
if ( ! empty( $input['reset_defaults'] ) ) {
|
706 |
+
foreach ( self::$defaults as $id => $std ) {
|
707 |
+
$input[$id] = $std;
|
708 |
+
}
|
709 |
+
|
710 |
+
unset( $input['reset_defaults'] );
|
711 |
+
}
|
712 |
+
|
713 |
+
$input['allow_comments'] = empty( $input['allow_comments'] ) ? 0 : self::is_true_int( $input['allow_comments'] );
|
714 |
+
$input['bottom_text'] = wp_kses_post( $input['bottom_text'] );
|
715 |
+
$input['category'] = ( empty( $input['category'] ) || preg_match( '#^[\w-]+(,[\w-]+)*$#', $input['category'] ) ) ? $input['category'] : self::$defaults['category'];
|
716 |
+
$input['char_limit'] = ( empty( $input['char_limit'] ) || ( is_numeric( $input['char_limit'] ) && 0 <= $input['char_limit'] ) ) ? $input['char_limit'] : self::$defaults['char_limit'];
|
717 |
+
$input['exclude'] = ( empty( $input['exclude'] ) || preg_match( '#^\d+(,\d+)*$#', $input['exclude'] ) ) ? $input['exclude'] : self::$defaults['exclude'];
|
718 |
+
$input['has_archive'] = sanitize_title( $input['has_archive'] );
|
719 |
+
$input['hide_company'] = empty( $input['hide_company'] ) ? 0 : self::is_true_int( $input['hide_company'] );
|
720 |
+
$input['hide_content'] = empty( $input['hide_content'] ) ? 0 : self::is_true_int( $input['hide_content'] );
|
721 |
+
$input['hide_email'] = empty( $input['hide_email'] ) ? 0 : self::is_true_int( $input['hide_email'] );
|
722 |
+
$input['hide_gravatar'] = empty( $input['hide_gravatar'] ) ? 0 : self::is_true_int( $input['hide_gravatar'] );
|
723 |
+
$input['hide_image'] = empty( $input['hide_image'] ) ? 0 : self::is_true_int( $input['hide_image'] );
|
724 |
+
$input['hide_not_found'] = empty( $input['hide_not_found'] ) ? 0 : self::is_true_int( $input['hide_not_found'] );
|
725 |
+
$input['hide_source'] = empty( $input['hide_source'] ) ? 0 : self::is_true_int( $input['hide_source'] );
|
726 |
+
$input['hide_title'] = empty( $input['hide_title'] ) ? 0 : self::is_true_int( $input['hide_title'] );
|
727 |
+
$input['hide_url'] = empty( $input['hide_url'] ) ? 0 : self::is_true_int( $input['hide_url'] );
|
728 |
+
$input['ids'] = ( empty( $input['ids'] ) || preg_match( '#^\d+(,\d+)*$#', $input['ids'] ) ) ? $input['ids'] : self::$defaults['ids'];
|
729 |
+
$input['keep_whitespace'] = empty( $input['keep_whitespace'] ) ? 0 : self::is_true_int( $input['keep_whitespace'] );
|
730 |
+
$input['limit'] = ( empty( $input['limit'] ) || ( is_numeric( $input['limit'] ) && 0 < $input['limit'] ) ) ? $input['limit'] : self::$defaults['limit'];
|
731 |
+
$input['max_height'] = ( empty( $input['max_height'] ) || ( is_numeric( $input['max_height'] ) && 0 <= $input['max_height'] ) ) ? $input['max_height'] : self::$defaults['max_height'];
|
732 |
+
$input['meta_key'] = ( empty( $input['meta_key'] ) || preg_match( '#^[\w-,]+$#', $input['meta_key'] ) ) ? $input['meta_key'] : self::$defaults['meta_key'];
|
733 |
+
$input['min_height'] = ( empty( $input['min_height'] ) || ( is_numeric( $input['min_height'] ) && 0 <= $input['min_height'] ) ) ? $input['min_height'] : self::$defaults['min_height'];
|
734 |
+
$input['order'] = ( empty( $input['order'] ) || preg_match( '#^desc|asc$#i', $input['order'] ) ) ? $input['order'] : self::$defaults['order'];
|
735 |
+
$input['orderby'] = ( empty( $input['orderby'] ) || preg_match( '#^\w+$#', $input['orderby'] ) ) ? $input['orderby'] : self::$defaults['orderby'];
|
736 |
+
$input['random'] = empty( $input['random'] ) ? 0 : self::is_true_int( $input['random'] );
|
737 |
+
$input['refresh_interval'] = ( empty( $input['refresh_interval'] ) || ( is_numeric( $input['refresh_interval'] ) && 0 <= $input['refresh_interval'] ) ) ? $input['refresh_interval'] : self::$defaults['refresh_interval'];
|
738 |
+
$input['remove_hentry'] = empty( $input['remove_hentry'] ) ? 0 : self::is_true_int( $input['remove_hentry'] );
|
739 |
+
$input['rewrite_slug'] = sanitize_title( $input['rewrite_slug'] );
|
740 |
+
$input['tags'] = ( empty( $input['tags'] ) || preg_match( '#^[\w-]+(,[\w-]+)*$#', $input['tags'] ) ) ? $input['tags'] : self::$defaults['tags'];
|
741 |
+
$input['tags_all'] = empty( $input['tags_all'] ) ? 0 : self::is_true_int( $input['tags_all'] );
|
742 |
+
$input['target'] = ( empty( $input['target'] ) || preg_match( '#^\w+$#', $input['target'] ) ) ? $input['target'] : self::$defaults['target'];
|
743 |
+
$input['title'] = wp_kses_post( $input['title'] );
|
744 |
+
$input['title_link'] = wp_kses_data( $input['title_link'] );
|
745 |
+
$input['version'] = self::$version;
|
746 |
+
|
747 |
+
$input = apply_filters( 'testimonials_widget_validate_settings', $input );
|
748 |
+
|
749 |
+
return $input;
|
750 |
+
}
|
751 |
+
|
752 |
+
|
753 |
+
public static function is_true_int( $value = null ) {
|
754 |
+
return self::is_true( $value, false );
|
755 |
+
}
|
756 |
+
|
757 |
+
|
758 |
+
public static function is_true( $value = null, $return_boolean = true ) {
|
759 |
+
if ( true === $value || 'true' == strtolower( $value ) || 1 == $value || 'yes' == strtolower( $value ) ) {
|
760 |
+
if ( $return_boolean )
|
761 |
+
return true;
|
762 |
+
else
|
763 |
+
return 1;
|
764 |
+
} else {
|
765 |
+
if ( $return_boolean )
|
766 |
+
return false;
|
767 |
+
else
|
768 |
+
return 0;
|
769 |
+
}
|
770 |
+
}
|
771 |
+
}
|
772 |
+
|
773 |
+
|
774 |
+
$Testimonials_Widget_Settings = new Testimonials_Widget_Settings();
|
775 |
+
|
776 |
+
|
777 |
+
function tw_get_options() {
|
778 |
+
$options = get_option( Testimonials_Widget_Settings::id, false );
|
779 |
+
|
780 |
+
if ( false === $options )
|
781 |
+
return Testimonials_Widget_Settings::get_defaults();
|
782 |
+
|
783 |
+
return $options;
|
784 |
+
}
|
785 |
+
|
786 |
+
|
787 |
+
function tw_get_option( $option, $default = null ) {
|
788 |
+
$options = get_option( Testimonials_Widget_Settings::id, null );
|
789 |
+
|
790 |
+
if ( isset( $options[$option] ) )
|
791 |
+
return $options[$option];
|
792 |
+
else
|
793 |
+
return $default;
|
794 |
+
}
|
795 |
+
|
796 |
+
|
797 |
+
function tw_set_option( $option, $value = null ) {
|
798 |
+
$options = get_option( Testimonials_Widget_Settings::id );
|
799 |
+
|
800 |
+
if ( ! is_array( $options ) ) {
|
801 |
+
$options = array();
|
802 |
+
}
|
803 |
+
|
804 |
+
$options[$option] = $value;
|
805 |
+
update_option( Testimonials_Widget_Settings::id, $options );
|
806 |
+
}
|
807 |
+
|
808 |
+
?>
|
lib/testimonials-widget-widget.php
ADDED
@@ -0,0 +1,267 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Testimonials_Widget_Widget extends WP_Widget {
|
4 |
+
public function Testimonials_Widget_Widget() {
|
5 |
+
// Widget settings
|
6 |
+
$widget_ops = array(
|
7 |
+
'classname' => 'Testimonials_Widget_Widget',
|
8 |
+
'description' => __( 'Display testimonials with multiple selection and display options', 'testimonials-widget' )
|
9 |
+
);
|
10 |
+
|
11 |
+
// Widget control settings
|
12 |
+
$control_ops = array(
|
13 |
+
'id_base' => 'testimonials_widget',
|
14 |
+
);
|
15 |
+
|
16 |
+
// Create the widget
|
17 |
+
$this->WP_Widget(
|
18 |
+
'testimonials_widget',
|
19 |
+
__( 'Testimonials Widget', 'testimonials-widget' ),
|
20 |
+
$widget_ops,
|
21 |
+
$control_ops
|
22 |
+
);
|
23 |
+
}
|
24 |
+
|
25 |
+
|
26 |
+
public function get_testimonials_css() {
|
27 |
+
Testimonials_Widget::get_testimonials_css();
|
28 |
+
}
|
29 |
+
|
30 |
+
|
31 |
+
public function get_testimonials_scripts() {
|
32 |
+
Testimonials_Widget::get_testimonials_scripts();
|
33 |
+
}
|
34 |
+
|
35 |
+
|
36 |
+
public function widget( $args, $instance ) {
|
37 |
+
global $before_widget, $before_title, $after_title, $after_widget;
|
38 |
+
|
39 |
+
$args = wp_parse_args( $args, Testimonials_Widget::get_defaults() );
|
40 |
+
extract( $args );
|
41 |
+
|
42 |
+
// Our variables from the widget settings
|
43 |
+
$title = apply_filters( 'widget_title', $instance['title'], null );
|
44 |
+
|
45 |
+
$testimonials = Testimonials_Widget::testimonialswidget_widget( $instance, $this->number );
|
46 |
+
|
47 |
+
// Before widget (defined by themes)
|
48 |
+
echo $before_widget;
|
49 |
+
|
50 |
+
// Display the widget title if one was input (before and after defined by themes)
|
51 |
+
if ( ! empty( $title ) ) {
|
52 |
+
if ( ! empty( $instance['title_link'] ) ) {
|
53 |
+
// revise title with title_link link creation
|
54 |
+
$title_link = $instance['title_link'];
|
55 |
+
|
56 |
+
if ( preg_match( '#^\d+$#', $title_link ) ) {
|
57 |
+
$new_title = '<a href="';
|
58 |
+
$new_title .= get_permalink( $title_link );
|
59 |
+
$new_title .= '" title="';
|
60 |
+
$new_title .= get_the_title( $title_link );
|
61 |
+
$new_title .= '">';
|
62 |
+
$new_title .= $title;
|
63 |
+
$new_title .= '</a>';
|
64 |
+
|
65 |
+
$title = $new_title;
|
66 |
+
} else {
|
67 |
+
if ( 0 === preg_match( "#https?://#", $title_link ) ) {
|
68 |
+
$title_link = 'http://' . $title_link;
|
69 |
+
}
|
70 |
+
|
71 |
+
$new_title = '<a href="';
|
72 |
+
$new_title .= $title_link;
|
73 |
+
$new_title .= '" title="';
|
74 |
+
$new_title .= $title;
|
75 |
+
$new_title .= '"';
|
76 |
+
|
77 |
+
if ( ! empty( $instance['target'] ) ) {
|
78 |
+
$new_title .= ' target="';
|
79 |
+
$new_title .= $instance['target'];
|
80 |
+
$new_title .= '" ';
|
81 |
+
}
|
82 |
+
|
83 |
+
$new_title .= '>';
|
84 |
+
$new_title .= $title;
|
85 |
+
$new_title .= '</a>';
|
86 |
+
|
87 |
+
$title = $new_title;
|
88 |
+
}
|
89 |
+
}
|
90 |
+
|
91 |
+
echo $before_title . $title . $after_title;
|
92 |
+
}
|
93 |
+
|
94 |
+
// Display Widget
|
95 |
+
echo $testimonials;
|
96 |
+
|
97 |
+
// After widget (defined by themes)
|
98 |
+
echo $after_widget;
|
99 |
+
}
|
100 |
+
|
101 |
+
|
102 |
+
public function update( $new_instance, $old_instance ) {
|
103 |
+
$instance = Testimonials_Widget_Settings::validate_settings( $new_instance );
|
104 |
+
|
105 |
+
return $instance;
|
106 |
+
}
|
107 |
+
|
108 |
+
public function form( $instance ) {
|
109 |
+
$defaults = Testimonials_Widget::get_defaults();
|
110 |
+
$do_number = true;
|
111 |
+
|
112 |
+
if ( empty( $instance ) ) {
|
113 |
+
$do_number = false;
|
114 |
+
|
115 |
+
if ( empty( $defaults['char_limit'] ) )
|
116 |
+
$defaults['char_limit'] = 500;
|
117 |
+
|
118 |
+
if ( empty( $defaults['random'] ) )
|
119 |
+
$defaults['random'] = 1;
|
120 |
+
|
121 |
+
$instance = array();
|
122 |
+
}
|
123 |
+
|
124 |
+
$instance = wp_parse_args( $instance, $defaults );
|
125 |
+
$form_parts = Testimonials_Widget_Settings::get_settings();
|
126 |
+
|
127 |
+
if ( $do_number ) {
|
128 |
+
$number = $this->number;
|
129 |
+
$std = ' .' . Testimonials_Widget::id . $number;
|
130 |
+
$form_parts['css_class'] = array(
|
131 |
+
'section' => 'widget',
|
132 |
+
'type' => 'readonly',
|
133 |
+
'title' => __( 'CSS Class', 'testimonials-widget' ),
|
134 |
+
'desc' => __( 'This widget\'s unique CSS class for styling', 'testimonials-widget' ),
|
135 |
+
'std' => $std,
|
136 |
+
);
|
137 |
+
}
|
138 |
+
|
139 |
+
// remove non-widget parts
|
140 |
+
unset( $form_parts['paging'] );
|
141 |
+
unset( $form_parts['debug_mode'] );
|
142 |
+
unset( $form_parts['allow_comments'] );
|
143 |
+
unset( $form_parts['has_archive'] );
|
144 |
+
unset( $form_parts['rewrite_slug'] );
|
145 |
+
|
146 |
+
// fixme make reset work
|
147 |
+
unset( $form_parts['reset_defaults'] );
|
148 |
+
|
149 |
+
foreach ( $form_parts as $key => $part ) {
|
150 |
+
$part[ 'id' ] = $key;
|
151 |
+
$this->display_setting( $part, $instance );
|
152 |
+
}
|
153 |
+
}
|
154 |
+
|
155 |
+
|
156 |
+
public function display_setting( $args = array(), $options ) {
|
157 |
+
extract( $args );
|
158 |
+
|
159 |
+
$do_return = false;
|
160 |
+
switch ( $type ) {
|
161 |
+
case 'heading':
|
162 |
+
if ( ! empty( $desc ) )
|
163 |
+
echo '<h3>' . $desc . '</h3>';
|
164 |
+
|
165 |
+
$do_return = true;
|
166 |
+
break;
|
167 |
+
|
168 |
+
case 'expand_begin':
|
169 |
+
if ( ! empty( $desc ) )
|
170 |
+
echo '<h3>' . $desc . '</h3>';
|
171 |
+
|
172 |
+
echo '<a id="' . $this->get_field_id( $id ) . '" style="cursor:pointer;" onclick="jQuery( \'div#' . $this->get_field_id( $id ) . '\' ) . slideToggle();">' . __( 'Expand/Collapse', 'testimonials-widget' ) . ' »</a>';
|
173 |
+
echo '<div id="' . $this->get_field_id( $id ) . '" style="display:none">';
|
174 |
+
|
175 |
+
$do_return = true;
|
176 |
+
break;
|
177 |
+
|
178 |
+
case 'expand_end':
|
179 |
+
echo '</div>';
|
180 |
+
|
181 |
+
$do_return = true;
|
182 |
+
break;
|
183 |
+
|
184 |
+
default:
|
185 |
+
break;
|
186 |
+
}
|
187 |
+
|
188 |
+
if ( $do_return )
|
189 |
+
return;
|
190 |
+
|
191 |
+
if ( ! isset( $options[$id] ) && $type != 'checkbox' )
|
192 |
+
$options[$id] = $std;
|
193 |
+
elseif ( ! isset( $options[$id] ) )
|
194 |
+
$options[$id] = 0;
|
195 |
+
|
196 |
+
$field_class = '';
|
197 |
+
if ( ! empty( $class ) )
|
198 |
+
$field_class = ' ' . $class;
|
199 |
+
|
200 |
+
echo '<p>';
|
201 |
+
|
202 |
+
switch ( $type ) {
|
203 |
+
case 'checkbox':
|
204 |
+
echo '<input class="checkbox' . $field_class . '" type="checkbox" id="' . $this->get_field_id( $id ) . '" name="' . $this->get_field_name( $id ) . '" value="1" ' . checked( $options[$id], 1, false ) . ' /> ';
|
205 |
+
|
206 |
+
echo '<label for="' . $this->get_field_id( $id ) . '">' . $title . '</label>';
|
207 |
+
break;
|
208 |
+
|
209 |
+
case 'select':
|
210 |
+
echo '<label for="' . $this->get_field_id( $id ) . '">' . $title . '</label>';
|
211 |
+
echo '<select id="' . $this->get_field_id( $id ) . '"class="select' . $field_class . '" name="' . $this->get_field_name( $id ) . '">';
|
212 |
+
|
213 |
+
foreach ( $choices as $value => $label )
|
214 |
+
echo '<option value="' . esc_attr( $value ) . '"' . selected( $options[$id], $value, false ) . '>' . $label . '</option>';
|
215 |
+
|
216 |
+
echo '</select>';
|
217 |
+
break;
|
218 |
+
|
219 |
+
case 'radio':
|
220 |
+
$i = 0;
|
221 |
+
$count_options = count( $options ) - 1;
|
222 |
+
foreach ( $choices as $value => $label ) {
|
223 |
+
echo '<input class="radio' . $field_class . '" type="radio" name="' . $this->get_field_name( $id ) . '" id="' . $this->get_field_name( $id . $i ) . '" value="' . esc_attr( $value ) . '" ' . checked( $options[$id], $value, false ) . '> <label for="' . $this->get_field_name( $id . $i ) . '">' . $label . '</label>';
|
224 |
+
if ( $i < $count_options )
|
225 |
+
echo '<br />';
|
226 |
+
$i++;
|
227 |
+
}
|
228 |
+
|
229 |
+
echo '<label for="' . $this->get_field_id( $id ) . '">' . $title . '</label>';
|
230 |
+
break;
|
231 |
+
|
232 |
+
case 'textarea':
|
233 |
+
echo '<label for="' . $this->get_field_id( $id ) . '">' . $title . '</label>';
|
234 |
+
|
235 |
+
echo '<textarea class="widefat' . $field_class . '" id="' . $this->get_field_id( $id ) . '" name="' . $this->get_field_name( $id ) . '" placeholder="' . $std . '" rows="5" cols="30">' . wp_htmledit_pre( $options[$id] ) . '</textarea>';
|
236 |
+
break;
|
237 |
+
|
238 |
+
case 'password':
|
239 |
+
echo '<label for="' . $this->get_field_id( $id ) . '">' . $title . '</label>';
|
240 |
+
|
241 |
+
echo '<input class="widefat' . $field_class . '" type="password" id="' . $this->get_field_id( $id ) . '" name="' . $this->get_field_name( $id ) . '" value="' . esc_attr( $options[$id] ) . '" />';
|
242 |
+
break;
|
243 |
+
|
244 |
+
case 'readonly':
|
245 |
+
echo '<label for="' . $this->get_field_id( $id ) . '">' . $title . '</label>';
|
246 |
+
|
247 |
+
echo '<input class="widefat' . $field_class . '" type="text" id="' . $this->get_field_id( $id ) . '" name="' . $this->get_field_name( $id ) . '" value="' . esc_attr( $options[$id] ) . '" readonly="readonly" />';
|
248 |
+
break;
|
249 |
+
|
250 |
+
case 'text':
|
251 |
+
echo '<label for="' . $this->get_field_id( $id ) . '">' . $title . '</label>';
|
252 |
+
|
253 |
+
echo '<input class="widefat' . $field_class . '" type="text" id="' . $this->get_field_id( $id ) . '" name="' . $this->get_field_name( $id ) . '" placeholder="' . $std . '" value="' . esc_attr( $options[$id] ) . '" />';
|
254 |
+
break;
|
255 |
+
|
256 |
+
default:
|
257 |
+
break;
|
258 |
+
}
|
259 |
+
|
260 |
+
if ( ! empty( $desc ) )
|
261 |
+
echo '<br /><span class="setting-description"><small>' . $desc . '</small></span>';
|
262 |
+
|
263 |
+
echo '</p>';
|
264 |
+
}
|
265 |
+
}
|
266 |
+
|
267 |
+
?>
|
media/michael-cannon-red-square-300x2251.jpg
ADDED
Binary file
|
readme.txt
CHANGED
@@ -1,125 +1,473 @@
|
|
1 |
=== Testimonials Widget ===
|
2 |
-
Contributors: comprock
|
3 |
-
Donate link: http://
|
4 |
-
Tags:
|
5 |
-
Requires at least: 3.
|
6 |
-
Tested up to: 3.
|
7 |
-
Stable tag:
|
|
|
|
|
|
|
|
|
8 |
|
9 |
-
Testimonials widget plugin allows you display testimonials in a widget on your WordPress blog.
|
10 |
|
11 |
== Description ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
|
13 |
-
Testimonial widget plugin allows you display testimonials in a widget on your WordPress blog.
|
14 |
-
|
15 |
-
More than one widget can be displayed, each pulling from testimonial sets by using tags. Each displayed widget has its own identifier allowing for custom CSS styling.
|
16 |
-
|
17 |
-
You can make a simple client or portfolio rotator by using the testimonial field as the client or organization name, and the source field with the URL and tag as "portfolio". Then in the widget, show source and require tag "portfolio".
|
18 |
-
|
19 |
-
|
20 |
-
**Features and notes**
|
21 |
-
|
22 |
-
* All testimonials (subject to filters) are in the html source so will be seen by google etc.
|
23 |
-
* Testimony, author and source fields are clickable
|
24 |
-
* **Admin interface**: A nice admin interface to add, edit and manage testimonials. Details such as author and source of the quote, and attributes like tags and visibility, can be specified. The 'Testimonials' menu in the WP admin navigation leads to the admin interface.
|
25 |
-
* **Sidebar widget**: The Testimonials sidebar widget loads a testimonial then rotates through all available testimonials. Following is the list of options in the widget control panel:
|
26 |
-
* Widget title
|
27 |
-
* Option to show/hide author
|
28 |
-
* Option to show/hide source
|
29 |
-
* Choose refresh interval in seconds or set to 0 for static display
|
30 |
-
* Choose random or sequential order for refresh
|
31 |
-
* Show only quotes with certain tags
|
32 |
-
* Show only quotes with all tags
|
33 |
-
* Specify a character limit to filter out longer quotes - 0 means no limit
|
34 |
-
* Limit number of testimonials to pull at a time - 0 means no limit
|
35 |
-
* Allows for multiple widgets. Useful for using tags to keep widgets separated.
|
36 |
-
* Compatible with WordPress 3.0 multi-site functionality.
|
37 |
-
|
38 |
-
= Shortcode [testimonialswidget_list] =
|
39 |
-
* Options
|
40 |
-
* hide_author - default show; hide_author=true
|
41 |
-
* hide_source - default show; hide_source=true
|
42 |
-
* ids - default none; ids=2 or ids="2,4,6"
|
43 |
-
* limit - default none; limit=10
|
44 |
-
* random - default newest first; random=true
|
45 |
-
* tags - default none; tags=fire or tags="fire,water"
|
46 |
-
* char_limit - default none; char_limit=200
|
47 |
-
* [testimonialswidget_list] Examples
|
48 |
-
* [testimonialswidget_list hide_author=true hide_source=true]
|
49 |
-
* [testimonialswidget_list tags="test,fun" limit=1]
|
50 |
-
* [testimonialswidget_list ids=1]
|
51 |
-
|
52 |
-
= Need More Power? =
|
53 |
-
Check out the [Quotes Collection](http://wordpress.org/extend/plugins/quotes-collection/) plugin by [SriniG](http://profiles.wordpress.org/users/SriniG/profile/public/)
|
54 |
|
55 |
== Installation ==
|
56 |
-
|
57 |
-
1.
|
|
|
|
|
|
|
|
|
58 |
1. Add and manage the quotes through the 'Testimonials' menu in the WordPress admin area
|
59 |
-
1. To display testimonials in the sidebar, go to 'Widgets' menu and drag the 'Testimonials'
|
|
|
|
|
|
|
|
|
60 |
|
61 |
== Frequently Asked Questions ==
|
62 |
|
63 |
-
= How do
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
64 |
|
65 |
-
|
66 |
|
67 |
-
|
|
|
68 |
|
69 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
|
71 |
CSS class `testimonialswidget_testimonials` wraps all testimonials. Additionally, shortcode lists are wrapped by `testimonialswidget_testimonials testimonialswidget_testimonials_list`.
|
72 |
|
73 |
-
= What CSS applies to single testimonial container? =
|
74 |
|
75 |
-
|
76 |
|
77 |
-
|
78 |
|
79 |
-
|
80 |
|
81 |
-
|
82 |
|
83 |
-
= How do I hide the comma after the
|
84 |
|
85 |
Use CSS.
|
86 |
-
|
|
|
|
|
|
|
87 |
display: none;
|
88 |
-
}
|
|
|
89 |
|
90 |
-
= Testimonials widget is not showing or rotating =
|
91 |
|
92 |
The usual problem is that jQuery is included twice. Once by WordPress and again by a theme. Remove the jQuery version included by your theme and you should be fine.
|
93 |
|
94 |
-
= I'm not seeing any testimonials but the title =
|
95 |
|
96 |
If you're not seeing any testimonials, even when not using tags filter, you might try increasing the Character limit or setting it to '0' or 'none' in the widget box.
|
97 |
|
98 |
-
= How do I apply custom CSS to a testimonial widget? =
|
99 |
|
100 |
The easiest thing is to check the source code of your page with the widget and look for the testimonial widgets div container id tag. It'll be something like `id="testimonials_widget-3"`.
|
101 |
|
102 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
103 |
|
104 |
-
|
105 |
|
106 |
-
|
107 |
|
108 |
-
|
109 |
-
|
110 |
-
|
|
|
|
|
|
|
111 |
|
112 |
-
= How to change the random quote text color? =
|
113 |
|
114 |
-
Styling such as text color, font size, background color, etc., of the random quote can be customized by editing
|
115 |
|
116 |
-
|
|
|
117 |
color: blue;
|
118 |
-
}
|
|
|
119 |
|
120 |
-
= How can I style the shortcode testimonials? =
|
121 |
|
122 |
-
|
123 |
|
124 |
Each shortcode testimonial is wrapped by a `div` using classes `testimonialswidget_testimonial testimonialswidget_testimonial_list`. As such, to increase spacing between testimonials, try…
|
125 |
|
@@ -128,6 +476,7 @@ Each shortcode testimonial is wrapped by a `div` using classes `testimonialswidg
|
|
128 |
padding-bottom: 1em;
|
129 |
}
|
130 |
`
|
|
|
131 |
Making the citation line a different color is a little trickier. The reason being is that applying a color to `.testimonialswidget_testimonial cite` will change the entire citation line in the widget display as well. To only change the shortcode testimonial citation color, try…
|
132 |
|
133 |
`
|
@@ -135,46 +484,1289 @@ Making the citation line a different color is a little trickier. The reason bein
|
|
135 |
color: blue;
|
136 |
}
|
137 |
`
|
138 |
-
|
|
|
139 |
|
140 |
`
|
141 |
-
.testimonialswidget_testimonial_list cite .
|
142 |
color: purple;
|
143 |
}
|
144 |
`
|
145 |
-
Like wise, the author uses class `testimonialswidget_author` and join ", " uses class `testimonialswidget_join`.
|
146 |
|
147 |
-
|
148 |
|
149 |
-
|
150 |
|
151 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
152 |
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
6. Testimonial shortcode results
|
159 |
-
7. Testimonial shortcode in post
|
160 |
|
|
|
161 |
|
162 |
-
|
163 |
-
1. Upload `testimonials-widget` directory to the `/wp-content/plugins/` directory
|
164 |
-
1. Activate the 'Testimonials Widget' plugin through the 'Plugins' menu in WordPress
|
165 |
-
1. Add and manage the quotes through the 'Testimonials' menu in the WordPress admin area
|
166 |
-
1. To display testimonials in the sidebar, go to 'Widgets' menu and drag the 'Testimonials' widget into the sidebar
|
167 |
|
168 |
-
|
169 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
170 |
|
171 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
172 |
= trunk =
|
173 |
-
-
|
174 |
|
175 |
-
=
|
176 |
-
*
|
177 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
178 |
|
179 |
= 0.2.13 =
|
180 |
* Clean up CSS
|
@@ -229,6 +1821,48 @@ Change the value of the variable `$testimonialswidget_admin_userlevel` on line 3
|
|
229 |
= 2011-08-12: Version 0.1 =
|
230 |
* initial release
|
231 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
232 |
== TODO ==
|
233 |
-
|
234 |
-
|
|
|
|
1 |
=== Testimonials Widget ===
|
2 |
+
Contributors: comprock
|
3 |
+
Donate link: http://aihr.us/about-aihrus/donate/
|
4 |
+
Tags: client, customer, quotations, quote, quotes, random, review, quote, recommendation, reference, testimonial, testimonials, testimony, widget, wpml
|
5 |
+
Requires at least: 3.4
|
6 |
+
Tested up to: 3.6.0
|
7 |
+
Stable tag: 2.8.2
|
8 |
+
License: GPLv2 or later
|
9 |
+
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
+
|
11 |
+
Testimonials Widget plugin allows you to display random or rotating portfolio, quotes, reviews, showcases, or text with images on your WordPress blog.
|
12 |
|
|
|
13 |
|
14 |
== Description ==
|
15 |
+
Testimonials Widget plugin allows you to display random or rotating portfolio, quotes, reviews, showcases, or text with images on your WordPress blog. You can insert Testimonials Widget content via shortcode, theme functions, or widgets with category and tag selections and having multiple display options such as random or specific ordering.
|
16 |
+
|
17 |
+
More than one Testimonials Widget section can be displayed at a time. Each Testimonials Widget separately pulls from the `testimonials-widget` custom post type. Additionally, with shortcodes and theme functions, you can display a short or long list or rotation of testimonials. Each Testimonal Widget has its own CSS identifier for custom styling.
|
18 |
+
|
19 |
+
Widgets display content sans `wpautop` formatting. This means no forced paragraph breaks unless the content specifically contains them. You can enable `wpautop` via the "Keep whitespace?" option.
|
20 |
+
|
21 |
+
Through categories and tagging, you can create organizational structures based upon products, projects and services via categories and then apply tagging for further classificaton. As an example, you might create a Portfolio category and then use tags to identify web, magazine, media, public, enterprise niches. You can then configure the Testimonial Widget to show only Portfolio testimonials with the public and enterprise tags. In another Testimonial Widget, you can also select only Portfolio testimonials, but then allow web and media tags.
|
22 |
+
|
23 |
+
Single testimonial view supports image, source, title, email, company and URL details.
|
24 |
+
|
25 |
+
= Primary Features =
|
26 |
+
|
27 |
+
* Admin interface to add, edit and manage testimonials
|
28 |
+
* Filters to manipulate testimonial layout and presentation
|
29 |
+
* Has fields for source, title, testimonial, email, company and URL details
|
30 |
+
* Multiple widgets on a single page capable
|
31 |
+
* Settings screen for site-wide option defaults
|
32 |
+
* Shortcodes and theme functions for listings and rotation
|
33 |
+
* Single testimonial view includes image, source, title, email, company and URL details
|
34 |
+
* Testimonials archive view
|
35 |
+
|
36 |
+
= Testimonials Widget Premium Plugin Features =
|
37 |
+
|
38 |
+
Testimonials Widget Premium plugin extends the best [Testimonials Widget](http://wordpress.org/extend/plugins/testimonials-widget/) plugin for WordPress with [caching, excerpts, filters, read more links](http://aihr.us/wordpress/testimonials-widget-premium/), more selection options, and advanced capabilities like selecting posts, pages and other custom post types as testimonials. The Testimonials Widget plugin allows you to display rotating content, portfolio, quotes, showcase, or other text with images on your WordPress blog.
|
39 |
+
|
40 |
+
In using Testimonials Widget Premium, you'll not be sorry.
|
41 |
+
|
42 |
+
* Alternate destinations for "Read more" links
|
43 |
+
* Built-in update notification
|
44 |
+
* Caching of testimonials queries and content to decrease server load time improve page loading speed by 1/10 to 1/2 a second
|
45 |
+
* Deletes old and related testimonial cache entries automatically
|
46 |
+
* Disable caching for widget, shortcode or theme functions
|
47 |
+
* Ensure unique testimonial display per page
|
48 |
+
* Excerpts for widget view, with read more link to complete testimonial
|
49 |
+
* Filters for caching and more link control, text replacement, and more
|
50 |
+
* Prevent duplicate testimonials when using multiple testimonial instances
|
51 |
+
* Read more links for testimonials exceeding the character limit
|
52 |
+
* Select post, page and other custom post types for rotations
|
53 |
+
* Select only testimonials with excerpts, images or of arbitrary maximum and minimum length
|
54 |
+
* Settings screen for site-wide option defaults
|
55 |
+
* Shortcodes and theme functions for testimonials count and testimonial link list
|
56 |
+
* Show excerpts with list and single views
|
57 |
+
* Testimonial list entries have alternating `.even` and `.odd` CSS classes for backgrounds and other styling
|
58 |
+
* WPML compatible
|
59 |
+
|
60 |
+
[Buy Testimonials Widget Premium](http://aihr.us/wordpress/testimonials-widget-premium/) plugin for WordPress.
|
61 |
+
|
62 |
+
= Additional Features =
|
63 |
+
|
64 |
+
* Auto-migration from pre-2.0.0 custom table to new custom post type
|
65 |
+
* Company, URL and email details are attempted to be identified and placed properly
|
66 |
+
* Public testimonials are saved as Published. Non-public, are marked as Private.
|
67 |
+
* Ignores already imported
|
68 |
+
* Commenting on testimonial single-view pages
|
69 |
+
* Compatible with WordPress multi-site
|
70 |
+
* Content truncation to respect HTML tags
|
71 |
+
* Custom CSS in footer for HTML validation
|
72 |
+
* Custom text or HTML for bottom of widgets
|
73 |
+
* Customizable archive and testimonial URLs
|
74 |
+
* Customizeable testimonial data field `testimonial_extra`
|
75 |
+
* Editors and admins can edit testimonial publisher
|
76 |
+
* Image, Gravatar, category and tag enabled
|
77 |
+
* Localizable - see `languages/testimonials-widget.pot`
|
78 |
+
* Respects meta capabilities
|
79 |
+
* Rotation JavaScript in footer than body
|
80 |
+
* Scrolling testimonials for maximum height restricted widgets
|
81 |
+
* Supports [WP-PageNavi](http://wordpress.org/extend/plugins/wp-pagenavi/)
|
82 |
+
* Testimonial content and layout completely customizable via filters
|
83 |
+
* Testimonial content supports HTML
|
84 |
+
* Testimonial, email, and URL fields are clickable
|
85 |
+
* The URL requires a protocol like `http://` or `https://`
|
86 |
+
* Testimonials Widget widget displays static and rotating testimonials
|
87 |
+
* Testimonials support styling based upon CSS classes for category, tags and post id
|
88 |
+
* URLs can be opened in new windows
|
89 |
+
* Unique CSS class per widget
|
90 |
+
* WordPress Multilingual enabled [WPML](http://wpml.org/)
|
91 |
+
|
92 |
+
= Shortcodes =
|
93 |
+
|
94 |
+
* `[testimonialswidget_list]` - Listings with paging
|
95 |
+
* `[testimonialswidget_widget]` - Rotating
|
96 |
+
|
97 |
+
= Shortcode and Widget Options =
|
98 |
+
|
99 |
+
* Widget Title
|
100 |
+
* `title1 - default "Testimonials"
|
101 |
+
* Title Link - URL or Post ID to link widget title to
|
102 |
+
* `title_link` - default none; title_link=123, title_link=http://example.com
|
103 |
+
* Category Filter - Comma separated category slug-names
|
104 |
+
* `category` - default none; category=product or category="category-a, another-category"
|
105 |
+
* Character Limit - Number of characters to limit testimonial views to
|
106 |
+
* `char_limit` - default none; char_limit=200
|
107 |
+
* Widget - default 500
|
108 |
+
* Exclude IDs Filter - Comma separated IDs
|
109 |
+
* `exclude` - default none; exclude=2 or exclude="2,4,6"
|
110 |
+
* Hide Company?
|
111 |
+
* `hide_company` - default show; hide_company=true
|
112 |
+
* Hide Email?
|
113 |
+
* `hide_email` - default show; hide_email=true
|
114 |
+
* Hide Gravatar Image?
|
115 |
+
* `hide_gravatar` - default show; hide_gravatar=true
|
116 |
+
* Hide Image?
|
117 |
+
* `hide_image` - default show; hide_image=true
|
118 |
+
* Hide "Testimonials Not Found"?
|
119 |
+
* `hide_not_found` - default show; hide_not_found=true
|
120 |
+
* Hide Author/Source? - Don't display "Post Title" in cite
|
121 |
+
* `hide_source` - default show; hide_source=true
|
122 |
+
* Hide Title?
|
123 |
+
* `hide_title` - default show; hide_title=true
|
124 |
+
* Hide URL?
|
125 |
+
* `hide_url` - default show; hide_url=true
|
126 |
+
* Include IDs Filter - Comma separated IDs
|
127 |
+
* `ids` - default none; ids=2 or ids="2,4,6"
|
128 |
+
* Remove `.hentry` CSS? – Some themes use class `.hentry` in a manner that breaks Testimonials Widgets CSS
|
129 |
+
* `remove_hentry` - default none; remove_hentry=true
|
130 |
+
* Keep Whitespace? - Keeps testimonials looking as entered than sans auto-formatting
|
131 |
+
* `keep_whitespace` - default none; keep_whitespace=true
|
132 |
+
* The citation has no whitespace adaptions. It's straight text, except for email or URL links. The presentation is handled strictly by CSS.
|
133 |
+
* Limit - Number of testimonials to rotate through via widget or show at a time when listing
|
134 |
+
* `limit` - default 10; limit=25
|
135 |
+
* ORDER BY meta_key - Used when "Random Order" is disabled and sorting by a testimonials meta key is needed
|
136 |
+
* `meta_key` - default none [testimonials-widget-company|testimonials-widget-email|testimonials-widget-title|testimonials-widget-url]; meta_key=testimonials-widget-company
|
137 |
+
* Minimum Height - Set for minimum display height, in pixels
|
138 |
+
* `min_height` - default none; min_height=100
|
139 |
+
* Maximum Height - Set for maximum display height, in pixels
|
140 |
+
* `max_height` - default none; max_height=250
|
141 |
+
* ORDER BY Order - DESC or ASC
|
142 |
+
* `order` - [default DESC](http://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters); order=ASC
|
143 |
+
* ORDER BY - Used when Random order is disabled
|
144 |
+
* `orderby` - [default ID](http://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters); orderby=title
|
145 |
+
* Enable Paging - for [testimonialswidget_list]
|
146 |
+
* `paging` - default true [true|before|after|false]; paging=false
|
147 |
+
* `true` – display paging before and after testimonial entries
|
148 |
+
* `before` – display paging only before testimonial entries
|
149 |
+
* `after` – display paging only after testimonial entries
|
150 |
+
* Widget - Not functional
|
151 |
+
* Random Order? - Unchecking this will rotate testimonials per ORDER BY and ORDER BY Order. Widgets are random by default automatically
|
152 |
+
* `random` - default none; random=true (overrides `order` and `orderby`)
|
153 |
+
* Widget = default true
|
154 |
+
* Rotation speed - Seconds between testimonial rotations or 0 for no rotation at all
|
155 |
+
* `refresh_interval` - default 5; refresh_interval=0
|
156 |
+
* Require All Tags - Select only testimonials with all of the given tags
|
157 |
+
* `tags_all` - default OR; tags_all=true
|
158 |
+
* Tags Filter - Comma separated tag slug-names
|
159 |
+
* `tags` - default none; tags=fire or tags="tag-a, another-tag"
|
160 |
+
* URL Target - Adds target to all URLs; leave blank if none
|
161 |
+
* `target` - default none; target=_new
|
162 |
+
* Testimonial Bottom Text - Custom text or HTML for bottom of testimonials
|
163 |
+
* `bottom_text` - default none; bottom_text="`<h3><a href="http://example.com">All testimonials</a></h3>`"
|
164 |
+
|
165 |
+
= Shortcode Examples =
|
166 |
+
|
167 |
+
* [testimonialswidget_list]
|
168 |
+
* [testimonialswidget_list]
|
169 |
+
* [testimonialswidget_list category=product hide_not_found=true]
|
170 |
+
* [testimonialswidget_list category=product tags=widget limit=5]
|
171 |
+
* [testimonialswidget_list char_limit=0 target=_new]
|
172 |
+
* [testimonialswidget_list hide_source=true hide_url=true]
|
173 |
+
* [testimonialswidget_list ids="1,11,111"]
|
174 |
+
* [testimonialswidget_list meta_key=testimonials-widget-company order=asc limit=15]
|
175 |
+
* [testimonialswidget_list order=ASC orderby=title]
|
176 |
+
* [testimonialswidget_list paging=true limit=25]
|
177 |
+
* [testimonialswidget_list tags="test,fun" random=true exclude="2,22,333"]
|
178 |
+
* [testimonialswidget_widget]
|
179 |
+
* [testimonialswidget_widget]
|
180 |
+
* [testimonialswidget_widget category=product order=asc]
|
181 |
+
* [testimonialswidget_widget min_height=250 max_height=500]
|
182 |
+
* [testimonialswidget_widget tags=sometag random=true]
|
183 |
+
|
184 |
+
= Theme Functions =
|
185 |
+
|
186 |
+
* `testimonialswidget_list()` - Listings with paging
|
187 |
+
* `testimonialswidget_widget()` - Rotating
|
188 |
+
|
189 |
+
= Filters =
|
190 |
+
|
191 |
+
* `testimonials_widget_cache_get` - Caching grabber
|
192 |
+
* `testimonials_widget_cache_set` - Caching setter
|
193 |
+
* `testimonials_widget_columns` - Customize testimonial posts column headers
|
194 |
+
* `testimonials_widget_content_more` - More content ellipsis
|
195 |
+
* `testimonials_widget_content` - Testimonial content parser helper
|
196 |
+
* `testimonials_widget_data` - Process testimonials data before display processing
|
197 |
+
* `testimonials_widget_defaults_single` - Create a global or central Testimonials Widget configuration for single view
|
198 |
+
* `testimonials_widget_defaults` - Create a global or central Testimonials Widget configuration
|
199 |
+
* `testimonials_widget_get_testimonial_html` - Customize testimonial contents and layout within `get_testimonial_html`. Useful for moving processed parts around than regenerating everything from scratch.
|
200 |
+
* `testimonials_widget_gravatar_size` - Change the Gravatar size
|
201 |
+
* `testimonials_widget_image_size` - Change the image size
|
202 |
+
* `testimonials_widget_meta_box` - Modify Testimonial Data fields
|
203 |
+
* `testimonials_widget_next_posts_link` - Configure Next page indicator
|
204 |
+
* `testimonials_widget_posts_custom_column` - Customize testimonial posts column contents
|
205 |
+
* `testimonials_widget_previous_posts_link_text` - Configure Previous page indicator
|
206 |
+
* `testimonials_widget_query_args` - Alter WP_Query arguments for testimonial selection
|
207 |
+
* `testimonials_widget_sections` – Alter section options
|
208 |
+
* `testimonials_widget_settings` – Alter setting options
|
209 |
+
* `testimonials_widget_testimonial_html_single_content` - Customize single view content before appending filter `testimonials_widget_testimonial_html_single` results
|
210 |
+
* `testimonials_widget_testimonial_html_single` - Customize testimonials single view output post `get_testimonial_html`
|
211 |
+
* `testimonials_widget_testimonial_html` - Customize testimonials list and widget output post `get_testimonial_html`
|
212 |
+
* `testimonials_widget_testimonials_css` - Alter dynamically generated CSS
|
213 |
+
* `testimonials_widget_testimonials_js` - Alter dynamically generated JavaScript
|
214 |
+
* `testimonials_widget_validate_settings` - Validate settings helper
|
215 |
+
* `testimonials_widget_version` - Version tracking for settings
|
216 |
+
* `testimonials_widget_wp_pagenavi` - Configure WP-PageNavi specifically for Testimonial Widgets
|
217 |
+
|
218 |
+
= Notes =
|
219 |
+
|
220 |
+
* Default image size is based upon Thumbnail size in Media Settings
|
221 |
+
* Gravatar image is configured in the Avatar section of Discussion Settings
|
222 |
+
|
223 |
+
= Languages =
|
224 |
+
|
225 |
+
You can translate this plugin into your own language if it's not done so already. The localization file `testimonials-widget.pot` can be found in the `languages` folder of this plugin. After translation, please [send the localized file](http://aihr.us/contact-aihrus/) to the plugin author.
|
226 |
+
|
227 |
+
* [Hebrew by Ahrale](http://atar4u.com/)
|
228 |
+
|
229 |
+
= Recommendation =
|
230 |
+
|
231 |
+
* Use Jonathan Lundström's [Drag & Drop Featured Image](http://wordpress.org/extend/plugins/drag-drop-featured-image/) to speed up loading of the featured image
|
232 |
+
|
233 |
+
= Background & Thanks =
|
234 |
+
|
235 |
+
A big, special thank you to [Joe Weber](https://plus.google.com/100063271269277312276/posts) of [12 Star Creative](http://www.12starcreative.com/) for creating the Testimonials Widget banner. It's fantastic.
|
236 |
+
|
237 |
+
Version 2.0.0 of Testimonials Widget is a complete rewrite based upon a composite of ideas from user feedback and grokking the plugins [Imperfect Quotes](http://www.swarmstrategies.com/imperfect-quotes/), [IvyCat Ajax Testimonials](http://wordpress.org/extend/plugins/ivycat-ajax-testimonials/), [Quotes Collection](http://srinig.com/wordpress/plugins/quotes-collection/), and [TB Testimonials](http://travisballard.com/wordpress/tb-testimonials/). Thank you to these plugin developers for their efforts that have helped inspire this rewrite.
|
238 |
+
|
239 |
+
A cool thanks to RedRokk Library for the [redrokk_metabox_class](https://gist.github.com/1880770). It makes configuring metaboxes for your posts, pages or custom post types a snap.
|
240 |
+
|
241 |
+
Prior to version 2.0.0, this plugin was a fork of [Quotes Collection](http://srinig.com/wordpress/plugins/quotes-collection/) by [Srini G](http://wordpress.org/support/profile/SriniG) with additional contributions from [j0hnsmith](http://wordpress.org/support/profile/j0hnsmith), [ChrisCree](http://wordpress.org/support/profile/ChrisCree) and [comprock](http://wordpress.org/support/profile/comprock).
|
242 |
+
|
243 |
+
= Support =
|
244 |
+
|
245 |
+
So that others can share in the answer, please submit your support requests through the [WordPress forums for Testimonials Widget](http://wordpress.org/support/plugin/testimonials-widget).
|
246 |
+
|
247 |
+
If you want private or priority support, [please donate](http://aihr.us/about-aihrus/donate/) $ 125 USD to cover my time. Then send your [support request](http://aihr.us/contact-aihrus/).
|
248 |
+
|
249 |
+
Thank you for your understanding.
|
250 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
251 |
|
252 |
== Installation ==
|
253 |
+
|
254 |
+
1. Via WordPress Admin > Plugins > Add New, Upload the `testimonials-widget.zip` file
|
255 |
+
1. Alternately, via FTP, upload `testimonials-widget` directory to the `/wp-content/plugins/` directory
|
256 |
+
1. Activate the 'Testimonials Widget' plugin through WordPress Admin > Plugins
|
257 |
+
|
258 |
+
= Usage =
|
259 |
1. Add and manage the quotes through the 'Testimonials' menu in the WordPress admin area
|
260 |
+
1. To display testimonials in the sidebar, go to 'Widgets' menu and drag the 'Testimonials Widget' into the desired widget area
|
261 |
+
1. Configure the 'Testimonials Widget' to select quotes and display as needed
|
262 |
+
1. Alternately, use the `[testimonialswidget_list]` or `[testimonialswidget_widget]` shortcodes to display testimonials on a page or in a post
|
263 |
+
1. Alternately, read FAQ 1 for `testimonialswidget_list()` and `testimonialswidget_widget()` theme functions usage
|
264 |
+
|
265 |
|
266 |
== Frequently Asked Questions ==
|
267 |
|
268 |
+
= 1. How do I use the theme functions `testimonialswidget_list()` and `testimonialswidget_widget()`? =
|
269 |
+
|
270 |
+
In your theme's `functions.php` file, place code similar to the following for the configuration you need.
|
271 |
+
|
272 |
+
A basic testimonial list or widget with no options.
|
273 |
+
`
|
274 |
+
<?php echo testimonialswidget_list(); ?>
|
275 |
+
<?php echo testimonialswidget_widget(); ?>
|
276 |
+
`
|
277 |
+
|
278 |
+
Testimonial list or widget with options.
|
279 |
+
`
|
280 |
+
<?php
|
281 |
+
|
282 |
+
// The following argument configuration selects 5 testimonials of the "product" category, having the "widget" tag.
|
283 |
+
// $args is an optional array of desired shortcode options
|
284 |
+
$args = array(
|
285 |
+
'category' => 'product',
|
286 |
+
'tags' => 'widget',
|
287 |
+
'limit' => 5,
|
288 |
+
);
|
289 |
+
|
290 |
+
// Displays the testimonials as a list into your theme directly
|
291 |
+
echo testimonialswidget_list( $args );
|
292 |
+
|
293 |
+
|
294 |
+
// The following argument configuration selects testimonials of the "review" tag and sets a slower rotation speed for the display widget
|
295 |
+
$args = array(
|
296 |
+
'tags' => 'review',
|
297 |
+
'refresh_interval' => 15,
|
298 |
+
);
|
299 |
+
|
300 |
+
// Displays the testimonials as a rotating widget into your theme directly
|
301 |
+
echo testimonialswidget_widget( $args );
|
302 |
+
|
303 |
+
|
304 |
+
// $widget_number is an optional, arbitrarily number (probably safe between 1,000 and 9,999) that helps create a uniquely identifiable testimonials widget display instance.
|
305 |
+
$widget_number = 1234;
|
306 |
+
// Displays the testimonials as a rotating widget into your theme directly with specific class .testimonialswidget_testimonials1234
|
307 |
+
echo testimonialswidget_widget( $args, $widget_number );
|
308 |
+
|
309 |
+
?>
|
310 |
+
`
|
311 |
+
|
312 |
+
In case of `Fatal error: Call to undefined function testimonialswidget_widget() in…`, please try including `testimonials-widget.php` like the following.
|
313 |
+
|
314 |
+
`
|
315 |
+
<?php
|
316 |
+
include_once( WP_PLUGIN_DIR . '/testimonials-widget/testimonials-widget.php' );
|
317 |
+
echo testimonialswidget_widget();
|
318 |
+
?>
|
319 |
+
`
|
320 |
+
|
321 |
+
= 2. How do you include the actual testimonials for the widget? Where do I quote my customers? I mean, where do I enter the actual text? =
|
322 |
+
|
323 |
+
In WordPress Admin > Testimonials. See [screenshot 1](http://s.wordpress.org/extend/plugins/testimonials-widget/screenshot-1.png).
|
324 |
+
|
325 |
+
Basically, look down the left side of your WordPress admin area for the Testimonials section. Click on that section link, then click "Add new testimonial" at top to add quotes.
|
326 |
+
|
327 |
+
= 3. How do I filter the testimonials data before display processing? =
|
328 |
+
|
329 |
+
`
|
330 |
+
function my_testimonials_widget_data( $data ) {
|
331 |
+
if ( empty( $data ) )
|
332 |
+
return $data;
|
333 |
+
|
334 |
+
foreach( $data as $key => $testimonial ) {
|
335 |
+
// do something with the $testimonial entry
|
336 |
+
// the keys below are those that are currently available
|
337 |
+
// 'testimonial_extra' is the key in which you can put in your own custom content for display
|
338 |
+
$testimonial = array(
|
339 |
+
'post_id' => …,
|
340 |
+
'testimonial_source' => …,
|
341 |
+
'testimonial_company' => …,
|
342 |
+
'testimonial_content' => …,
|
343 |
+
'testimonial_email' => …,
|
344 |
+
'testimonial_image' => …,
|
345 |
+
'testimonial_url' => …,
|
346 |
+
'testimonial_extra' => …,
|
347 |
+
);
|
348 |
+
|
349 |
+
$data[ $key ] = $testimonial;
|
350 |
+
}
|
351 |
+
|
352 |
+
return $data;
|
353 |
+
}
|
354 |
+
|
355 |
+
add_filter( 'testimonials_widget_data', 'my_testimonials_widget_data' );
|
356 |
+
`
|
357 |
+
|
358 |
+
Do note that content truncation might still remove your appended content if you're using `char_limit`.
|
359 |
+
|
360 |
+
Content of `testimonial_extra` is appended after the closing `cite` tag within the testimonial with CSS class `testimonialswidget_extra`.
|
361 |
+
|
362 |
+
= 4. How do I change the image size? =
|
363 |
+
|
364 |
+
The default image size is based upon Thumbnail size in Media Settings. If changing that doesn't work for you, then use `add_filter` in your theme's `functions.php` file to adjust the image size.
|
365 |
+
|
366 |
+
`
|
367 |
+
add_filter( 'testimonials_widget_image_size', 'my_testimonials_widget_image_size' );
|
368 |
+
|
369 |
+
function my_testimonials_widget_image_size( $size ) {
|
370 |
+
$size = array( 120, 90 );
|
371 |
+
|
372 |
+
return $size;
|
373 |
+
}
|
374 |
+
`
|
375 |
+
|
376 |
+
You can use either a string keyword (thumbnail, medium, large or full) or a 2-item array representing width and height in pixels, e.g. array(32,32).
|
377 |
+
|
378 |
+
I recommend putting your theme customizations into a `custom-functions.php` file and then include that in your theme's `functions.php` file via `include 'custom-functions.php';`.
|
379 |
+
|
380 |
+
= 5. How do I change the Gravatar size? =
|
381 |
|
382 |
+
Use an `add_filter` in your theme's `functions.php` file to adjust the Gravatar size.
|
383 |
|
384 |
+
`
|
385 |
+
add_filter( 'testimonials_widget_gravatar_size', 'my_testimonials_widget_gravatar_size' );
|
386 |
|
387 |
+
function my_testimonials_widget_gravatar_size( $size ) {
|
388 |
+
$size = 120;
|
389 |
+
|
390 |
+
return $size;
|
391 |
+
}
|
392 |
+
`
|
393 |
+
|
394 |
+
Default Gravatar size is 96, maximum 512.
|
395 |
+
|
396 |
+
= 6. What CSS applies to testimonials container? =
|
397 |
+
|
398 |
+
See FAQ 34/35 for more specific HTML layout and CSS presentation information.
|
399 |
|
400 |
CSS class `testimonialswidget_testimonials` wraps all testimonials. Additionally, shortcode lists are wrapped by `testimonialswidget_testimonials testimonialswidget_testimonials_list`.
|
401 |
|
402 |
+
= 7. What CSS applies to single testimonial container? =
|
403 |
|
404 |
+
See FAQ 34/35 for more specific HTML layout and CSS presentation information.
|
405 |
|
406 |
+
CSS class `testimonialswidget_testimonial` wraps a single testimonial. Additionally, single shortcode list tems are wrapped by `testimonialswidget_testimonial testimonialswidget_testimonial_list`.
|
407 |
|
408 |
+
= 8. How can I add the testimonials plugin to any where on the site? ie. somewhere other than the side bar like the contact page etc.? =
|
409 |
|
410 |
+
See the "Shortcode Examples", "Theme Function `testimonialswidget_list()`" and "Theme Function `testimonialswidget_widget()`" on http://wordpress.org/extend/plugins/testimonials-widget/.
|
411 |
|
412 |
+
= 9. How do I hide the comma after the source? =
|
413 |
|
414 |
Use CSS.
|
415 |
+
|
416 |
+
`
|
417 |
+
.testimonialswidget_testimonial .testimonialswidget_join_title {
|
418 |
+
.testimonialswidget_testimonial .testimonialswidget_join {
|
419 |
display: none;
|
420 |
+
}
|
421 |
+
`
|
422 |
|
423 |
+
= 10. Testimonials widget is not showing or rotating =
|
424 |
|
425 |
The usual problem is that jQuery is included twice. Once by WordPress and again by a theme. Remove the jQuery version included by your theme and you should be fine.
|
426 |
|
427 |
+
= 11. I'm not seeing any testimonials but the title =
|
428 |
|
429 |
If you're not seeing any testimonials, even when not using tags filter, you might try increasing the Character limit or setting it to '0' or 'none' in the widget box.
|
430 |
|
431 |
+
= 12. How do I apply custom CSS to a specific testimonial widget? =
|
432 |
|
433 |
The easiest thing is to check the source code of your page with the widget and look for the testimonial widgets div container id tag. It'll be something like `id="testimonials_widget-3"`.
|
434 |
|
435 |
+
Then, in your theme's `custom.css` or `styles.css` file write CSS like the following.
|
436 |
+
|
437 |
+
`
|
438 |
+
#testimonials_widget-3 {
|
439 |
+
color: red;
|
440 |
+
}
|
441 |
+
|
442 |
+
#testimonials_widget-3 cite {
|
443 |
+
color: black;
|
444 |
+
}
|
445 |
+
`
|
446 |
|
447 |
+
= 13. How to get rid of the quotation marks that surround the random quote? =
|
448 |
|
449 |
+
In your theme's `custom.css` or `styles.css` file write the following CSS.
|
450 |
|
451 |
+
`
|
452 |
+
.testimonialswidget_testimonial .testimonialswidget_open_quote:before,
|
453 |
+
.testimonialswidget_testimonial .testimonialswidget_close_quote:after {
|
454 |
+
display: none;
|
455 |
+
}
|
456 |
+
`
|
457 |
|
458 |
+
= 14. How to change the random quote text color? =
|
459 |
|
460 |
+
Styling such as text color, font size, background color, etc., of the random quote can be customized by editing your theme's `styles.css` file to apply CSS like the following.
|
461 |
|
462 |
+
`
|
463 |
+
.testimonialswidget_testimonial q {
|
464 |
color: blue;
|
465 |
+
}
|
466 |
+
`
|
467 |
|
468 |
+
= 15. How can I style the shortcode testimonials? =
|
469 |
|
470 |
+
See FAQ 34/35 for more specific HTML layout and CSS presentation information.
|
471 |
|
472 |
Each shortcode testimonial is wrapped by a `div` using classes `testimonialswidget_testimonial testimonialswidget_testimonial_list`. As such, to increase spacing between testimonials, try…
|
473 |
|
476 |
padding-bottom: 1em;
|
477 |
}
|
478 |
`
|
479 |
+
|
480 |
Making the citation line a different color is a little trickier. The reason being is that applying a color to `.testimonialswidget_testimonial cite` will change the entire citation line in the widget display as well. To only change the shortcode testimonial citation color, try…
|
481 |
|
482 |
`
|
484 |
color: blue;
|
485 |
}
|
486 |
`
|
487 |
+
|
488 |
+
If you're wanting to change only the company or URL color, then try.
|
489 |
|
490 |
`
|
491 |
+
.testimonialswidget_testimonial_list cite .testimonialswidget_company {
|
492 |
color: purple;
|
493 |
}
|
494 |
`
|
|
|
495 |
|
496 |
+
Like wise, the source uses class `testimonialswidget_source`.
|
497 |
|
498 |
+
= 16. How do I change the join ", " text? =
|
499 |
|
500 |
+
In CSS, revise the join content like the following.
|
501 |
+
|
502 |
+
`
|
503 |
+
.testimonialswidget_testimonial .testimonialswidget_join:before {
|
504 |
+
content: " | "
|
505 |
+
}
|
506 |
+
`
|
507 |
+
|
508 |
+
= 17. Who can edit testimonials? =
|
509 |
+
|
510 |
+
All users can see and use the testimonials system. However, only users with `edit_others_posts` ability get to set author or edit other author's testimonials.
|
511 |
+
|
512 |
+
= 18. How do I put the title on a separate line? =
|
513 |
+
|
514 |
+
In CSS put the following.
|
515 |
+
|
516 |
+
`
|
517 |
+
.testimonialswidget_testimonial .testimonialswidget_join_title {
|
518 |
+
display: none;
|
519 |
+
}
|
520 |
+
|
521 |
+
.testimonialswidget_testimonial .testimonialswidget_title {
|
522 |
+
display: block;
|
523 |
+
}
|
524 |
+
`
|
525 |
+
|
526 |
+
= 19. How do I put company details on a separate line? =
|
527 |
+
|
528 |
+
In CSS put the following.
|
529 |
+
|
530 |
+
`
|
531 |
+
.testimonialswidget_testimonial .testimonialswidget_join {
|
532 |
+
display: none;
|
533 |
+
}
|
534 |
+
|
535 |
+
.testimonialswidget_testimonial .testimonialswidget_company,
|
536 |
+
.testimonialswidget_testimonial .testimonialswidget_url {
|
537 |
+
display: block;
|
538 |
+
}
|
539 |
+
`
|
540 |
+
|
541 |
+
= 20. After upgrading, testimonial rotations have stopped =
|
542 |
+
|
543 |
+
The JavaScript for rotating testimonials is moved to the footer. As such, your theme requires `wp_footer()` in the footer. Check to make sure your theme has the `<?php wp_footer(); ?>` call in footer.php or the equivalent file.
|
544 |
+
|
545 |
+
Alternately, enable Developer Mode in your browser, right-click on a testimonial, select "Inspect Element", and then click on the Console tab to review and resolve the JavaScript errors.
|
546 |
+
|
547 |
+
= 21. How can I justify testimonials text? =
|
548 |
+
|
549 |
+
|
550 |
+
To justify all testimonials try…
|
551 |
+
`
|
552 |
+
.testimonialswidget_testimonial {
|
553 |
+
text-align: justify;
|
554 |
+
}
|
555 |
+
`
|
556 |
+
To justify only the testimonials list try…
|
557 |
+
`
|
558 |
+
.testimonialswidget_testimonial_list {
|
559 |
+
text-align: justify;
|
560 |
+
}
|
561 |
+
`
|
562 |
|
563 |
+
= 22. Do testimonials have there own URL? =
|
564 |
+
|
565 |
+
Testimonial Widgets records are a custom post type and therefore can be viewed via a URL like http://www.example.com/testimonial/michael-cannon-senior-developer/.
|
566 |
+
|
567 |
+
When you look at the WP > Admin > Testimonials post list, you can click on the View link to see the testimonial in full.
|
|
|
|
|
568 |
|
569 |
+
The filters `testimonials_widget_testimonial_html_single` and `testimonials_widget_testimonial_html_single_content` are related to the single view.
|
570 |
|
571 |
+
Please purchase [Testimonials Widget Premium](http://aihr.us/wordpress/testimonials-widget-premium/) to get "Read more" link capability or use the filters to create your own.
|
|
|
|
|
|
|
|
|
572 |
|
573 |
+
= 23. My testimonial URL says "Page not found" or 404 =
|
574 |
+
|
575 |
+
Go to WordPress > Plugins to Deactivate and then Activate Testimonials Widget. The `flush_rewrite_rules` function needs to run.
|
576 |
+
|
577 |
+
If that still doesn't work, go to WordPress > Settings > Permalinks and click "Save Changes".
|
578 |
+
|
579 |
+
= 24. Does this plug in use admin-ajax.php to refresh? =
|
580 |
+
|
581 |
+
No, it doesn't call admin-ajax.php at all.
|
582 |
+
|
583 |
+
= 25. Is there a way to reorder testimonials? =
|
584 |
+
|
585 |
+
Look for ORDER BY under Advanced Options of the Testimonials Widget. In ORDER BY, put post_date. Then you use dates to put your testimonials into the order you want.
|
586 |
+
|
587 |
+
Alternately, use the `orderby` shortcode option.
|
588 |
+
|
589 |
+
= 26. How do I create a next link? =
|
590 |
+
|
591 |
+
Either purchase [Testimonials Widget Premium](http://aihr.us/wordpress/testimonials-widget-premium/) or see http://wordpress.org/support/topic/plugin-testimonials-widget-next-testimonial-not-pagination for tips.
|
592 |
+
|
593 |
+
= 27. How do I hide the "No testimonials found" text? =
|
594 |
+
|
595 |
+
In Widget options, check "Hide testimonials not found?" or in shortcode options use `hide_not_found=true`.
|
596 |
+
|
597 |
+
`[testimonialswidget_list hide_not_found=true]`
|
598 |
+
|
599 |
+
= 28. How do I export testimonials? =
|
600 |
+
|
601 |
+
|
602 |
+
Use the WordPress Admin > Tools > Export option to do so. Besure to select 'All content' or 'Testimonials'.
|
603 |
+
|
604 |
+
= 29. How do I import testimonials from WordPress export? =
|
605 |
+
|
606 |
+
|
607 |
+
Go WordPress Admin > Tools > Import > WordPress, install and activate that WordPress importer. Then repeat the WordPress Admin > Tools > Import > WordPress sequence to actually import up your export.
|
608 |
+
|
609 |
+
= 30. What's one way to programmatically query testimonials on a page without using shortcodes or widgets? =
|
610 |
+
|
611 |
+
|
612 |
+
`
|
613 |
+
<?php
|
614 |
+
$paged = get_query_var('paged') ? get_query_var('paged') : 1;
|
615 |
+
$args = array( 'paged' => $paged, 'posts_per_page' => 10, 'orderby' => DESC, 'post_type' => Testimonials_Widget::pt );
|
616 |
+
// The Query
|
617 |
+
query_posts( $args );
|
618 |
+
// The Loop
|
619 |
+
while ( have_posts() ) : the_post();
|
620 |
+
// do your thing…
|
621 |
+
endwhile;
|
622 |
+
?>
|
623 |
+
`
|
624 |
+
|
625 |
+
Cheers to [tcwebguru](http://wordpress.org/support/topic/display-on-page-without-widget) for this suggestion.
|
626 |
+
|
627 |
+
= 31. How do I change Testimonials Widget text labels? =
|
628 |
+
|
629 |
+
1. The default `WPLANG` is `en_US`.
|
630 |
+
* Use `en_US.mo` and `en_US.po` as the filenames of your localization changes if you're sticking with US English.
|
631 |
+
* `de_DE` – German
|
632 |
+
* `en_UK` – UK English
|
633 |
+
* `es_ES` – Spanish
|
634 |
+
* `fr_FR` – French
|
635 |
+
* `ja_JP.EUC-JP.mo` – Japanese in EUC-JP encoding
|
636 |
+
* `zh-TW` – Traditional Chinese
|
637 |
+
* `zh_CN` – Simplified Chinese
|
638 |
+
1. Create localized `YOUR_WPLANG.mo` and `YOUR_WPLANG.po` files from `languages/testimonials-widget.pot`.
|
639 |
+
* See [Translation Tools](http://codex.wordpress.org/Translating_WordPress#Translation_Tools) of [Translating WordPress](http://codex.wordpress.org/Translating_WordPress) for help.
|
640 |
+
* Ensure that `YOUR_WPLANG.mo` and `YOUR_WPLANG.po` files contain the correct `Language:` tag like `Language: es_ES` and `"Language: es_ES\n"` respectively.
|
641 |
+
* Example: See screenshot 21. "Poedit Catalog properties"
|
642 |
+
1. Create a directory named `languages` inside of `wp-content`.
|
643 |
+
1. Put your `YOUR_WPLANG.mo` and `YOUR_WPLANG.po` files into your `wp-content/languages` directory.
|
644 |
+
1. Set `WPLANG` in `wp-config.php` to your chosen language.
|
645 |
+
* See [Using Localizations](http://codex.wordpress.org/Translating_WordPress#Using_Localizations) of [Translating WordPress](http://codex.wordpress.org/Translating_WordPress) for help.
|
646 |
+
* Ex: `<?php define('WPLANG', 'de_DE'); ?>`
|
647 |
+
|
648 |
+
*Sometimes the above doesn't work, so…*
|
649 |
+
|
650 |
+
1. Create localized `testimonials-widget-YOUR_WPLANG.mo` and `testimonials-widget-YOUR_WPLANG.po` files from `languages/testimonials-widget.pot`.
|
651 |
+
1. Put your localized `testimonials-widget-YOUR_WPLANG.mo` and `testimonials-widget-YOUR_WPLANG.po` files into directory `wp-content/plugins/testimonials-widget/languages/`.
|
652 |
+
1. Set `WPLANG` in `wp-config.php` to your chosen language.
|
653 |
+
|
654 |
+
When done translating, please [send your translation](http://aihr.us/contact-aihrus/) for inclusion with the Testimonials Widget plugin release.
|
655 |
+
|
656 |
+
Check out [Translating WordPress Plugins & Themes](http://urbangiraffe.com/articles/translating-wordpress-themes-and-plugins/) for fuller explanations.
|
657 |
+
|
658 |
+
= 32. How do I prevent testimonials in my footer from changing the page height? =
|
659 |
+
|
660 |
+
|
661 |
+
Use the shortcode `max-height` or widget "Maximum Height" option to keep the testimonial widget height consistent.
|
662 |
+
|
663 |
+
= 33. How do I change the more content ellipsis? =
|
664 |
+
|
665 |
+
In your theme's `functions.php` file, add similar code as follows.
|
666 |
+
`
|
667 |
+
add_filter( 'testimonials_widget_content_more', function() { return ' Continue reading →'; } );
|
668 |
+
`
|
669 |
+
or
|
670 |
+
`
|
671 |
+
function my_content_more() {
|
672 |
+
return ' Continue reading →';
|
673 |
+
}
|
674 |
+
|
675 |
+
add_filter( 'testimonials_widget_content_more', 'my_content_more' );
|
676 |
+
`
|
677 |
+
|
678 |
+
= 34. How is an active testimonial widget formatted with CSS? =
|
679 |
+
|
680 |
+
`
|
681 |
+
<!-- testimonials outer wrapper begin -->
|
682 |
+
<!-- The NNN of testimonialswidget_testimonialsNNN represents the widget number for specific widget styling -->
|
683 |
+
<div class="testimonialswidget_testimonials testimonialswidget_testimonialsNNN">
|
684 |
+
<!-- individual testimonial wrapper begin -->
|
685 |
+
<div class="post-NNN testimonials-widget type-testimonials-widget status-publish hentry category-slug_name tag-slug_name testimonialswidget_testimonial testimonialswidget_active">
|
686 |
+
<span class="testimonialswidget_image">
|
687 |
+
<img width="150" height="150" src="http://example.com/example.jpg" class="attachment-thumbnail wp-post-image" alt="Example" title="Example">
|
688 |
+
</span>
|
689 |
+
<q>
|
690 |
+
<span class="testimonialswidget_open_quote"></span>Testimonial AKA post content<span class="testimonialswidget_close_quote"></span>
|
691 |
+
</q>
|
692 |
+
<cite>
|
693 |
+
<span class="testimonialswidget_author">
|
694 |
+
<a href="mailto:email@example.com">Source AKA post title</a>
|
695 |
+
</span>
|
696 |
+
<span class="testimonialswidget_join_title"></span>
|
697 |
+
<span class="testimonialswidget_title">Title</span>
|
698 |
+
<span class="testimonialswidget_join"></span>
|
699 |
+
<span class="testimonialswidget_company">
|
700 |
+
<a href="http://example.com">Company, LLC</a>
|
701 |
+
</span>
|
702 |
+
</cite>
|
703 |
+
<div class="testimonialswidget_extra">Custom extra text</div>
|
704 |
+
<div class="testimonialswidget_bottom_text">Custom widget text</div>
|
705 |
+
</div>
|
706 |
+
<!-- individual testimonial wrapper end -->
|
707 |
+
</div>
|
708 |
+
<!-- testimonials outer wrapper end -->
|
709 |
+
`
|
710 |
+
|
711 |
+
Please view the `testimonials-widget.css` file for CSS customizations.
|
712 |
+
|
713 |
+
See FAQ 61 for NNN identification.
|
714 |
+
|
715 |
+
= 35. How is a testimonial list formatted with CSS? =
|
716 |
+
|
717 |
+
`
|
718 |
+
<!-- testimonials outer wrapper begin -->
|
719 |
+
<div class="testimonialswidget_testimonials testimonialswidget_testimonials_list">
|
720 |
+
<!-- individual testimonial wrapper begin -->
|
721 |
+
<div class="post-NNN testimonials-widget type-testimonials-widget status-publish hentry category-slug_name tag-slug_name testimonialswidget_testimonial testimonialswidget_testimonial_list">
|
722 |
+
<span class="testimonialswidget_image">
|
723 |
+
<img width="150" height="150" src="http://example.com/example.jpg" class="attachment-thumbnail wp-post-image" alt="Example" title="Example">
|
724 |
+
</span>
|
725 |
+
<q>
|
726 |
+
<span class="testimonialswidget_open_quote"></span>Testimonial AKA post content<span class="testimonialswidget_close_quote"></span>
|
727 |
+
</q>
|
728 |
+
<cite>
|
729 |
+
<span class="testimonialswidget_author">
|
730 |
+
<a href="mailto:email@example.com">Source AKA post title</a>
|
731 |
+
</span>
|
732 |
+
<span class="testimonialswidget_join_title"></span>
|
733 |
+
<span class="testimonialswidget_title">Title</span>
|
734 |
+
<span class="testimonialswidget_join"></span>
|
735 |
+
<span class="testimonialswidget_company">
|
736 |
+
<a href="http://example.com">Company, LLC</a>
|
737 |
+
</span>
|
738 |
+
</cite>
|
739 |
+
<div class="testimonialswidget_extra">Custom extra text</div>
|
740 |
+
<div class="testimonialswidget_bottom_text">Custom widget text</div>
|
741 |
+
</div>
|
742 |
+
<!-- individual testimonial wrapper end -->
|
743 |
+
</div>
|
744 |
+
<!-- testimonials outer wrapper end -->
|
745 |
+
`
|
746 |
+
|
747 |
+
Please view the `testimonials-widget.css` file for CSS customizations.
|
748 |
|
749 |
+
See FAQ 61 for NNN identification.
|
750 |
+
|
751 |
+
= 36. How do I configure Next and Previous page indicators? =
|
752 |
+
|
753 |
+
For previous page links, in your theme's `functions.php` file, add similar code as follows.
|
754 |
+
`
|
755 |
+
add_filter( 'testimonials_widget_previous_posts_link_text', function() { return 'Previous'; } );
|
756 |
+
`
|
757 |
+
or
|
758 |
+
`
|
759 |
+
function my_testimonials_widget_previous_posts_link_text() {
|
760 |
+
return 'Previous';
|
761 |
+
}
|
762 |
+
|
763 |
+
add_filter( 'testimonials_widget_previous_posts_link_text', 'my_testimonials_widget_previous_posts_link_text' );
|
764 |
+
`
|
765 |
+
|
766 |
+
For next page links, use `testimonials_widget_next_posts_link` instead of `testimonials_widget_previous_posts_link_text` in above.
|
767 |
+
|
768 |
+
= 37. Why should I purchase the Testimonials Widget Premium? =
|
769 |
+
|
770 |
+
Simply said, to demonstrate on-going support for the development of Testimonials Widget.
|
771 |
+
|
772 |
+
Further, you and other developers are very welcome to code your own version of [Testimonials Widget Premium](http://aihr.us/wordpress/testimonials-widget-premium/) plugin's caching and 'read more' link capabilities without purchase. Since version 2.3.0, the free Testimonials Widget plugin provides several new filters or hooks which provides for easily incorporating the premium features.
|
773 |
+
|
774 |
+
It was a hard choice making the 'Read more' link feature a premium option. I knew that there were going to be people not happy with me for doing so. However, I feel that asking for you to purchase [Testimonials Widget Premium](http://aihr.us/wordpress/testimonials-widget-premium/) is an acceptable request to help pay for the free, quick support and development like Testimonials Widget's [17 high-level changes](http://plugins.trac.wordpress.org/changeset?reponame=&old=627496%40testimonials-widget&new=628068%40testimonials-widget) to go from version 2.2.9 to 2.3.0.
|
775 |
+
|
776 |
+
= 38. How do I use filter `testimonials_widget_defaults`? =
|
777 |
+
|
778 |
+
To create a global or central Testimonials Widget configuration, in your theme's `functions.php` file, add similar code as follows.
|
779 |
+
|
780 |
+
`
|
781 |
+
function my_testimonials_widget_defaults( $array ) {
|
782 |
+
$array['category'] = 'testimony';
|
783 |
+
$array['char_limit'] = 250;
|
784 |
+
$array['paging'] = 'true';
|
785 |
+
$array['refresh_interval'] = 10;
|
786 |
+
|
787 |
+
return $array;
|
788 |
+
}
|
789 |
+
|
790 |
+
add_filter( 'testimonials_widget_defaults', 'my_testimonials_widget_defaults' );
|
791 |
+
`
|
792 |
+
|
793 |
+
= 39. How do I style the custom widget text? =
|
794 |
+
|
795 |
+
In your theme's `styles.css` file use the CSS class `.testimonialswidget_bottom_text` to style the custom widget text.
|
796 |
+
|
797 |
+
= 40. How do I get page numbers for pagination? =
|
798 |
+
|
799 |
+
Install and activate [WP-PageNavi](http://wordpress.org/extend/plugins/wp-pagenavi/) to get page numbers for pagination of testimonials via the shortcode `[testimonialswidget_list]`.
|
800 |
+
|
801 |
+
Additionally, you can use filter `testimonials_widget_wp_pagenavi` to configure WP-PageNavi specifically for Testimonial Widgets. Read WP-PageNavi's [core.php](http://plugins.svn.wordpress.org/wp-pagenavi/trunk/core.php) `wp_pagenavi` function declaration for available options.
|
802 |
+
|
803 |
+
= 41. How do I make my widget height consistent and not overlapping? =
|
804 |
+
|
805 |
+
In short, set `min-height` and `max-height` options to be the same.
|
806 |
+
|
807 |
+
Why? Because testimonial lengths differ and there might be an image or not, the normal CSS `height` property fails for our dynamic rotations.
|
808 |
+
|
809 |
+
= 42. How do I exclude testimonial categories from Category widget? =
|
810 |
+
|
811 |
+
Add the following to your theme's `functions.php` file:
|
812 |
+
|
813 |
+
`
|
814 |
+
function exclude_widget_categories( $args ) {
|
815 |
+
// Make sure to replace the category IDs 8,10 with yours.
|
816 |
+
$exclude = '8,10';
|
817 |
+
$args['exclude'] = $exclude;
|
818 |
+
return $args;
|
819 |
+
}
|
820 |
+
add_filter( 'widget_categories_args', 'exclude_widget_categories' );
|
821 |
+
`
|
822 |
+
|
823 |
+
Thank you [katiewp](http://wordpress.org/support/topic/plugin-testimonials-widget-categories-tags-best-practices?replies=7#post-3460607) for the answer.
|
824 |
+
|
825 |
+
= 43. How do I exclude testimonial categories from my sitemap? =
|
826 |
+
|
827 |
+
Change the following in your theme's `functions.php` or `sitemap.php` file:
|
828 |
+
|
829 |
+
Before:
|
830 |
+
`
|
831 |
+
<?php wp_list_categories('sort_column=name&optioncount=1&hierarchical=0&title_li='); ?>
|
832 |
+
`
|
833 |
+
|
834 |
+
After:
|
835 |
+
`
|
836 |
+
<?php wp_list_categories('sort_column=name&optioncount=1&hierarchical=0&title_li=&exclude=8,10'); ?>
|
837 |
+
`
|
838 |
+
|
839 |
+
Make sure to replace the category IDs 8,10 with yours.
|
840 |
+
|
841 |
+
Thank you [katiewp](http://wordpress.org/support/topic/plugin-testimonials-widget-categories-tags-best-practices?replies=7#post-3460607) for the answer.
|
842 |
+
|
843 |
+
= 44. Can I change how quickly the testimonials change? =
|
844 |
+
|
845 |
+
Yes. Look for the "Rotation Speed" on the widget options panel or use the `refresh_interval` option in shortcode to adjust the number of seconds between testimonial rotations.
|
846 |
+
|
847 |
+
= 45. Why don't I see all of my testimonial? =
|
848 |
+
|
849 |
+
The widget option by default has a 500 character limit. To view more characters, increase the limit or set it to 0. See bottom of [screenshot 3](http://s.wordpress.org/extend/plugins/testimonials-widget/screenshot-3.png).
|
850 |
+
|
851 |
+
= 46. How do you order testimonials by given IDs? =
|
852 |
+
|
853 |
+
To display the testimonials with IDs 538, 451, 442, 449, and 565 in that same order; you need to use the `ids` and `orderby` shortcode or widget options.
|
854 |
+
|
855 |
+
`
|
856 |
+
[testimonialswidget_list ids="538,451,442,449,565" orderby=none]
|
857 |
+
`
|
858 |
+
|
859 |
+
Thank you [Ionrot](http://wordpress.org/support/topic/order-by-id-list?replies=5#post-3517737) for inspiring this FAQ and code feature.
|
860 |
+
|
861 |
+
= 47. How to make a testimonials listing in a widget than a rotating testimonial? =
|
862 |
+
|
863 |
+
First, you'll need to enable shortcodes in widget by adding `add_filter('widget_text', 'do_shortcode');` to the bottom of your themes `functions.php` file, before the closing `?>`.
|
864 |
+
|
865 |
+
Then for the testimonials listing in a widget, use a Text widget with a shortcode like `[testimonialswidget_list limit=5]`.
|
866 |
+
|
867 |
+
If you have formatting issues, you can check out [Enabling shortcodes in widgets, quick WordPress tip.](http://dannyvankooten.com/630/enabling-shortcodes-in-widgets-quick-wordpress-tip/) for further help.
|
868 |
+
|
869 |
+
Thank you [davidnjacoby](http://wordpress.org/support/topic/make-testimonials-widget-a-list-not-rotating-individual-testimonials?replies=2#post-3548911) for recommending this FAQ.
|
870 |
+
|
871 |
+
= 48. How do I customize my testimonial list and widget output? =
|
872 |
+
|
873 |
+
If you want to change the layout of the testimonials, then you can use the `testimonials_widget_testimonial_html` filter. This filter follows the `get_testimonials_html` method which is how the testimonial HTML is normally generated. The `testimonials_widget_testimonial_html` filter works for widgets and lists.
|
874 |
+
|
875 |
+
`
|
876 |
+
add_filter( 'testimonials_widget_testimonial_html', 'my_testimonials_widget_testimonial_html', 10, 5 );
|
877 |
+
|
878 |
+
function my_testimonials_widget_testimonial_html( $content, $testimonial, $atts, $is_list = true, $is_first = false, $widget_number = null ) {
|
879 |
+
// do stuff… see Testimonials_Widget::get_testimonial_html for default processing
|
880 |
+
return $content;
|
881 |
+
}
|
882 |
+
`
|
883 |
+
|
884 |
+
= 49. How do I customize my testimonial single output? =
|
885 |
+
|
886 |
+
See FAQ 48 for more details.
|
887 |
+
|
888 |
+
`
|
889 |
+
add_filter( 'testimonials_widget_testimonial_html_single', 'my_testimonials_widget_testimonial_html_single', 10, 3 );
|
890 |
+
|
891 |
+
function my_testimonials_widget_testimonial_html_single( $content, $testimonial, $atts ) {
|
892 |
+
// do stuff… see Testimonials_Widget::get_testimonials_html for default processing
|
893 |
+
return $content;
|
894 |
+
}
|
895 |
+
`
|
896 |
+
|
897 |
+
= 50. Example to set widget gradient background color =
|
898 |
+
|
899 |
+
See FAQ 61 for NNN identification. Then write CSS like the following change the color behind the widget to a light gradient gold.
|
900 |
+
|
901 |
+
`
|
902 |
+
.testimonialswidget_testimonials3 {
|
903 |
+
background-image: linear-gradient(to bottom right, #FFEF87 0%, #EFEFEF 100%);
|
904 |
+
}
|
905 |
+
`
|
906 |
+
|
907 |
+
A special thanks to [inode86](http://wordpress.org/support/topic/gradient-background-color?replies=2) for this suggestion.
|
908 |
+
|
909 |
+
= 51. How do I use filter `testimonials_widget_get_testimonial_html`? =
|
910 |
+
|
911 |
+
Also see FAQ 48.
|
912 |
+
|
913 |
+
`
|
914 |
+
add_filter( 'testimonials_widget_get_testimonial_html', 'my_testimonials_widget_get_testimonial_html', 10, 13 );
|
915 |
+
|
916 |
+
function my_testimonials_widget_get_testimonial_html( $html, $testimonial, $atts, $is_list, $is_first, $widget_number, $div_open, $image, $quote, $cite, $extra, $bottom_text, $div_close ) {
|
917 |
+
// do stuff… see Testimonials_Widget::get_testimonials_html for default processing
|
918 |
+
if ( is_page( 437 ) ) {
|
919 |
+
$source = '';
|
920 |
+
if ( ! empty( $testimonial['testimonial_source'] ) )
|
921 |
+
$source = '<h3>' . $testimonial['testimonial_source'] . '</h3>';
|
922 |
+
|
923 |
+
$html = $div_open
|
924 |
+
. $source
|
925 |
+
. $image
|
926 |
+
. $quote
|
927 |
+
// . $cite
|
928 |
+
// . $extra
|
929 |
+
// . $bottom_text
|
930 |
+
. $div_close;
|
931 |
+
return $html;
|
932 |
+
} elseif ( false && $is_list ) {
|
933 |
+
return '<li>' . $image . $testimonial['testimonial_title'] . '</li>';
|
934 |
+
} else {
|
935 |
+
return $html;
|
936 |
+
}
|
937 |
+
}
|
938 |
+
`
|
939 |
+
|
940 |
+
Thank you to [Georgia Gibbs Design](http://georgia-gibbs.com/) for suggesting this capability.
|
941 |
+
|
942 |
+
= 52. How do I include testimonies in my archive view? =
|
943 |
+
In your theme's `functions.php` file, place code similar to the following for the configuration you need.
|
944 |
+
|
945 |
+
`
|
946 |
+
add_filter( 'pre_get_posts', 'pre_get_posts_allow_testimonials' );
|
947 |
+
function pre_get_posts_allow_testimonials( $query ) {
|
948 |
+
if ( $query->is_admin ) {
|
949 |
+
return $query;
|
950 |
+
} elseif ( ( $query->is_main_query() || is_feed() )
|
951 |
+
&& ! is_page()
|
952 |
+
&& ( ( ! empty( $query->query_vars['post_type'] ) && 'post' == $query->query_vars['post_type'] )
|
953 |
+
|| is_archive() )
|
954 |
+
) {
|
955 |
+
$query->set( 'post_type', array( 'post', Testimonials_Widget::pt ) );
|
956 |
+
}
|
957 |
+
|
958 |
+
return $query;
|
959 |
+
}
|
960 |
+
`
|
961 |
+
|
962 |
+
= 53. How do I scroll my widget based testimonial content? =
|
963 |
+
|
964 |
+
See FAQ 61 for NNN identification. Then in your theme's `styles.css` file add CSS like the following.
|
965 |
+
|
966 |
+
`
|
967 |
+
.testimonialswidget_testimonialsNNN {
|
968 |
+
overflow: auto;
|
969 |
+
}
|
970 |
+
`
|
971 |
+
|
972 |
+
= 54. Why is that there is an update like every other day? =
|
973 |
+
|
974 |
+
I believe as Eric S. Raymond, author of "The Cathedral and the Bazaar" wrote
|
975 |
+
|
976 |
+
> Release early. Release often. And listen to your customers.
|
977 |
+
|
978 |
+
Through 20 years of software development experience, I've found that Wikipedia's definition and reasoning for frequent releases is true.
|
979 |
+
|
980 |
+
> Release early, release often is a software development philosophy that emphasizes the importance of early and frequent releases in creating a tight feedback loop between developers and testers or users, contrary to a feature-based release strategy. Advocates argue that this allows the software development to progress faster, enables the user to help define what the software will become, better conforms to the users' requirements for the software, and ultimately results in higher quality software.
|
981 |
+
|
982 |
+
References
|
983 |
+
|
984 |
+
* [Release Early, Release Often](http://haacked.com/archive/2011/04/20/release-early-and-often.aspx)
|
985 |
+
* [Rules for Entrepreneurs: Release Early and Often](http://technosailor.com/2011/09/28/rules-for-entrepreneurs-release-early-and-often/)
|
986 |
+
* [Wikipedia](http://en.wikipedia.org/wiki/Release_early,_release_often)
|
987 |
+
|
988 |
+
Thank you [gingalley](http://wordpress.org/support/profile/gingalley) for the explanation request.
|
989 |
+
|
990 |
+
= 55. How do I style about page testimonials while leaving other testimonials alone or vice versa? =
|
991 |
+
To style a page's testimonials or a particular testimonial widget instance, you need to style it with a page or testimonial wrapper class. Each page and testimonial has `body` or `div` class tags to support such.
|
992 |
+
|
993 |
+
See FAQ 61 for NNN identification. Then in your theme's `styles.css` file add CSS like the following.
|
994 |
+
|
995 |
+
`
|
996 |
+
.testimonialswidget_testimonialsNNN .testimonialswidget_testimonial {
|
997 |
+
…
|
998 |
+
}
|
999 |
+
`
|
1000 |
+
|
1001 |
+
To style for a particular page, we use that page's CSS class. As an example, [Aihrus' about page](http://aihr.us/about-aihrus/), has the `body` tag `<body class="custom about-aihrus single-page content-sidebar default">`. Therefore, I would do something like the following to style my testimonials.
|
1002 |
+
|
1003 |
+
`
|
1004 |
+
.about-aihrus .testimonialswidget_testimonial {
|
1005 |
+
…
|
1006 |
+
}
|
1007 |
+
`
|
1008 |
+
|
1009 |
+
= 56. What's the testimonials archive view URL? =
|
1010 |
+
|
1011 |
+
**Disabled for now**
|
1012 |
+
|
1013 |
+
It's your URL with `/testimonials/` appended. Like `http://example.com/testimonials/`.
|
1014 |
+
|
1015 |
+
= 57. What's the testimonial single view URL? =
|
1016 |
+
|
1017 |
+
It's your URL with `/testimonial/post-title-slug/` appended. Like `http://example.com/testimonials/your-work-is-awesome/`.
|
1018 |
+
|
1019 |
+
= 58. How do you specify testimonials per page or section? =
|
1020 |
+
|
1021 |
+
Please view [Make Specific testimonial appear in only one page](http://wordpress.org/support/topic/make-specific-testimonial-appear-in-only-one-page).
|
1022 |
+
|
1023 |
+
= 59. Why does my rotating widget show all testimonials than only one at a time? =
|
1024 |
+
|
1025 |
+
Please view [Widget Displaying Whole List Of Testimonials](http://wordpress.org/support/topic/widget-displaying-whole-list-of-testimonials).
|
1026 |
+
|
1027 |
+
= 60. How do I download older versions of Testimonials Widget? =
|
1028 |
+
|
1029 |
+
You can browse code and download current and other versions of Testimonials Widget via its [Developers](http://wordpress.org/extend/plugins/testimonials-widget/developers/) page.
|
1030 |
+
|
1031 |
+
= 61. What's NNN of ".testimonialswidget_testimonialsNNN"? =
|
1032 |
+
|
1033 |
+
As the CSS class `.testimonialswidget_testimonialsNNN` is dynamically generated, you're not going to find it in the Testimonials Widget CSS file. The reason being is that each Testimonials Widget instance is unique so that many can be used and styled on a page.
|
1034 |
+
|
1035 |
+
You may find your NNN value by looking at…
|
1036 |
+
* "CSS class" from your widget's option panel - screenshot 3
|
1037 |
+
* Your webpage's HTML source code for the unique testimonial widget class identifier
|
1038 |
+
* Ex: `<div class="testimonialswidget_testimonials testimonialswidget_testimonials20">` means you use CSS class `.testimonialswidget_testimonials20`
|
1039 |
+
|
1040 |
+
*When writing testimonials CSS, don't forget to change `NNN` to the number found above*
|
1041 |
+
|
1042 |
+
= 62. Why do I get "No testimonials found" when using category and tags? =
|
1043 |
+
|
1044 |
+
Because, there's no testimonials having that category with those tags.
|
1045 |
+
|
1046 |
+
When using tags only, it's possible to select from many testimonials unless you check the "Require all tags" option. Then only testimonials with all of those tags are selected.
|
1047 |
+
|
1048 |
+
= 63. How do I remove the cite –? =
|
1049 |
+
|
1050 |
+
In your theme's `custom.css` or `styles.css` file write the following CSS.
|
1051 |
+
|
1052 |
+
.testimonialswidget_testimonial cite::before {
|
1053 |
+
display: none;
|
1054 |
+
}
|
1055 |
+
|
1056 |
+
= 64. What plugins potentially conflict with Testimonials Widget? =
|
1057 |
+
|
1058 |
+
* JetPack shortcodes
|
1059 |
+
* FancyBox for WordPress
|
1060 |
+
|
1061 |
+
= 65. How do I disable the stylesheet? =
|
1062 |
+
|
1063 |
+
In your theme's `functions.php` file, add the following.
|
1064 |
+
|
1065 |
+
`
|
1066 |
+
add_action( 'init', 'my_init' );
|
1067 |
+
|
1068 |
+
function my_init() {
|
1069 |
+
wp_dequeue_style( 'testimonials-widget' );
|
1070 |
+
}
|
1071 |
+
`
|
1072 |
+
|
1073 |
+
Thank you [sazanetti](http://wordpress.org/support/topic/css-tweaks?replies=4#post-3893996) for the suggestion.
|
1074 |
+
|
1075 |
+
= 66. How do I change the testimonials archive or single view URL? =
|
1076 |
+
|
1077 |
+
Visit WordPress Admin > Testimonials > Settings > Post Type tab and adjust the "Archive Page URL" and "Testimonial Page URL" as desired. Don't forget to update your Permalink Settings via WordPress Admin > Settings > Permalinks and clicking "Save Changes".
|
1078 |
+
|
1079 |
+
|
1080 |
+
= I'm still stuck, how can I get help? =
|
1081 |
+
Visit the [support forum](http://wordpress.org/support/plugin/testimonials-widget) and ask your question.
|
1082 |
+
|
1083 |
+
|
1084 |
+
== Screenshots ==
|
1085 |
+
|
1086 |
+
1. Testimonials admin interface
|
1087 |
+
2. Edit testimonial with "Excerpt" and "Read More Link" fields - [Testimonials Widget Premium plugin](http://aihr.us/wordpress/testimonials-widget-premium/)
|
1088 |
+
3. Collasped Testimonials Widget options
|
1089 |
+
4. Expanded 'General Options' in Testimonials Widget options
|
1090 |
+
5. Testimonial widget in the sidebar
|
1091 |
+
6. [testimonialswidget_list] in post
|
1092 |
+
7. [testimonialswidget_list] results with paging
|
1093 |
+
8. Widget whitespace kept
|
1094 |
+
9. `require_image`, `minimum_length` and `maximum_length` shortcode option examples - [Testimonials Widget Premium plugin](http://aihr.us/wordpress/testimonials-widget-premium/)
|
1095 |
+
10. Widget with "Read more" and "Next testimonial…" links - [Testimonials Widget Premium plugin](http://aihr.us/wordpress/testimonials-widget-premium/)
|
1096 |
+
11. Widget with Premium Options - [Testimonials Widget Premium plugin](http://aihr.us/wordpress/testimonials-widget-premium/)
|
1097 |
+
12. Single view with and without excerpt - Excerpt is feature of [Testimonials Widget Premium plugin](http://aihr.us/wordpress/testimonials-widget-premium/)
|
1098 |
+
13. Widget with clickable title and custom text/HTML on bottom
|
1099 |
+
14. [WP-PageNavi compatible](http://wordpress.org/extend/plugins/wp-pagenavi/) for page numbers than default arrows
|
1100 |
+
15. `[testimonialswidgetpremium_link_list]` Shortcode examples, unstyled - [Testimonials Widget Premium plugin](http://aihr.us/wordpress/testimonials-widget-premium/)
|
1101 |
+
16. Testimonials Widget Settings > Premium tab - [Testimonials Widget Premium plugin](http://aihr.us/wordpress/testimonials-widget-premium/)
|
1102 |
+
17. Single `[testimonialswidget_list]` entry with and without 'Read more' link - [Testimonials Widget Premium plugin](http://aihr.us/wordpress/testimonials-widget-premium/)
|
1103 |
+
18. `[testimonialswidgetpremium_count]` Examples - [Testimonials Widget Premium plugin](http://aihr.us/wordpress/testimonials-widget-premium/)
|
1104 |
+
19. `[testimonialswidget_widget unique=true]` Show multiple testimonials in rotation - [Testimonials Widget Premium plugin](http://aihr.us/wordpress/testimonials-widget-premium/)
|
1105 |
+
20. Alternating background colors – Courtesy of [placeofstillness](http://www.heartattune.com/clients-say/) - [Testimonials Widget Premium plugin](http://aihr.us/wordpress/testimonials-widget-premium/)
|
1106 |
+
21. Poedit Catalog properties
|
1107 |
+
22. Testimonials Widget Settings > General tab
|
1108 |
+
23. Expanded 'Selection Options' in Testimonials Widget options
|
1109 |
+
24. Expanded 'Ordering Options' in Testimonials Widget options
|
1110 |
+
25. Testimonials Widget Settings > Selection tab
|
1111 |
+
26. Testimonials Widget Settings > Post Type tab
|
1112 |
+
|
1113 |
+
|
1114 |
+
== Changelog ==
|
1115 |
= trunk =
|
|
|
1116 |
|
1117 |
+
= 2.8.2 =
|
1118 |
+
* Add filter `testimonials_widget_version`
|
1119 |
+
* Screenshot 11/16 updated
|
1120 |
+
* Update POT
|
1121 |
+
* Update Premium features
|
1122 |
+
* Version tracking for default settings
|
1123 |
+
|
1124 |
+
= 2.8.1 =
|
1125 |
+
* Customizable archive and testimonial URLs
|
1126 |
+
* FAQ 66 Change the testimonials archive or single view URL
|
1127 |
+
* Optional commenting on testimonial single-view pages
|
1128 |
+
* Screenshot 26 Testimonials Widget Settings > Post Type tab
|
1129 |
+
* Update POT
|
1130 |
+
|
1131 |
+
= 2.8.0 =
|
1132 |
+
* Merge in settings branch
|
1133 |
+
* Add `tw_get_options`
|
1134 |
+
* Add filter `testimonials_widget_sections` – Alter section options
|
1135 |
+
* Add filter `testimonials_widget_settings` – Alter setting options
|
1136 |
+
* Add settings page 'Selection', 'Ordering', and 'Widget' tabs
|
1137 |
+
* BUG with "Post Types Order"
|
1138 |
+
* BUGFIX paging when not in singular view
|
1139 |
+
* Configure settings within Testimonials_Widget_Settings class
|
1140 |
+
* Enable 'Expand/Collapse' view in Widget options
|
1141 |
+
* FAQ 65 Disable the stylesheet
|
1142 |
+
* FEATURE Remove `.hentry` CSS?
|
1143 |
+
* FEATURE Testimonials Widget Settings screen
|
1144 |
+
* Removed filters `testimonials_widget_options_update`, `testimonials_widget_options_form`
|
1145 |
+
* Rename `widget_text` to `bottom_text`
|
1146 |
+
* Revise About page content
|
1147 |
+
* Revise Settings page footer
|
1148 |
+
* Revise widget options update and validation
|
1149 |
+
* Screenshot 11 updated
|
1150 |
+
* Screenshot 16 updated
|
1151 |
+
* Screenshot 2 updated
|
1152 |
+
* Screenshot 22 Testimonials Widget Settings > General tab
|
1153 |
+
* Screenshot 23 Expanded 'Selection Options' Testimonials Widget
|
1154 |
+
* Screenshot 24 Expanded 'Ordering Options' Testimonials Widget
|
1155 |
+
* Screenshot 25 Testimonials Widget Settings > Selection tab
|
1156 |
+
* Screenshot 3 updated
|
1157 |
+
* Screenshot 4 updated, Expanded 'General Options' Testimonials Widget
|
1158 |
+
* Update "Shortcode and Widget Options" verbiage
|
1159 |
+
* Update POT file
|
1160 |
+
* Use defaults via Testimonials_Widget_Settings class
|
1161 |
+
* Validate shortcode and widget options via Testimonials_Widget_Settings::validate_settings
|
1162 |
+
* Verbiage updates
|
1163 |
+
|
1164 |
+
= 2.7.17 =
|
1165 |
+
* Add purchase Testimonials Widget Premium plugin meta link
|
1166 |
+
* Begin settings screen work
|
1167 |
+
* FAQ 20 Update
|
1168 |
+
* FAQ 31 Update
|
1169 |
+
* FAQ 63 Remove the cite –
|
1170 |
+
* FAQ 64 Plugin conflict
|
1171 |
+
* Screenshot 21 Poedit Catalog properties
|
1172 |
+
* TODO class removal
|
1173 |
+
* Update localization verbiage
|
1174 |
+
|
1175 |
+
= 2.7.16 =
|
1176 |
+
* Add comments panel to edit screen - [Thank you BarrieSpence](http://wordpress.org/support/topic/disable-comments-10?replies=1)
|
1177 |
+
* TODO Admin panel
|
1178 |
+
|
1179 |
+
= 2.7.15 =
|
1180 |
+
* Add "CSS class" to widget options window
|
1181 |
+
* FAQ 31/34/35/50/53/55 updates
|
1182 |
+
* FAQ 61 Determine .testimonialswidget_testimonialsNNN
|
1183 |
+
* FAQ 62 Category and tag selection
|
1184 |
+
* Feature updates
|
1185 |
+
* Localization, Hebrew
|
1186 |
+
* Screenshot 3 updated
|
1187 |
+
|
1188 |
+
= 2.7.14 =
|
1189 |
+
* BUGFIX [Testimonials archive view URL conflicts with Page slug](http://wordpress.org/support/topic/testimonials-archive-view-url-conflicts-with-page-slug)
|
1190 |
+
* FAQ 1 Update - Thank you [aaaronscat](http://wordpress.org/support/topic/writing-php-to-display-rotating-widget-in-a-template) for the inspiration
|
1191 |
+
* FAQ 60 Download older versions of Testimonials Widget
|
1192 |
+
* Premium feature update
|
1193 |
+
* Screenshot 20 added
|
1194 |
+
|
1195 |
+
= 2.7.13 =
|
1196 |
+
* Adapt for `mb_strcut` and `mb_strlen` alternatives
|
1197 |
+
* BUGFIX [Widget doesn't appear](http://wordpress.org/support/topic/widget-doesnt-appear-1)
|
1198 |
+
* Update POT
|
1199 |
+
|
1200 |
+
= 2.7.12 =
|
1201 |
+
* Change Aihrus support email to contact form
|
1202 |
+
* FAQ 1 Update - Thank you [aaaronscat](http://wordpress.org/support/topic/writing-php-to-display-rotating-widget-in-a-template) for the inspiration
|
1203 |
+
* Update Testimonials Widget Premium URL
|
1204 |
+
|
1205 |
+
= 2.7.11 =
|
1206 |
+
* Citation styling note
|
1207 |
+
* Removed sub-category shortcode example
|
1208 |
+
* Thanks to Joe Weber for asset header
|
1209 |
+
* Update premium URL
|
1210 |
+
* Update premium features
|
1211 |
+
* Update premium purchase URL
|
1212 |
+
|
1213 |
+
= 2.7.10 =
|
1214 |
+
* BUGFIX extra excerpt in single view
|
1215 |
+
* Screenshot 11 updated
|
1216 |
+
* Update premium features
|
1217 |
+
|
1218 |
+
= 2.7.9 =
|
1219 |
+
* Revise content truncation to respect HTML tags
|
1220 |
+
* Update premium description
|
1221 |
+
* Update premium features
|
1222 |
+
|
1223 |
+
= 2.7.8 =
|
1224 |
+
* Add `before` and `after` options to `paging`
|
1225 |
+
* FAQ 58 Specify testimonials per page or section
|
1226 |
+
* FAQ 59 Rotating widget show all testimonials than only one at a time
|
1227 |
+
* Revert on-demand CSS to always included
|
1228 |
+
* Support process and donation update
|
1229 |
+
* Thank you to [mkearns](http://wordpress.org/support/topic/just-excellent-3) for specifying a sub-category shortcode example
|
1230 |
+
* Update premium URL
|
1231 |
+
* Update premium features
|
1232 |
+
|
1233 |
+
= 2.7.7 =
|
1234 |
+
* FAQ 13 Update
|
1235 |
+
* FAQ 31 Update
|
1236 |
+
* Shortcode examples "[[" to "["
|
1237 |
+
|
1238 |
+
= 2.7.6 =
|
1239 |
+
* Add `[testimonialswidget_widget]` to Shortcodes column
|
1240 |
+
* CSS cite `margin-top` adjustment
|
1241 |
+
* Enable testimonials archive view
|
1242 |
+
* FAQ 1 Update
|
1243 |
+
* FAQ 52 Update
|
1244 |
+
* FAQ 53 Update
|
1245 |
+
* FAQ 55 Style page and instance testimonials
|
1246 |
+
* FAQ 56 Testimonials archive view URL
|
1247 |
+
* FAQ 57 Testimonial single view URL
|
1248 |
+
* Only include CSS if testimonials instance called
|
1249 |
+
* Screenshot 19 `[testimonialswidget_widget unique=true]` Show multiple testimonials in rotation
|
1250 |
+
* Set arg defaults via `defaults`
|
1251 |
+
|
1252 |
+
= 2.7.5 =
|
1253 |
+
* BUGFIX PHP Warning for new fields in widget when widget already exists
|
1254 |
+
* Exclude IDs option
|
1255 |
+
* Implement instance tracking
|
1256 |
+
* Protect shortcode examples
|
1257 |
+
* Update asset header size
|
1258 |
+
* Update premium features
|
1259 |
+
|
1260 |
+
= 2.7.4 =
|
1261 |
+
* Asset header help request
|
1262 |
+
* Premium feature updates
|
1263 |
+
* Screenshot 9 updated
|
1264 |
+
* Screenshot 10 replaced
|
1265 |
+
* Screenshot 11 updated
|
1266 |
+
* Screenshot 15 updated
|
1267 |
+
* Screenshot 17 Single `[testimonialswidget_list]` entry with and without 'Read more' link
|
1268 |
+
* Screenshot 18 `[testimonialswidgetpremium_count]` Examples
|
1269 |
+
|
1270 |
+
= 2.7.3 =
|
1271 |
+
* Apply quotes only around testimonial content
|
1272 |
+
* FAQ 13 update
|
1273 |
+
* FAQ 34 update
|
1274 |
+
* FAQ 35 update
|
1275 |
+
* Screenshot 8 replaced
|
1276 |
+
* Simplified quotes handling
|
1277 |
+
* Upgrade notification
|
1278 |
+
|
1279 |
+
= 2.7.2 =
|
1280 |
+
* FAQ 54 update
|
1281 |
+
* Screenshot 12 update
|
1282 |
+
* Screenshot 16 Edit testimonial with "Excerpt" and "Read More Link" fields - Testimonials Widget Premium plugin
|
1283 |
+
|
1284 |
+
= 2.7.1 =
|
1285 |
+
* Description update
|
1286 |
+
* FAQ 1 update
|
1287 |
+
* FAQ 2 update
|
1288 |
+
* FAQ 4 update
|
1289 |
+
* FAQ 5 update
|
1290 |
+
* FAQ 6 update
|
1291 |
+
* FAQ 7 update
|
1292 |
+
* FAQ 8 update
|
1293 |
+
* FAQ 9 update
|
1294 |
+
* FAQ 12 update
|
1295 |
+
* FAQ 14 update
|
1296 |
+
* FAQ 15 update
|
1297 |
+
* FAQ 17 update
|
1298 |
+
* FAQ 22 update
|
1299 |
+
* FAQ 25 update
|
1300 |
+
* FAQ 26 update
|
1301 |
+
* FAQ 30 update
|
1302 |
+
* FAQ 32 update
|
1303 |
+
* FAQ 34 update
|
1304 |
+
* FAQ 35 update
|
1305 |
+
* FAQ 37 update
|
1306 |
+
* FAQ 53 update
|
1307 |
+
* Feature update
|
1308 |
+
* Installation update
|
1309 |
+
* Screenshot 1 update
|
1310 |
+
* Screenshot 2 update
|
1311 |
+
* Screenshot 3 update
|
1312 |
+
* Screenshot 4 update
|
1313 |
+
* Screenshot 5 update
|
1314 |
+
* Screenshot 6 update
|
1315 |
+
* Screenshot 7 update
|
1316 |
+
* Screenshot 8 replaced
|
1317 |
+
* Screenshot 9 replaced
|
1318 |
+
* Screenshot 12 update
|
1319 |
+
* Screenshot 15 update
|
1320 |
+
* Screenshot 16 removed
|
1321 |
+
* Screenshot 17 removed
|
1322 |
+
* Screenshot 18 removed
|
1323 |
+
|
1324 |
+
= 2.7.0 =
|
1325 |
+
* FAQ 13 Update
|
1326 |
+
* FAQ 54 Release early. Release often.
|
1327 |
+
* Redo content opening and closing quotes display
|
1328 |
+
* Upgrade notification for 2.7.0
|
1329 |
+
|
1330 |
+
= 2.6.6 =
|
1331 |
+
* Remove CSS `overflow: auto` - too many complaints
|
1332 |
+
* FAQ 53 Scroll widget based testimonial content
|
1333 |
+
|
1334 |
+
= 2.6.5 =
|
1335 |
+
* BUGFIX: overflow auto than scroll
|
1336 |
+
* Correct screenshot 11 & 18
|
1337 |
+
|
1338 |
+
= 2.6.4 =
|
1339 |
+
* Add filters `testimonials_widget_posts_custom_column`, `testimonials_widget_columns`, `testimonials_widget_meta_box`
|
1340 |
+
* BUGFIX Testimonial posts page column URL now correctly clickable
|
1341 |
+
* Code spacing cleanup
|
1342 |
+
* Enabled [scrolling text](http://wordpress.org/support/topic/plugin-testimonials-widget-scroll-for-a-single-but-long-testimonial) for maximum height restricted testimonial widgets
|
1343 |
+
* FAQ 34/35 CSS styling update
|
1344 |
+
* Scrolling testimonials for maximum height restricted widgets
|
1345 |
+
* Testimonials have `get_post_class` applied
|
1346 |
+
* Update premium features
|
1347 |
+
|
1348 |
+
= 2.6.3 =
|
1349 |
+
* Add filter `testimonials_widget_query_args`
|
1350 |
+
* Add filters `testimonials_widget_testimonials_css`, `testimonials_widget_testimonials_js`
|
1351 |
+
* Allow `limit=-1`
|
1352 |
+
* BUGFIX Repeated footer CSS and JavaScript
|
1353 |
+
* CSS - block disply widget image
|
1354 |
+
* FAQ 52 Include testimonies in archive view
|
1355 |
+
* Refactor `get_query_args` out of `get_testimonials`
|
1356 |
+
* Revise JavaScript handling
|
1357 |
+
* Screenshot 17 `require_image`, `minimum_length` and `maximum_length` shortcode option examples
|
1358 |
+
* Screenshot 18 Widget with 'Next testimonial…' link
|
1359 |
+
* Update POT
|
1360 |
+
* Update premium features
|
1361 |
+
* Update premium screenshots
|
1362 |
+
|
1363 |
+
= 2.6.2 =
|
1364 |
+
* Compatible with WordPress 3.6
|
1365 |
+
* Fix single view PHP warning
|
1366 |
+
|
1367 |
+
= 2.6.1 =
|
1368 |
+
* Add filter `testimonials_widget_testimonial_html_single_content`
|
1369 |
+
* Add `force_pad` option to `testimonials_truncate`
|
1370 |
+
* Copyright year update
|
1371 |
+
* Update Premium features
|
1372 |
+
|
1373 |
+
= 2.6.0 =
|
1374 |
+
* Add FAQ 51 filter `testimonials_widget_get_testimonial_html` usage
|
1375 |
+
* FAQ 50 Revise
|
1376 |
+
* Reorganize `get_testimonial_html`
|
1377 |
+
|
1378 |
+
= 2.5.6 =
|
1379 |
+
* Add FAQ 50 Example to set widget gradient background color
|
1380 |
+
* FAQ 13 Update
|
1381 |
+
* FAQ 20 Add PHP tags
|
1382 |
+
* FAQ 48 Code correction
|
1383 |
+
* FAQ 49 Code correction
|
1384 |
+
|
1385 |
+
= 2.5.5 =
|
1386 |
+
* Enable widget caching
|
1387 |
+
* Refactor `get_testimonials_html` to break out CSS/JS generation
|
1388 |
+
* Respect [meta capabilities](http://wordpress.org/support/topic/plugin-testimonials-widget-version-20-rewrite-suggestions-request?replies=18#post-3359157)
|
1389 |
+
* Revise TODO text
|
1390 |
+
* TODO remove Template engine - see `testimonials_widget_testimonial_html*` filters
|
1391 |
+
|
1392 |
+
= 2.5.4 =
|
1393 |
+
* Add filter `testimonials_widget_testimonial_html_single`
|
1394 |
+
* Add filter `testimonials_widget_testimonial_html`
|
1395 |
+
* Aihrus testimonial URL correction
|
1396 |
+
* FAQ 34 Find `testimonialswidget_testimonialsNNN` instance naming
|
1397 |
+
* FAQ 48 Customize testimonial list/widget output
|
1398 |
+
* FAQ 49 Customize testimonial single output
|
1399 |
+
|
1400 |
+
= 2.5.3 =
|
1401 |
+
* Add donate link in plugin section
|
1402 |
+
* Donate links
|
1403 |
+
|
1404 |
+
= 2.5.2 =
|
1405 |
+
* Aihrus branding
|
1406 |
+
|
1407 |
+
= 2.5.1 =
|
1408 |
+
* Update POT file
|
1409 |
+
|
1410 |
+
= 2.5.0 =
|
1411 |
+
* Add option Keep whitespace? - Thank you [kangchenjunga](http://wordpress.org/support/topic/optional-wpautop-functionality-for-better-formatting?replies=2) for the suggestion
|
1412 |
+
* Revise FAQ 47
|
1413 |
+
* Screenshot 16 - Widget whitespace kept
|
1414 |
+
* Update Author URL
|
1415 |
+
|
1416 |
+
= 2.4.8 =
|
1417 |
+
* Donate to purchase verbiage change - One bad experience ruins it for all
|
1418 |
+
* FAQ 47 testimonials list in a widget
|
1419 |
+
* TODO Add location field
|
1420 |
+
* TODO Add plugin donate link
|
1421 |
+
* [CleanCSS](http://cleancss.com/) the CSS
|
1422 |
+
|
1423 |
+
= 2.4.7 =
|
1424 |
+
* Add filter `testimonials_widget_defaults_single`
|
1425 |
+
* TODO clean up for premium version
|
1426 |
+
* TODO Optional wpautop functionality for better formatting
|
1427 |
+
|
1428 |
+
= 2.4.6 =
|
1429 |
+
* Add 'No order' as an Order By widget option
|
1430 |
+
* Add FAQ 45 testimonial character limit
|
1431 |
+
* Add Recommendation heading
|
1432 |
+
* FAQ 23 mention 404
|
1433 |
+
* FAQ 46 testimonial ordering by given IDs
|
1434 |
+
* Update filters listing
|
1435 |
+
* Use `posts_results` filter to put posts in same orders as post__in when orderby=none
|
1436 |
+
|
1437 |
+
= 2.4.5 =
|
1438 |
+
* BUGFIX Missing CSS for testimonialswidget_join_title
|
1439 |
+
* FAQ 44 Refresh interval - Thank you [biztips](http://wordpress.org/support/topic/fatal-error-558?replies=6#post-3475595)
|
1440 |
+
|
1441 |
+
= 2.4.4 =
|
1442 |
+
* Add screenshot 15
|
1443 |
+
* FAQ 34 Update CSS
|
1444 |
+
* FAQ 35 Update CSS
|
1445 |
+
* FAQ 42 Exclude testimonial categories from Category widget
|
1446 |
+
* FAQ 43 Exclude testimonial categories from my sitemap
|
1447 |
+
* Update premium features
|
1448 |
+
|
1449 |
+
= 2.4.3 =
|
1450 |
+
* Adjust default `limit` to 10 from 25
|
1451 |
+
* Add CSS `margin-top` to `cite`, `.testimonialswidget_extra` and `.testimonialswidget_text`
|
1452 |
+
* BUGFIX [Keep `widget_text` with each testimonial](http://wordpress.org/support/topic/images-not-showin?replies=10)
|
1453 |
+
* Donate link update
|
1454 |
+
* FAQ 41 Widget height consistency
|
1455 |
+
|
1456 |
+
= 2.4.2 =
|
1457 |
+
* BUGFIX [No image](http://wordpress.org/support/topic/update-17?replies=4) in [widget](http://wordpress.org/support/topic/plugin-testimonials-widget-short-rotating-testimonial-link-to-the-full-testimonial?replies=16)
|
1458 |
+
* TODO Add refactor `get_testimonials_html`
|
1459 |
+
|
1460 |
+
= 2.4.1 =
|
1461 |
+
* BUGFIX `testimonialswidget_widget` always random
|
1462 |
+
* Comment and verbiage cleanups
|
1463 |
+
* Minor refactor of `get_testimonial_html`
|
1464 |
+
* TODO Added Template engine
|
1465 |
+
|
1466 |
+
= 2.4.0 =
|
1467 |
+
* FAQ 39 Style the custom widget text
|
1468 |
+
* FAQ 40 Page number pagination
|
1469 |
+
* FEATURE Custom widget text
|
1470 |
+
* FEATURE Make the widget title clickable
|
1471 |
+
* FEATURE Page numbers via WP-PageNavi
|
1472 |
+
* Refactor paging to use WordPress functions
|
1473 |
+
* SCREENSHOT 12 recrop
|
1474 |
+
* SCREENSHOT 13 Widget with clickable title and custom text/HTML on bottom
|
1475 |
+
* SCREENSHOT 14 WP-PageNavi compatible for page numbers than default arrows
|
1476 |
+
* SCREENSHOT 3 update
|
1477 |
+
* SCREENSHOT 4 update
|
1478 |
+
* TODO Remove Custom widget text - added
|
1479 |
+
* TODO Remove Make the widget title clickable - added
|
1480 |
+
* TODO Remove Page numbers - added
|
1481 |
+
* TODO Remove fields to show - done via theme
|
1482 |
+
|
1483 |
+
= 2.3.4 =
|
1484 |
+
* BUGFIX [Testimonial plugin means Set Feature Image Not Displaying](http://wordpress.org/support/topic/testimonial-plugin-means-set-feature-image-not-displaying)
|
1485 |
+
* Test with WordPress 3.5.0 RC1
|
1486 |
+
* TODO remove Publish & New - just click 'New Testimonial' after Publishing
|
1487 |
+
* Update donate link
|
1488 |
+
|
1489 |
+
= 2.3.3 =
|
1490 |
+
* FEATURE Improved single page view
|
1491 |
+
* SCREENSHOT Single testimonial view
|
1492 |
+
* TODO Meta capabilities
|
1493 |
+
|
1494 |
+
= 2.3.2 =
|
1495 |
+
* Add filters `testimonials_widget_options_update`, `testimonials_widget_options_form`
|
1496 |
+
* BUGFIX ["featured image" module disappeared](http://wordpress.org/support/topic/no-image-upload?replies=12#post-3423001)
|
1497 |
+
* Clean up tags per [plugin guidelines](http://wordpress.org/extend/plugins/about/guidelines/)
|
1498 |
+
* Combine source and url display when no email or company
|
1499 |
+
* FAQ renumber second 36 to 37
|
1500 |
+
* FAQ 38 Use filter `testimonials_widget_defaults`
|
1501 |
+
* FEATURE Centralized defaults via filter `testimonials_widget_defaults`
|
1502 |
+
* Only grab `paged` information once
|
1503 |
+
* Prepend HTTP protocol if missing in URL
|
1504 |
+
* SCREENSHOT Widget Premium Options
|
1505 |
+
* Simplify filter `testimonials_widget_content`
|
1506 |
+
* Simplify read more ellipsis
|
1507 |
+
* Trim content after formatting
|
1508 |
+
|
1509 |
+
= 2.3.1 =
|
1510 |
+
* BUGFIX [No image upload](http://wordpress.org/support/topic/no-image-upload)
|
1511 |
+
* FAQ 36 Why donate?
|
1512 |
+
|
1513 |
+
= 2.3.0 =
|
1514 |
+
* BUGFIX No paging when cached
|
1515 |
+
* FAQ 3 Check for empty $data
|
1516 |
+
* FAQ 33 Change more content ellipsis
|
1517 |
+
* FAQ 34/35 Clarify CSS classes
|
1518 |
+
* FAQ 36 Configure Next and Previous page indicators
|
1519 |
+
* FEATURE (Premium) [Read More links](http://wordpress.org/support/topic/plugin-testimonials-widget-short-rotating-testimonial-link-to-the-full-testimonial) to [full testimonial page](http://wordpress.org/support/topic/very-easy-to-use-moderately-easy-to-style)
|
1520 |
+
* FEATURE Easier to configure Next and Previous page indicators
|
1521 |
+
* Refactor `get_testimonial_html`
|
1522 |
+
* Refactor testimonial HTML creation methods
|
1523 |
+
* Remove "Read more…" preparations
|
1524 |
+
* Replace `testimonials_truncate` with WordPress's `wp_trim_words`
|
1525 |
+
* SCREENSHOTS 'Read more' links
|
1526 |
+
* Sanitize names
|
1527 |
+
* TEMP Prevent widget caching
|
1528 |
+
* TODO Clarify 'Read more'
|
1529 |
+
* TODO Remove - CSV Export
|
1530 |
+
* TODO Updates
|
1531 |
+
* Update POT file
|
1532 |
+
|
1533 |
+
= 2.2.9 =
|
1534 |
+
* BUGFIX [Testimonial List Loading 2nd Blank Box](http://wordpress.org/support/topic/testimonial-list-loading-2nd-blank-box)
|
1535 |
+
|
1536 |
+
= 2.2.8 =
|
1537 |
+
* Begin "Read more…" preparations
|
1538 |
+
* Correct content display processing
|
1539 |
+
* FAQ 32 Min-height usage
|
1540 |
+
* FAQ 4 Custom code placement clarification
|
1541 |
+
* TODO Updates
|
1542 |
+
* Widgets display content sans `wpautop` formatting
|
1543 |
+
|
1544 |
+
= 2.2.7 =
|
1545 |
+
* Catch widget number in cache
|
1546 |
+
* FAQ Custom query code. Thank you [tcwebguru](http://wordpress.org/support/topic/display-on-page-without-widget)
|
1547 |
+
* FAQ Change Testimonials Widget text labels
|
1548 |
+
* Language verbiage correction
|
1549 |
+
* PHP notice fix - esc_attr
|
1550 |
+
* Remove premium code include
|
1551 |
+
|
1552 |
+
= 2.2.6 =
|
1553 |
+
* BUGFIX Widget config not saving correctly
|
1554 |
+
* FAQ Export/import
|
1555 |
+
* TODO Updates
|
1556 |
+
|
1557 |
+
= 2.2.5 =
|
1558 |
+
* Adapt for [Testimonials Widget Premium plugin](http://aihr.us/wordpress/testimonials-widget-premium/)
|
1559 |
+
* Add support text
|
1560 |
+
* Correct verbiage spacing
|
1561 |
+
* Explain `limit`
|
1562 |
+
* TODO revisions
|
1563 |
+
|
1564 |
+
= 2.2.4 =
|
1565 |
+
* BUGFIX [Tags - no more than 2?](http://wordpress.org/support/topic/tags-no-more-than-2)
|
1566 |
+
* Clean up PHP notices
|
1567 |
+
* Fix Changelog link
|
1568 |
+
* PREMIUM Implement testimonials query and content caching
|
1569 |
+
* TODO update
|
1570 |
+
|
1571 |
+
= 2.2.3 =
|
1572 |
+
* Begin premium plugin adaptions
|
1573 |
+
* BUGFIX [Tags - no more than 2?](http://wordpress.org/support/topic/tags-no-more-than-2)
|
1574 |
+
* BUGFIX [Updated - Now getting fatal error when using testimonialswidget_list()](http://wordpress.org/support/topic/updated-now-getting-fatal-error-when-using-testimonialswidget_list)
|
1575 |
+
* Clean up links in readme.txt
|
1576 |
+
* Correct company and URL link usage
|
1577 |
+
* [Correct readme.txt to standard](http://wordpress.org/extend/plugins/about/readme.txt)
|
1578 |
+
* Don't rotate testimonial if only 1
|
1579 |
+
* TODO updates
|
1580 |
+
|
1581 |
+
= 2.2.2 =
|
1582 |
+
* BUGFIX [Now getting fatal error when using testimonialswidget_list()](http://wordpress.org/support/topic/updated-now-getting-fatal-error-when-using-testimonialswidget_list)
|
1583 |
+
* Theme function defaults
|
1584 |
+
* TODO updates
|
1585 |
+
* URL pointing update
|
1586 |
+
|
1587 |
+
= 2.2.1 =
|
1588 |
+
* Number FAQ Entries
|
1589 |
+
* Revise Installation Usage text
|
1590 |
+
* Revise Shortcode and Widget Options text
|
1591 |
+
|
1592 |
+
= 2.2.0 =
|
1593 |
+
* FAQ `testimonialswidget_widget()` example
|
1594 |
+
* Multisite compatible
|
1595 |
+
* Reversion as 2.1.10 was a minor release than only bug fixes
|
1596 |
+
|
1597 |
+
= 2.1.10 =
|
1598 |
+
* [Add title field ](http://wordpress.org/support/topic/plugin-testimonials-widget-just-tried-216-thoughts-suggestions)
|
1599 |
+
* Consolidate defaults to simplify code maintenance
|
1600 |
+
* Correct CSS testimonial list spacing
|
1601 |
+
* Debug true - clear out PHP notices and such
|
1602 |
+
* Default minimum height removed for widgets, now optional
|
1603 |
+
* Maximum height setting
|
1604 |
+
* [Remove CSS `position` attributes `.testimonialswidget_testimonial { position: absolute; }`](http://wordpress.org/support/topic/testimonials-widget-not-showing-correctly-on-sub-pages)
|
1605 |
+
* TODO cleanup
|
1606 |
+
* Update language POT
|
1607 |
+
* Update screenshots
|
1608 |
+
* Update WPML
|
1609 |
+
* Widget options dropdown for ORDER BY entries
|
1610 |
+
|
1611 |
+
= 2.1.9 =
|
1612 |
+
* Allow min_height 0
|
1613 |
+
* FAQ - How do I use the theme function `testimonialswidget_list()`?
|
1614 |
+
* Move CSS include to header
|
1615 |
+
|
1616 |
+
= 2.1.8 =
|
1617 |
+
* Remove testimonialswidget_widget char_limit default
|
1618 |
+
* TODO - debug true
|
1619 |
+
|
1620 |
+
= 2.1.7 =
|
1621 |
+
* [0 disables char_limit](http://wordpress.org/support/topic/plugin-testimonials-widget-more-than-one-testimonial-appears-overlaps-content-below-the-widget)
|
1622 |
+
* [Set link target](http://wordpress.org/support/topic/plugin-testimonials-widget-just-tried-216-thoughts-suggestions)
|
1623 |
+
* Update widget option top screenshot
|
1624 |
+
|
1625 |
+
= 2.1.6 =
|
1626 |
+
* FAQ: `ORDER BY` explanation
|
1627 |
+
* FAQ: `testimonial_extra` explanation
|
1628 |
+
* [Moved CSS to footer](http://wordpress.org/support/topic/plugin-testimonials-widget-html-validation)
|
1629 |
+
* Next testimonial link idea
|
1630 |
+
* Option: Add `hide_not_found` to prevent showing "No testimonials found"
|
1631 |
+
* Revise theme methods as functions
|
1632 |
+
* Screenshot: Update upper widget options
|
1633 |
+
* Staged widget testimonials are initially `display: none` via CSS `.testimonialswidget_display_none`
|
1634 |
+
* TODO updates
|
1635 |
+
* Verbiage: Refresh Interval to Rotation Speed
|
1636 |
+
* Widget option explanations
|
1637 |
+
|
1638 |
+
= 2.1.5 =
|
1639 |
+
* Always apply min-height
|
1640 |
+
|
1641 |
+
= 2.1.4 =
|
1642 |
+
* Enable WPML
|
1643 |
+
* Idea - Maximum height setting
|
1644 |
+
* Revise description
|
1645 |
+
* Revise TODO
|
1646 |
+
|
1647 |
+
= 2.1.3 =
|
1648 |
+
* Allow commas in meta_key
|
1649 |
+
* FAQ on page not found
|
1650 |
+
* Fix widget Random order always true condition
|
1651 |
+
* Increase bottom margin spacing for listed testimonials
|
1652 |
+
* TODO vote casting note
|
1653 |
+
* Update localization pot file
|
1654 |
+
|
1655 |
+
= 2.1.2 =
|
1656 |
+
* Add `hide_gravatar` option
|
1657 |
+
* Add apply_filters( 'testimonials_widget_data', $testimonial_data ) to process data before display
|
1658 |
+
* Add right margin to gravatar image
|
1659 |
+
* Added empty testimonial data field `testimonial_extra` for customization in testimonials
|
1660 |
+
* Allow widget and shortcode sorting by post meta values via `meta_key`
|
1661 |
+
* Correct PHP static accessors
|
1662 |
+
* Update FAQ
|
1663 |
+
* Update widget options screenshots
|
1664 |
+
* Working full testimonial URLs
|
1665 |
+
|
1666 |
+
= 2.1.1 =
|
1667 |
+
* Add [testimonialswidget_list] paging screenshot
|
1668 |
+
|
1669 |
+
= 2.1.0 =
|
1670 |
+
* Enable paging for [testimonialswidget_list] shortcode
|
1671 |
+
* Flush rewrite rules on activation
|
1672 |
+
* Disallow paging in widget and [testimonialswidget_widget] shortcode
|
1673 |
+
|
1674 |
+
= 2.0.6 =
|
1675 |
+
* Update shortcode option directions
|
1676 |
+
|
1677 |
+
= 2.0.5 =
|
1678 |
+
* Ignore already imported
|
1679 |
+
* Mark `testimonialswidget_widget() $number` argument as optional
|
1680 |
+
|
1681 |
+
= 2.0.4 =
|
1682 |
+
* Allow for 0 refresh_interval in get_testimonials_html
|
1683 |
+
|
1684 |
+
= 2.0.3 =
|
1685 |
+
* Allow for 0 refresh_interval in widget
|
1686 |
+
|
1687 |
+
= 2.0.2 =
|
1688 |
+
* BUGFIX [Warning: call_user_func_array() ??](http://wordpress.org/support/topic/plugin-testimonials-widget-warning-call_user_func_array)
|
1689 |
+
* Added Testimonials_Widget_Widget::get_testimonials_scripts for use with add_filter for wp_footer
|
1690 |
+
|
1691 |
+
= 2.0.1 =
|
1692 |
+
* Verbiage updates
|
1693 |
+
* Readme.txt validation
|
1694 |
+
* widget q p tag display inline
|
1695 |
+
* GPL2 licensing
|
1696 |
+
* Move upgrade notice text towards installation
|
1697 |
+
* Reorder screenshots
|
1698 |
+
* Apply 'the_content' filters directly to prevent plugin baggage
|
1699 |
+
* Update screenshot-7.png
|
1700 |
+
|
1701 |
+
= 2.0.0 =
|
1702 |
+
* Major rewrite
|
1703 |
+
* Add filters for image & gravatar sizes
|
1704 |
+
* Admin bar New > Testimonial
|
1705 |
+
* Authors and lower can manage their own testimonials
|
1706 |
+
* Auto-migration from old to new format upon install
|
1707 |
+
* Public > Published
|
1708 |
+
* Not public > Private
|
1709 |
+
* Categories - product, project, service
|
1710 |
+
* Clean up verbiage
|
1711 |
+
* Cleaner widget class
|
1712 |
+
* Custom columns list view
|
1713 |
+
* Image
|
1714 |
+
* Source
|
1715 |
+
* Shortcode
|
1716 |
+
* Email
|
1717 |
+
* Company
|
1718 |
+
* URL
|
1719 |
+
* Published by
|
1720 |
+
* Category
|
1721 |
+
* Tags
|
1722 |
+
* Date
|
1723 |
+
* Custom fields metabox
|
1724 |
+
* Email
|
1725 |
+
* Company
|
1726 |
+
* URL
|
1727 |
+
* Custom post-type
|
1728 |
+
* Default fields - source, email, company, URL
|
1729 |
+
* Editors and higher can manage all testimonials and edit testimonial publisher
|
1730 |
+
* Enable categories and tags
|
1731 |
+
* Enable full shortcode options in widget
|
1732 |
+
* Gravatar
|
1733 |
+
* HTML content allowed
|
1734 |
+
* Images
|
1735 |
+
* JavaScript in footer
|
1736 |
+
* Localization
|
1737 |
+
* Reference shortcode column
|
1738 |
+
* Reorganize widget options panel
|
1739 |
+
* Rotation JavaScript in footer than body
|
1740 |
+
* Shortcode options validation
|
1741 |
+
* WP_Query for get_testimonials()
|
1742 |
+
* Widget image on own line
|
1743 |
+
* Widget options
|
1744 |
+
* Title
|
1745 |
+
* Category filter
|
1746 |
+
* Tags filter
|
1747 |
+
* Require all tags
|
1748 |
+
* Advanced options
|
1749 |
+
* Hide image?
|
1750 |
+
* Hide source?
|
1751 |
+
* Hide email?
|
1752 |
+
* Hide company?
|
1753 |
+
* Hide URL?
|
1754 |
+
* Character limit
|
1755 |
+
* IDs filter
|
1756 |
+
* Limit
|
1757 |
+
* Maximum Height
|
1758 |
+
* Minimum Height
|
1759 |
+
* ORDER BY
|
1760 |
+
* ORDER BY Order
|
1761 |
+
* Random order
|
1762 |
+
* Rotation Speed
|
1763 |
+
* Move caching to ideas
|
1764 |
+
* Add theme function `testimonialswidget_widget()` doc
|
1765 |
+
* Update POT
|
1766 |
+
* [testimonialswidget_widget] shortcode
|
1767 |
+
* Match [testimonialswidget_widget] shortcode option defaults to widget
|
1768 |
+
* Update screenshots
|
1769 |
+
* Readd Minimum Height - need help getting around this
|
1770 |
|
1771 |
= 0.2.13 =
|
1772 |
* Clean up CSS
|
1821 |
= 2011-08-12: Version 0.1 =
|
1822 |
* initial release
|
1823 |
|
1824 |
+
|
1825 |
+
== Upgrade Notice ==
|
1826 |
+
|
1827 |
+
= 2.8.0 =
|
1828 |
+
* Deprecated
|
1829 |
+
* `hide_author` now `hide_source`
|
1830 |
+
* Removed filters `testimonials_widget_options_update`, `testimonials_widget_options_form`
|
1831 |
+
* Use `testimonials_widget_validate_settings` and `testimonials_widget_settings` instead
|
1832 |
+
* Renamed variable and related class `widget_text` to `bottom_text`
|
1833 |
+
|
1834 |
+
= 2.7.3 =
|
1835 |
+
* Quotes are no longer handled via `q`, `p:before`, or `p:after` CSS. It's handled via `.testimonialswidget_testimonial .testimonialswidget_open_quote:before` and `.testimonialswidget_testimonial .testimonialswidget_close_quote:after`
|
1836 |
+
* This change was made to keep consistency in how quotes were managed and to reduce the number of exception cases. In the end, this is simpler.
|
1837 |
+
|
1838 |
+
= 2.7.0 =
|
1839 |
+
* Quotes with `keep_whitespace=true` aren't applied via CSS `.testimonialswidget_testimonial q` tag anymore, but `.testimonialswidget_testimonial q p:first-child:before` and `.testimonialswidget_testimonial q p:last-child:after`
|
1840 |
+
* Widget testimonial `p` tags are no longer CSS `display: inline`, `display: block` as expected
|
1841 |
+
|
1842 |
+
= 2.4.1 =
|
1843 |
+
* Paging is on by default, except for widgets
|
1844 |
+
|
1845 |
+
= 2.0.0 =
|
1846 |
+
* CSS
|
1847 |
+
* Class `testimonialswidget_company` replaces `testimonialswidget_source`
|
1848 |
+
* Class `testimonialswidget_source` replaces `testimonialswidget_author`
|
1849 |
+
* The tighten widget display up, p tags within q are displayed inline.
|
1850 |
+
* JavaScript
|
1851 |
+
* The JavaScript for rotating testimonials is moved to the footer. As such, your theme requires `wp_footer()` in the footer.
|
1852 |
+
* Shortcode options
|
1853 |
+
* `hide_source` replaced by `hide_url`
|
1854 |
+
* `hide_author` replaced by `hide_source`
|
1855 |
+
* Testimonials
|
1856 |
+
* Migration from the old custom table to new custom post type is automatically done. Import might take a few moments to complete.
|
1857 |
+
* Company, URL and email details are attempted to be identified and placed properly based upon the original author and source fields. The company is "guessed" from the `author` field when there's a ", " or " of " context. If the `source` is an email, it's saved as such. Otherwise, it's assumed to be a URL.
|
1858 |
+
* Public testimonials are saved as Published. Non-public testimonials are marked as Private.
|
1859 |
+
* Widget options
|
1860 |
+
* "Show author" and "Show source" options are replaced by "Hide source" and "Hide URL" respectively. There's no backwards compatibility for these changes.
|
1861 |
+
* Default `min-height` is now 250px than 150px.
|
1862 |
+
|
1863 |
+
|
1864 |
== TODO ==
|
1865 |
+
|
1866 |
+
Is there something you want done? Write it up on the [support forums](http://wordpress.org/support/plugin/testimonials-widget) and then [donate](http://aihr.us/about-aihrus/donate/) or [send along](http://aihr.us/contact-aihrus/) an [awesome testimonial](http://aihr.us/about-aihrus/testimonials/).
|
1867 |
+
|
1868 |
+
* BUG [Post Types Order](http://wordpress.org/support/topic/random-order-doesnt-work) - sorting conflict
|
screenshot-1.png
CHANGED
Binary file
|
screenshot-10.png
ADDED
Binary file
|
screenshot-11.png
ADDED
Binary file
|
screenshot-12.png
ADDED
Binary file
|
screenshot-13.png
ADDED
Binary file
|
screenshot-14.png
ADDED
Binary file
|
screenshot-15.png
ADDED
Binary file
|
screenshot-16.png
ADDED
Binary file
|
screenshot-17.png
ADDED
Binary file
|
screenshot-18.png
ADDED
Binary file
|
screenshot-19.png
ADDED
Binary file
|
screenshot-2.png
CHANGED
Binary file
|
screenshot-20.png
ADDED
Binary file
|
screenshot-21.png
ADDED
Binary file
|
screenshot-22.png
ADDED
Binary file
|
screenshot-23.png
ADDED
Binary file
|
screenshot-24.png
ADDED
Binary file
|
screenshot-25.png
ADDED
Binary file
|
screenshot-26.png
ADDED
Binary file
|
screenshot-3.png
CHANGED
Binary file
|
screenshot-4.png
CHANGED
Binary file
|
screenshot-5.png
CHANGED
Binary file
|
screenshot-6.png
CHANGED
Binary file
|
screenshot-7.png
CHANGED
Binary file
|
screenshot-8.png
ADDED
Binary file
|
screenshot-9.png
ADDED
Binary file
|
testimonials-widget-admin.php
DELETED
@@ -1,514 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
function testimonialswidget_admin_menu()
|
4 |
-
{
|
5 |
-
global $testimonialswidget_admin_userlevel;
|
6 |
-
add_object_page('Testimonials Widget', 'Testimonials', $testimonialswidget_admin_userlevel, 'testimonials-widget', 'testimonialswidget_testimonials_management');
|
7 |
-
}
|
8 |
-
add_action('admin_menu', 'testimonialswidget_admin_menu');
|
9 |
-
|
10 |
-
|
11 |
-
function testimonialswidget_count($condition = "")
|
12 |
-
{
|
13 |
-
global $wpdb;
|
14 |
-
$sql = "SELECT COUNT(*) FROM " . $wpdb->prefix . "testimonialswidget ".$condition;
|
15 |
-
$count = $wpdb->get_var($sql);
|
16 |
-
return $count;
|
17 |
-
}
|
18 |
-
|
19 |
-
|
20 |
-
function testimonialswidget_pagenav($total, $current = 1, $format = 0, $paged = 'paged', $url = "")
|
21 |
-
{
|
22 |
-
if($total == 1 && $current == 1) return "";
|
23 |
-
|
24 |
-
if(!$url) {
|
25 |
-
$url = 'http';
|
26 |
-
if (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on") {$url .= "s";}
|
27 |
-
$url .= "://";
|
28 |
-
if ($_SERVER["SERVER_PORT"] != "80") {
|
29 |
-
$url .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["PHP_SELF"];
|
30 |
-
} else {
|
31 |
-
$url .= $_SERVER["SERVER_NAME"].$_SERVER["PHP_SELF"];
|
32 |
-
}
|
33 |
-
if($query_string = $_SERVER['QUERY_STRING']) {
|
34 |
-
$parms = explode('&', $query_string);
|
35 |
-
$y = '?';
|
36 |
-
foreach($parms as $parm) {
|
37 |
-
$x = explode('=', $parm);
|
38 |
-
if($x[0] == $paged) {
|
39 |
-
$query_string = str_replace($y.$parm, '', $query_string);
|
40 |
-
}
|
41 |
-
else $y = '&';
|
42 |
-
}
|
43 |
-
if($query_string) {
|
44 |
-
$url .= '?'.$query_string;
|
45 |
-
$a = '&';
|
46 |
-
}
|
47 |
-
else $a = '?';
|
48 |
-
}
|
49 |
-
else $a = '?';
|
50 |
-
}
|
51 |
-
else {
|
52 |
-
$a = '?';
|
53 |
-
if(strpos($url, '?')) $a = '&';
|
54 |
-
}
|
55 |
-
|
56 |
-
if(!$format || $format > 2 || $format < 0 || !is_numeric($format)) {
|
57 |
-
if($total <= 8) $format = 1;
|
58 |
-
else $format = 2;
|
59 |
-
}
|
60 |
-
|
61 |
-
|
62 |
-
if($current > $total) $current = $total;
|
63 |
-
$pagenav = "";
|
64 |
-
|
65 |
-
if($format == 2) {
|
66 |
-
$first_disabled = $prev_disabled = $next_disabled = $last_disabled = '';
|
67 |
-
if($current == 1)
|
68 |
-
$first_disabled = $prev_disabled = ' disabled';
|
69 |
-
if($current == $total)
|
70 |
-
$next_disabled = $last_disabled = ' disabled';
|
71 |
-
|
72 |
-
$pagenav .= "<a class=\"first-page{$first_disabled}\" title=\"".__('Go to the first page', 'testimonials-widget')."\" href=\"{$url}\">«</a> ";
|
73 |
-
$pagenav .= "<a class=\"prev-page{$prev_disabled}\" title=\"".__('Go to the previous page', 'testimonials-widget')."\" href=\"{$url}{$a}{$paged}=".($current - 1)."\">‹</a> ";
|
74 |
-
$pagenav .= '<span class="paging-input">'.$current.' of <span class="total-pages">'.$total.'</span></span>';
|
75 |
-
$pagenav .= " <a class=\"next-page{$next_disabled}\" title=\"".__('Go to the next page', 'testimonials-widget')."\" href=\"{$url}{$a}{$paged}=".($current + 1)."\">›</a>";
|
76 |
-
$pagenav .= " <a class=\"last-page{$last_disabled}\" title=\"".__('Go to the last page', 'testimonials-widget')."\" href=\"{$url}{$a}{$paged}={$total}\">»</a>";
|
77 |
-
|
78 |
-
}
|
79 |
-
else {
|
80 |
-
$pagenav = __("Goto page:", 'testimonials-widget');
|
81 |
-
for( $i = 1; $i <= $total; $i++ ) {
|
82 |
-
if($i == $current)
|
83 |
-
$pagenav .= " <strong>{$i}</strong>";
|
84 |
-
else if($i == 1)
|
85 |
-
$pagenav .= " <a href=\"{$url}\">{$i}</a>";
|
86 |
-
else
|
87 |
-
$pagenav .= " <a href=\"{$url}{$a}{$paged}={$i}\">{$i}</a>";
|
88 |
-
}
|
89 |
-
}
|
90 |
-
return $pagenav;
|
91 |
-
}
|
92 |
-
|
93 |
-
|
94 |
-
function testimonialswidget_addtestimonial($testimonial, $author = "", $source = "", $tags = "", $public = 'yes')
|
95 |
-
{
|
96 |
-
if(!$testimonial) return __('Nothing added to the database.', 'testimonials-widget');
|
97 |
-
global $wpdb;
|
98 |
-
$table_name = $wpdb->prefix . "testimonialswidget";
|
99 |
-
if($wpdb->get_var("SHOW TABLES LIKE '$table_name'") != $table_name)
|
100 |
-
return __('Database table not found', 'testimonials-widget');
|
101 |
-
else //Add the testimonial data to the database
|
102 |
-
{
|
103 |
-
$testimonial = trim( stripslashes($testimonial) );
|
104 |
-
$author = trim( stripslashes($author) );
|
105 |
-
$source = trim( stripslashes($source) );
|
106 |
-
$tags = trim( stripslashes($tags) );
|
107 |
-
|
108 |
-
$testimonial = "'".$wpdb->escape($testimonial)."'";
|
109 |
-
$author = $author?"'".$wpdb->escape($author)."'":"NULL";
|
110 |
-
$source = $source?"'".$wpdb->escape($source)."'":"NULL";
|
111 |
-
$tags = explode(',', $tags);
|
112 |
-
foreach ($tags as $key => $tag)
|
113 |
-
$tags[$key] = trim($tag);
|
114 |
-
$tags = implode(',', $tags);
|
115 |
-
$tags = $tags?"'".$wpdb->escape($tags)."'":"NULL";
|
116 |
-
if(!$public) $public = "'no'";
|
117 |
-
else $public = "'yes'";
|
118 |
-
$insert = "INSERT INTO " . $table_name .
|
119 |
-
"(testimonial, author, source, tags, public, time_added)" .
|
120 |
-
"VALUES ({$testimonial}, {$author}, {$source}, {$tags}, {$public}, NOW())";
|
121 |
-
$results = $wpdb->query( $insert );
|
122 |
-
if(FALSE === $results)
|
123 |
-
return __('There was an error in the MySQL query', 'testimonials-widget');
|
124 |
-
else
|
125 |
-
return __('Testimonial added', 'testimonials-widget');
|
126 |
-
}
|
127 |
-
}
|
128 |
-
|
129 |
-
function testimonialswidget_edittestimonial($testimonial_id, $testimonial, $author = "", $source = "", $tags = "", $public = 'yes')
|
130 |
-
{
|
131 |
-
if(!$testimonial) return __('Testimonial not updated.', 'testimonials-widget');
|
132 |
-
if(!$testimonial_id) return srgq_addtestimonial($testimonial, $author, $source, $public);
|
133 |
-
global $wpdb;
|
134 |
-
$table_name = $wpdb->prefix . "testimonialswidget";
|
135 |
-
if($wpdb->get_var("SHOW TABLES LIKE '$table_name'") != $table_name)
|
136 |
-
return __('Database table not found', 'testimonials-widget');
|
137 |
-
else //Update database
|
138 |
-
{
|
139 |
-
$testimonial = trim( stripslashes($testimonial) );
|
140 |
-
$author = trim( stripslashes($author) );
|
141 |
-
$source = trim( stripslashes($source) );
|
142 |
-
$tags = trim( stripslashes($tags) );
|
143 |
-
|
144 |
-
$testimonial = "'".$wpdb->escape($testimonial)."'";
|
145 |
-
$author = $author?"'".$wpdb->escape($author)."'":"NULL";
|
146 |
-
$source = $source?"'".$wpdb->escape($source)."'":"NULL";
|
147 |
-
$tags = explode(',', $tags);
|
148 |
-
foreach ($tags as $key => $tag)
|
149 |
-
$tags[$key] = trim($tag);
|
150 |
-
$tags = implode(',', $tags);
|
151 |
-
$tags = $tags?"'".$wpdb->escape($tags)."'":"NULL";
|
152 |
-
if(!$public) $public = "'no'";
|
153 |
-
else $public = "'yes'";
|
154 |
-
$update = "UPDATE " . $table_name . "
|
155 |
-
SET testimonial = {$testimonial},
|
156 |
-
author = {$author},
|
157 |
-
source = {$source},
|
158 |
-
tags = {$tags},
|
159 |
-
public = {$public},
|
160 |
-
time_updated = NOW()
|
161 |
-
WHERE testimonial_id = $testimonial_id";
|
162 |
-
$results = $wpdb->query( $update );
|
163 |
-
if(FALSE === $results)
|
164 |
-
return __('There was an error in the MySQL query', 'testimonials-widget');
|
165 |
-
else
|
166 |
-
return __('Changes saved', 'testimonials-widget');
|
167 |
-
}
|
168 |
-
}
|
169 |
-
|
170 |
-
|
171 |
-
function testimonialswidget_deletetestimonial($testimonial_id)
|
172 |
-
{
|
173 |
-
if($testimonial_id) {
|
174 |
-
global $wpdb;
|
175 |
-
$sql = "DELETE from " . $wpdb->prefix ."testimonialswidget" .
|
176 |
-
" WHERE testimonial_id = " . $testimonial_id;
|
177 |
-
if(FALSE === $wpdb->query($sql))
|
178 |
-
return __('There was an error in the MySQL query', 'testimonials-widget');
|
179 |
-
else
|
180 |
-
return __('Testimonial deleted', 'testimonials-widget');
|
181 |
-
}
|
182 |
-
else return __('The testimonial cannot be deleted', 'testimonials-widget');
|
183 |
-
}
|
184 |
-
|
185 |
-
function testimonialswidget_gettestimonialdata($testimonial_id)
|
186 |
-
{
|
187 |
-
global $wpdb;
|
188 |
-
$sql = "SELECT testimonial_id, testimonial, author, source, tags, public
|
189 |
-
FROM " . $wpdb->prefix . "testimonialswidget
|
190 |
-
WHERE testimonial_id = {$testimonial_id}";
|
191 |
-
$testimonial_data = $wpdb->get_row($sql, ARRAY_A);
|
192 |
-
return $testimonial_data;
|
193 |
-
}
|
194 |
-
|
195 |
-
function testimonialswidget_editform($testimonial_id = 0)
|
196 |
-
{
|
197 |
-
$public_selected = " checked=\"checked\"";
|
198 |
-
$submit_value = __('Add Testimonial', 'testimonials-widget');
|
199 |
-
$form_name = "addtestimonial";
|
200 |
-
$action_url = get_bloginfo('wpurl')."/wp-admin/admin.php?page=testimonials-widget#addnew";
|
201 |
-
$testimonial = $author = $source = $tags = $hidden_input = $back = "";
|
202 |
-
|
203 |
-
if($testimonial_id) {
|
204 |
-
$form_name = "edittestimonial";
|
205 |
-
$testimonial_data = testimonialswidget_gettestimonialdata($testimonial_id);
|
206 |
-
foreach($testimonial_data as $key => $value)
|
207 |
-
$testimonial_data[$key] = $testimonial_data[$key];
|
208 |
-
extract($testimonial_data);
|
209 |
-
$testimonial = htmlspecialchars($testimonial);
|
210 |
-
$author = htmlspecialchars($author);
|
211 |
-
$source = htmlspecialchars($source);
|
212 |
-
$tags = implode(', ', explode(',', $tags));
|
213 |
-
$hidden_input = "<input type=\"hidden\" name=\"testimonial_id\" value=\"{$testimonial_id}\" />";
|
214 |
-
if($public == 'no') $public_selected = "";
|
215 |
-
$submit_value = __('Save changes', 'testimonials-widget');
|
216 |
-
$back = "<input type=\"submit\" name=\"submit\" value=\"".__('Back', 'testimonials-widget')."\" /> ";
|
217 |
-
$action_url = get_bloginfo('wpurl')."/wp-admin/admin.php?page=testimonials-widget";
|
218 |
-
}
|
219 |
-
|
220 |
-
$testimonial_label = __('The testimonial', 'testimonials-widget');
|
221 |
-
$author_label = __('Author', 'testimonials-widget');
|
222 |
-
$source_label = __('Source', 'testimonials-widget');
|
223 |
-
$tags_label = __('Tags', 'testimonials-widget');
|
224 |
-
$public_label = __('Public?', 'testimonials-widget');
|
225 |
-
$optional_text = __('optional', 'testimonials-widget');
|
226 |
-
$url_text = __('email address or website URL', 'testimonials-widget');
|
227 |
-
$comma_separated_text = __('comma separated', 'testimonials-widget');
|
228 |
-
|
229 |
-
|
230 |
-
$display =<<< EDITFORM
|
231 |
-
<form name="{$form_name}" method="post" action="{$action_url}">
|
232 |
-
{$hidden_input}
|
233 |
-
<table class="form-table" cellpadding="5" cellspacing="2" width="100%">
|
234 |
-
<tbody><tr class="form-field form-required">
|
235 |
-
<th style="text-align:left;" scope="row" valign="top"><label for="testimonialswidget_testimonial">{$testimonial_label}</label></th>
|
236 |
-
<td><textarea id="testimonialswidget_testimonial" name="testimonial" rows="5" cols="50" style="width: 97%;">{$testimonial}</textarea></td>
|
237 |
-
</tr>
|
238 |
-
<tr class="form-field">
|
239 |
-
<th style="text-align:left;" scope="row" valign="top"><label for="testimonialswidget_author">{$author_label}</label></th>
|
240 |
-
<td><input type="text" id="testimonialswidget_author" name="author" size="40" value="{$author}" /><br />{$optional_text}</td>
|
241 |
-
</tr>
|
242 |
-
<tr class="form-field">
|
243 |
-
<th style="text-align:left;" scope="row" valign="top"><label for="testimonialswidget_source">{$source_label}</label></th>
|
244 |
-
<td><input type="text" id="testimonialswidget_source" name="source" size="40" value="{$source}" /><br />{$optional_text}, {$url_text}</td>
|
245 |
-
</tr>
|
246 |
-
<tr class="form-field">
|
247 |
-
<th style="text-align:left;" scope="row" valign="top"><label for="testimonialswidget_tags">{$tags_label}</label></th>
|
248 |
-
<td><input type="text" id="testimonialswidget_tags" name="tags" size="40" value="{$tags}" /><br />{$optional_text}, {$comma_separated_text}</small></td>
|
249 |
-
</tr>
|
250 |
-
<tr>
|
251 |
-
<th style="text-align:left;" scope="row" valign="top"><label for="testimonialswidget_public">{$public_label}</label></th>
|
252 |
-
<td><input type="checkbox" id="testimonialswidget_public" name="public"{$public_selected} />
|
253 |
-
</tr></tbody>
|
254 |
-
</table>
|
255 |
-
<p class="submit"><input name="submit" value="{$submit_value}" type="submit" class="button button-primary" />{$back}</p>
|
256 |
-
</form>
|
257 |
-
EDITFORM;
|
258 |
-
return $display;
|
259 |
-
}
|
260 |
-
|
261 |
-
function testimonialswidget_changevisibility($testimonial_ids, $public = 'yes')
|
262 |
-
{
|
263 |
-
if(!$testimonial_ids)
|
264 |
-
return __('Nothing done!', 'testimonials-widget');
|
265 |
-
global $wpdb;
|
266 |
-
$sql = "UPDATE ".$wpdb->prefix."testimonialswidget
|
267 |
-
SET public = '".$public."',
|
268 |
-
time_updated = NOW()
|
269 |
-
WHERE testimonial_id IN (".implode(', ', $testimonial_ids).")";
|
270 |
-
$wpdb->query($sql);
|
271 |
-
if($public == 'yes')
|
272 |
-
return __("Selected testimonials made public", 'testimonials-widget');
|
273 |
-
else
|
274 |
-
return __("Selected testimonials made private", 'testimonials-widget');
|
275 |
-
}
|
276 |
-
|
277 |
-
function testimonialswidget_bulkdelete($testimonial_ids)
|
278 |
-
{
|
279 |
-
if(!$testimonial_ids)
|
280 |
-
return __('Nothing done!', 'testimonials-widget');
|
281 |
-
global $wpdb;
|
282 |
-
$sql = "DELETE FROM ".$wpdb->prefix."testimonialswidget
|
283 |
-
WHERE testimonial_id IN (".implode(', ', $testimonial_ids).")";
|
284 |
-
$wpdb->query($sql);
|
285 |
-
return __('Testimonial(s) deleted', 'testimonials-widget');
|
286 |
-
}
|
287 |
-
|
288 |
-
|
289 |
-
function testimonialswidget_testimonials_management()
|
290 |
-
{
|
291 |
-
|
292 |
-
global $testimonialswidget_db_version;
|
293 |
-
$options = get_option('testimonialswidget');
|
294 |
-
$display = $msg = $testimonials_list = $alternate = "";
|
295 |
-
|
296 |
-
if($options['db_version'] != $testimonialswidget_db_version )
|
297 |
-
testimonialswidget_install();
|
298 |
-
|
299 |
-
if(isset($_REQUEST['submit'])) {
|
300 |
-
if($_REQUEST['submit'] == __('Add Testimonial', 'testimonials-widget')) {
|
301 |
-
extract($_REQUEST);
|
302 |
-
$msg = testimonialswidget_addtestimonial($testimonial, $author, $source, $tags, $public);
|
303 |
-
}
|
304 |
-
else if($_REQUEST['submit'] == __('Save changes', 'testimonials-widget')) {
|
305 |
-
extract($_REQUEST);
|
306 |
-
$msg = testimonialswidget_edittestimonial($testimonial_id, $testimonial, $author, $source, $tags, $public);
|
307 |
-
}
|
308 |
-
}
|
309 |
-
else if(isset($_REQUEST['action'])) {
|
310 |
-
if($_REQUEST['action'] == 'edittestimonial') {
|
311 |
-
$display .= "<div class=\"wrap\">\n<h2>Testimonials Widget » ".__('Edit testimonial', 'testimonials-widget')."</h2>";
|
312 |
-
$display .= testimonialswidget_editform($_REQUEST['id']);
|
313 |
-
$display .= "</div>";
|
314 |
-
echo $display;
|
315 |
-
return;
|
316 |
-
}
|
317 |
-
else if($_REQUEST['action'] == 'deltestimonial') {
|
318 |
-
$msg = testimonialswidget_deletetestimonial($_REQUEST['id']);
|
319 |
-
}
|
320 |
-
}
|
321 |
-
else if(isset($_REQUEST['bulkactionsubmit'])) {
|
322 |
-
if($_REQUEST['bulkaction'] == 'delete')
|
323 |
-
$msg = testimonialswidget_bulkdelete($_REQUEST['bulkcheck']);
|
324 |
-
if($_REQUEST['bulkaction'] == 'make_public') {
|
325 |
-
$msg = testimonialswidget_changevisibility($_REQUEST['bulkcheck'], 'yes');
|
326 |
-
}
|
327 |
-
if($_REQUEST['bulkaction'] == 'keep_private') {
|
328 |
-
$msg = testimonialswidget_changevisibility($_REQUEST['bulkcheck'], 'no');
|
329 |
-
}
|
330 |
-
}
|
331 |
-
|
332 |
-
$display .= "<div class=\"wrap\">";
|
333 |
-
|
334 |
-
if($msg)
|
335 |
-
$display .= "<div id=\"message\" class=\"updated fade\"><p>{$msg}</p></div>";
|
336 |
-
|
337 |
-
$display .= "<h2>Testimonials Widget <a href=\"#addnew\" class=\"add-new-h2\">".__('Add new testimonial', 'testimonials-widget')."</a></h2>";
|
338 |
-
|
339 |
-
$num_testimonials = testimonialswidget_count();
|
340 |
-
|
341 |
-
if(!$num_testimonials) {
|
342 |
-
$display .= "<p>".__('No testimonials in the database', 'testimonials-widget')."</p>";
|
343 |
-
|
344 |
-
$display .= "</div>";
|
345 |
-
|
346 |
-
$display .= "<div id=\"addnew\" class=\"wrap\">\n<h2>".__('Add new testimonial', 'testimonials-widget')."</h2>";
|
347 |
-
$display .= testimonialswidget_editform();
|
348 |
-
$display .= "</div>";
|
349 |
-
|
350 |
-
echo $display;
|
351 |
-
return;
|
352 |
-
}
|
353 |
-
|
354 |
-
global $wpdb;
|
355 |
-
|
356 |
-
$sql = "SELECT testimonial_id, testimonial, author, source, tags, public
|
357 |
-
FROM " . $wpdb->prefix . "testimonialswidget";
|
358 |
-
|
359 |
-
$option_selected = array (
|
360 |
-
'testimonial_id' => '',
|
361 |
-
'testimonial' => '',
|
362 |
-
'author' => '',
|
363 |
-
'source' => '',
|
364 |
-
'time_added' => '',
|
365 |
-
'time_updated' => '',
|
366 |
-
'public' => '',
|
367 |
-
'ASC' => '',
|
368 |
-
'DESC' => '',
|
369 |
-
);
|
370 |
-
if(isset($_REQUEST['orderby'])) {
|
371 |
-
$sql .= " ORDER BY " . $_REQUEST['orderby'] . " " . $_REQUEST['order'];
|
372 |
-
$option_selected[$_REQUEST['orderby']] = " selected=\"selected\"";
|
373 |
-
$option_selected[$_REQUEST['order']] = " selected=\"selected\"";
|
374 |
-
}
|
375 |
-
else {
|
376 |
-
$sql .= " ORDER BY testimonial_id DESC";
|
377 |
-
$option_selected['testimonial_id'] = " selected=\"selected\"";
|
378 |
-
$option_selected['DESC'] = " selected=\"selected\"";
|
379 |
-
}
|
380 |
-
|
381 |
-
if(isset($_REQUEST['paged']) && $_REQUEST['paged'] && is_numeric($_REQUEST['paged']))
|
382 |
-
$paged = $_REQUEST['paged'];
|
383 |
-
else
|
384 |
-
$paged = 1;
|
385 |
-
|
386 |
-
$limit_per_page = 20;
|
387 |
-
$total_pages = ceil($num_testimonials / $limit_per_page);
|
388 |
-
|
389 |
-
if($paged > $total_pages) $paged = $total_pages;
|
390 |
-
|
391 |
-
$admin_url = get_bloginfo('wpurl'). "/wp-admin/admin.php?page=testimonials-widget";
|
392 |
-
if(isset($_REQUEST['orderby']))
|
393 |
-
$admin_url .= "&orderby=".$_REQUEST['orderby']."&order=".$_REQUEST['order'];
|
394 |
-
|
395 |
-
$page_nav = testimonialswidget_pagenav($total_pages, $paged, 2, 'paged', $admin_url);
|
396 |
-
|
397 |
-
$start = ($paged - 1) * $limit_per_page;
|
398 |
-
|
399 |
-
$sql .= " LIMIT {$start}, {$limit_per_page}";
|
400 |
-
|
401 |
-
// Get all the testimonials from the database
|
402 |
-
$testimonials = $wpdb->get_results($sql);
|
403 |
-
|
404 |
-
foreach($testimonials as $testimonial_data) {
|
405 |
-
if($alternate) $alternate = "";
|
406 |
-
else $alternate = " class=\"alternate\"";
|
407 |
-
$testimonials_list .= "<tr{$alternate}>";
|
408 |
-
$testimonials_list .= "<th scope=\"row\" class=\"check-column\"><input type=\"checkbox\" name=\"bulkcheck[]\" value=\"".$testimonial_data->testimonial_id."\" /></th>";
|
409 |
-
$testimonials_list .= "<td>" . $testimonial_data->testimonial_id . "</td>";
|
410 |
-
$testimonials_list .= "<td>";
|
411 |
-
$testimonials_list .= wptexturize(nl2br(make_clickable($testimonial_data->testimonial)));
|
412 |
-
$testimonials_list .= "<div class=\"row-actions\"><span class=\"edit\"><a href=\"{$admin_url}&action=edittestimonial&id=".$testimonial_data->testimonial_id."\" class=\"edit\">".__('Edit', 'testimonials-widget')."</a></span> | <span class=\"trash\"><a href=\"{$admin_url}&action=deltestimonial&id=".$testimonial_data->testimonial_id."\" onclick=\"return confirm( '".__('Are you sure you want to delete this testimonial?', 'testimonials-widget')."');\" class=\"delete\">".__('Delete', 'testimonials-widget')."</a></span></div>";
|
413 |
-
$testimonials_list .= "</td>";
|
414 |
-
$testimonials_list .= "<td>" . make_clickable($testimonial_data->author);
|
415 |
-
if($testimonial_data->author && $testimonial_data->source)
|
416 |
-
$testimonials_list .= " / ";
|
417 |
-
$testimonials_list .= make_clickable($testimonial_data->source) ."</td>";
|
418 |
-
$testimonials_list .= "<td>" . implode(', ', explode(',', $testimonial_data->tags)) . "</td>";
|
419 |
-
if($testimonial_data->public == 'no') $public = __('No', 'testimonials-widget');
|
420 |
-
else $public = __('Yes', 'testimonials-widget');
|
421 |
-
$testimonials_list .= "<td>" . $public ."</td>";
|
422 |
-
$testimonials_list .= "</tr>";
|
423 |
-
}
|
424 |
-
|
425 |
-
if($testimonials_list) {
|
426 |
-
$testimonials_count = testimonialswidget_count();
|
427 |
-
|
428 |
-
$display .= "<form id=\"testimonialswidget\" method=\"post\" action=\"".get_bloginfo('wpurl')."/wp-admin/admin.php?page=testimonials-widget\">";
|
429 |
-
$display .= "<div class=\"tablenav\">";
|
430 |
-
$display .= "<div class=\"alignleft actions\">";
|
431 |
-
$display .= "<select name=\"bulkaction\">";
|
432 |
-
$display .= "<option value=\"0\">".__('Bulk Actions', 'testimonials-widget')."</option>";
|
433 |
-
$display .= "<option value=\"delete\">".__('Delete', 'testimonials-widget')."</option>";
|
434 |
-
$display .= "<option value=\"make_public\">".__('Make public', 'testimonials-widget')."</option>";
|
435 |
-
$display .= "<option value=\"keep_private\">".__('Keep private', 'testimonials-widget')."</option>";
|
436 |
-
$display .= "</select>";
|
437 |
-
$display .= "<input type=\"submit\" name=\"bulkactionsubmit\" value=\"".__('Apply', 'testimonials-widget')."\" class=\"button-secondary\" />";
|
438 |
-
$display .= " ";
|
439 |
-
$display .= __('Sort by: ', 'testimonials-widget');
|
440 |
-
$display .= "<select name=\"orderby\">";
|
441 |
-
$display .= "<option value=\"testimonial_id\"{$option_selected['testimonial_id']}>".__('Testimonial', 'testimonials-widget')." ID</option>";
|
442 |
-
$display .= "<option value=\"testimonial\"{$option_selected['testimonial']}>".__('Testimonial', 'testimonials-widget')."</option>";
|
443 |
-
$display .= "<option value=\"author\"{$option_selected['author']}>".__('Author', 'testimonials-widget')."</option>";
|
444 |
-
$display .= "<option value=\"source\"{$option_selected['source']}>".__('Source', 'testimonials-widget')."</option>";
|
445 |
-
$display .= "<option value=\"time_added\"{$option_selected['time_added']}>".__('Date added', 'testimonials-widget')."</option>";
|
446 |
-
$display .= "<option value=\"time_updated\"{$option_selected['time_updated']}>".__('Date updated', 'testimonials-widget')."</option>";
|
447 |
-
$display .= "<option value=\"public\"{$option_selected['public']}>".__('Visibility', 'testimonials-widget')."</option>";
|
448 |
-
$display .= "</select>";
|
449 |
-
$display .= "<select name=\"order\"><option{$option_selected['ASC']}>ASC</option><option{$option_selected['DESC']}>DESC</option></select>";
|
450 |
-
$display .= "<input type=\"submit\" name=\"orderbysubmit\" value=\"".__('Go', 'testimonials-widget')."\" class=\"button-secondary\" />";
|
451 |
-
$display .= "</div>";
|
452 |
-
$display .= '<div class="tablenav-pages"><span class="displaying-num">'.sprintf(_n('%d testimonials', '%d testimonials', $testimonials_count, 'testimonials-widget'), $testimonials_count).'</span><span class="pagination-links">'. $page_nav. "</span></div>";
|
453 |
-
$display .= "<div class=\"clear\"></div>";
|
454 |
-
$display .= "</div>";
|
455 |
-
|
456 |
-
$display .= "<table class=\"widefat\">";
|
457 |
-
$display .= "<thead><tr>
|
458 |
-
<th class=\"check-column\"><input type=\"checkbox\" onclick=\"testimonialswidget_checkAll(document.getElementById('testimonialswidget'));\" /></th>
|
459 |
-
<th>ID</th><th>".__('The testimonial', 'testimonials-widget')."</th>
|
460 |
-
<th>
|
461 |
-
".__('Author', 'testimonials-widget')." / ".__('Source', 'testimonials-widget')."
|
462 |
-
</th>
|
463 |
-
<th>".__('Tags', 'testimonials-widget')."</th>
|
464 |
-
<th>".__('Public?', 'testimonials-widget')."</th>
|
465 |
-
</tr></thead>";
|
466 |
-
$display .= "<tbody id=\"the-list\">{$testimonials_list}</tbody>";
|
467 |
-
$display .= "</table>";
|
468 |
-
|
469 |
-
$display .= "<div class=\"tablenav\">";
|
470 |
-
$display .= '<div class="tablenav-pages"><span class="displaying-num">'.sprintf(_n('%d testimonials', '%d testimonials', $testimonials_count, 'testimonials-widget'), $testimonials_count).'</span><span class="pagination-links">'. $page_nav. "</span></div>";
|
471 |
-
$display .= "<div class=\"clear\"></div>";
|
472 |
-
$display .= "</div>";
|
473 |
-
|
474 |
-
$display .= "</form>";
|
475 |
-
$display .= "<br style=\"clear:both;\" />";
|
476 |
-
|
477 |
-
}
|
478 |
-
else
|
479 |
-
$display .= "<p>".__('No testimonials in the database', 'testimonials-widget')."</p>";
|
480 |
-
|
481 |
-
$display .= "</div>";
|
482 |
-
|
483 |
-
$display .= "<div id=\"addnew\" class=\"wrap\">\n<h2>".__('Add new testimonial', 'testimonials-widget')."</h2>";
|
484 |
-
$display .= testimonialswidget_editform();
|
485 |
-
$display .= "</div>";
|
486 |
-
|
487 |
-
|
488 |
-
echo $display;
|
489 |
-
|
490 |
-
}
|
491 |
-
|
492 |
-
|
493 |
-
function testimonialswidget_admin_footer()
|
494 |
-
{
|
495 |
-
?>
|
496 |
-
<script type="text/javascript">
|
497 |
-
function testimonialswidget_checkAll(form) {
|
498 |
-
for (i = 0, n = form.elements.length; i < n; i++) {
|
499 |
-
if(form.elements[i].type == "checkbox" && !(form.elements[i].hasAttribute('onclick'))) {
|
500 |
-
if(form.elements[i].checked == true)
|
501 |
-
form.elements[i].checked = false;
|
502 |
-
else
|
503 |
-
form.elements[i].checked = true;
|
504 |
-
}
|
505 |
-
}
|
506 |
-
}
|
507 |
-
</script>
|
508 |
-
|
509 |
-
<?php
|
510 |
-
}
|
511 |
-
|
512 |
-
add_action('admin_footer', 'testimonialswidget_admin_footer');
|
513 |
-
|
514 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
testimonials-widget-widget.php
DELETED
@@ -1,130 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
3 |
-
* Add function to widgets_init that'll load our widget.
|
4 |
-
*/
|
5 |
-
add_action( 'widgets_init', 'testimonials_widgets' );
|
6 |
-
|
7 |
-
/*
|
8 |
-
* Register widget.
|
9 |
-
*/
|
10 |
-
function testimonials_widgets() {
|
11 |
-
register_widget( 'Testimonials_Widget' );
|
12 |
-
load_plugin_textdomain( 'testimonials-widget', null, '/testimonials-widget/languages/' );
|
13 |
-
}
|
14 |
-
|
15 |
-
/*
|
16 |
-
* Widget class.
|
17 |
-
*/
|
18 |
-
class testimonials_widget extends WP_Widget {
|
19 |
-
/* ---------------------------- */
|
20 |
-
/* -------- Widget setup -------- */
|
21 |
-
/* ---------------------------- */
|
22 |
-
function Testimonials_Widget() {
|
23 |
-
/* Widget settings. */
|
24 |
-
$widget_ops = array( 'classname' => 'testimonials_widget', 'description' => __('Testimonial widget plugin allows you display testimonials in a sidebar on your WordPress blog.', 'testimonials-widget') );
|
25 |
-
|
26 |
-
/* Widget control settings. */
|
27 |
-
$control_ops = array( 'width' => 250, 'height' => 350, 'id_base' => 'testimonials_widget' );
|
28 |
-
|
29 |
-
/* Create the widget. */
|
30 |
-
$this->WP_Widget( 'testimonials_widget', __('Testimonials Widget', 'testimonials-widget'), $widget_ops, $control_ops );
|
31 |
-
}
|
32 |
-
|
33 |
-
/* ---------------------------- */
|
34 |
-
/* ------- Display Widget -------- */
|
35 |
-
/* ---------------------------- */
|
36 |
-
function widget( $args, $instance ) {
|
37 |
-
extract( $args );
|
38 |
-
|
39 |
-
/* Our variables from the widget settings. */
|
40 |
-
$title = apply_filters('widget_title', $instance['title'], null);
|
41 |
-
|
42 |
-
$testimonials = testimonialswidget_display_testimonials( $instance, $this->number );
|
43 |
-
|
44 |
-
/* Before widget (defined by themes). */
|
45 |
-
echo $before_widget;
|
46 |
-
|
47 |
-
/* Display the widget title if one was input (before and after defined by themes). */
|
48 |
-
if ( $title )
|
49 |
-
echo $before_title . $title . $after_title;
|
50 |
-
|
51 |
-
/* Display Widget */
|
52 |
-
echo $testimonials;
|
53 |
-
|
54 |
-
/* After widget (defined by themes). */
|
55 |
-
echo $after_widget;
|
56 |
-
}
|
57 |
-
|
58 |
-
/* ---------------------------- */
|
59 |
-
/* ------- Update Widget -------- */
|
60 |
-
/* ---------------------------- */
|
61 |
-
function update( $new_instance, $old_instance ) {
|
62 |
-
$instance = $old_instance;
|
63 |
-
|
64 |
-
$instance['title'] = wp_kses_data($new_instance['title']);
|
65 |
-
$instance['min_height'] = intval($new_instance['min_height']);
|
66 |
-
$instance['show_author'] = (isset($new_instance['show_author']) && $new_instance['show_author']) ? true : false;
|
67 |
-
$instance['show_source'] = (isset($new_instance['show_source']) && $new_instance['show_source']) ? true : false;
|
68 |
-
$instance['refresh_interval'] = intval($new_instance['refresh_interval']);
|
69 |
-
$instance['random_order'] = (isset($new_instance['random_order']) && $new_instance['random_order']) ? true : false;
|
70 |
-
$instance['tags_all'] = (isset($new_instance['tags_all']) && $new_instance['tags_all'])?1:0;
|
71 |
-
$instance['tags'] = wp_filter_nohtml_kses($new_instance['tags']);
|
72 |
-
$instance['char_limit'] = intval($new_instance['char_limit']);
|
73 |
-
$instance['limit'] = intval($new_instance['limit']);
|
74 |
-
|
75 |
-
return $instance;
|
76 |
-
}
|
77 |
-
|
78 |
-
/* ---------------------------- */
|
79 |
-
/* ------- Widget Settings ------- */
|
80 |
-
/* ---------------------------- */
|
81 |
-
|
82 |
-
/**
|
83 |
-
* Displays the widget settings controls on the widget panel.
|
84 |
-
* Make use of the get_field_id() and get_field_name() function
|
85 |
-
* when creating your form elements. This handles the confusing stuff.
|
86 |
-
*/
|
87 |
-
function form( $instance ) {
|
88 |
-
/* Set up some default widget settings. */
|
89 |
-
$defaults = array(
|
90 |
-
'title' => __('Testimonials', 'testimonials-widget'),
|
91 |
-
'min_height' => 150,
|
92 |
-
'show_author' => 1,
|
93 |
-
'show_source' => 1,
|
94 |
-
'random_order' => 1,
|
95 |
-
'tags_all' => 0,
|
96 |
-
'refresh_interval' => 10,
|
97 |
-
'tags' => '',
|
98 |
-
'char_limit' => 500,
|
99 |
-
'limit' => 10
|
100 |
-
);
|
101 |
-
$instance = wp_parse_args( (array) $instance, $defaults );
|
102 |
-
|
103 |
-
// Now we define the display of widget options menu
|
104 |
-
$show_author_checked = $show_source_checked = $random_order_checked = $tags_all_checked = '';
|
105 |
-
|
106 |
-
if($instance['show_author'])
|
107 |
-
$show_author_checked = ' checked="checked"';
|
108 |
-
if($instance['show_source'])
|
109 |
-
$show_source_checked = ' checked="checked"';
|
110 |
-
if($instance['random_order'])
|
111 |
-
$random_order_checked = ' checked="checked"';
|
112 |
-
if($instance['tags_all'])
|
113 |
-
$tags_all_checked = ' checked="checked"';
|
114 |
-
|
115 |
-
echo '<p><label for="'.$this->get_field_id( 'title' ).'">'.__('Title', 'testimonials-widget').' </label><input class="widefat" type="text" id="'.$this->get_field_id( 'title' ).'" name="'.$this->get_field_name( 'title' ).'" value="'.htmlspecialchars($instance['title'], ENT_QUOTES).'" /></p>';
|
116 |
-
echo '<p><label for="'.$this->get_field_id( 'min_height' ).'">'.__('Minimum Height', 'testimonials-widget').' </label><input class="widefat" type="text" id="'.$this->get_field_id( 'min_height' ).'" name="'.$this->get_field_name( 'min_height' ).'" value="'.htmlspecialchars($instance['min_height'], ENT_QUOTES).'" /><br/><span class="setting-description"><small>'.__('Minimum height in px, this must be set to a value that suits your logest testimonial (increase this value if you find that your testimonials are getting cut off).', 'testimonials-widget').'</small></span></p>';
|
117 |
-
echo '<p><input type="checkbox" id="'.$this->get_field_id( 'show_author' ).'" name="'.$this->get_field_name( 'show_author' ).'" value="1"'.$show_author_checked.' /> <label for="'.$this->get_field_id( 'show_author' ).'">'.__('Show author?', 'testimonials-widget').'</label></p>';
|
118 |
-
echo '<p><input type="checkbox" id="'.$this->get_field_id( 'show_source' ).'" name="'.$this->get_field_name( 'show_source' ).'" value="1"'.$show_source_checked.' /> <label for="'.$this->get_field_id( 'show_source' ).'">'.__('Show source?', 'testimonials-widget').'</label></p>';
|
119 |
-
echo "<p style=\"text-align:left;\"><small><a id=\"".$this->get_field_id( 'adv_key' )."\" style=\"cursor:pointer;\" onclick=\"jQuery('div#".$this->get_field_id( 'adv_opts' )."').slideToggle();\">".__('Advanced options', 'testimonials-widget')." »</a></small></p>";
|
120 |
-
echo '<div id="'.$this->get_field_id( 'adv_opts' ).'" style="display:none">';
|
121 |
-
echo '<p><label for="'.$this->get_field_id( 'refresh_interval' ).'">'.__('Refresh Interval', 'testimonials-widget').' </label><input class="widefat" type="text" id="'.$this->get_field_id( 'refresh_interval' ).'" name="'.$this->get_field_name( 'refresh_interval' ).'" value="'.htmlspecialchars($instance['refresh_interval'], ENT_QUOTES).'" /><br/><span class="setting-description"><small>'.__('In seconds or 0 for no refresh.', 'testimonials-widget').'</small></span></p>';
|
122 |
-
echo '<p><input type="checkbox" id="'.$this->get_field_id( 'random_order' ).'" name="'.$this->get_field_name( 'random_order' ).'" value="1"'.$random_order_checked.' /> <label for="'.$this->get_field_id( 'random_order' ).'">'.__('Random order', 'testimonials-widget').'</label><br/><span class="setting-description"><small>'.__('Unchecking this will rotate testimonials in the order added, latest first.', 'testimonials-widget').'</small></span></p>';
|
123 |
-
echo '<p><label for="'.$this->get_field_id( 'tags' ).'">'.__('Tags filter', 'testimonials-widget').' </label><input class="widefat" type="text" id="'.$this->get_field_id( 'tags' ).'" name="'.$this->get_field_name( 'tags' ).'" value="'.htmlspecialchars($instance['tags'], ENT_QUOTES).'" /><br/><span class="setting-description"><small>'.__('Comma separated', 'testimonials-widget').'</small></span></p>';
|
124 |
-
echo '<p><input type="checkbox" id="'.$this->get_field_id( 'tags_all' ).'" name="'.$this->get_field_name( 'tags_all' ).'" value="1"'.$tags_all_checked.' /> <label for="'.$this->get_field_id( 'tags_all' ).'">'.__('Require all tags', 'testimonials-widget').'</label><br/><span class="setting-description"><small>'.__('Checking this will select only testimonials with all of the given tags.', 'testimonials-widget').'</small></span></p>';
|
125 |
-
echo '<p><label for="'.$this->get_field_id( 'char_limit' ).'">'.__('Character limit', 'testimonials-widget').' </label><input class="widefat" type="text" id="'.$this->get_field_id( 'char_limit' ).'" name="'.$this->get_field_name( 'char_limit' ).'" value="'.htmlspecialchars($instance['char_limit'], ENT_QUOTES).'" /><br/><span class="setting-description"><small>'.__('Number of characters to limit testimonial views to. Zero means no limit', 'testimonials-widget').'</small></span></p>';
|
126 |
-
echo '<p><label for="'.$this->get_field_id( 'limit' ).'">'.__('Limit', 'testimonials-widget').' </label><input class="widefat" type="text" id="'.$this->get_field_id( 'limit' ).'" name="'.$this->get_field_name( 'limit' ).'" value="'.htmlspecialchars($instance['limit'], ENT_QUOTES).'" /><br/><span class="setting-description"><small>'.__('Number of testimonials to pull at a time. Zero means no limit', 'testimonials-widget').'</small></span></p>';
|
127 |
-
echo '</div>';
|
128 |
-
}
|
129 |
-
}
|
130 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
testimonials-widget.css
CHANGED
@@ -1,57 +1,107 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
}
|
4 |
-
|
5 |
-
.testimonialswidget_testimonials {
|
6 |
-
/* quotes wrapper */
|
7 |
-
position: relative;
|
8 |
}
|
9 |
|
10 |
.testimonialswidget_testimonials .testimonialswidget_active {
|
11 |
-
/* active
|
12 |
display: block;
|
13 |
}
|
14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
.testimonialswidget_testimonial {
|
|
|
16 |
display: none;
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
}
|
23 |
|
24 |
.testimonialswidget_testimonial q {
|
25 |
-
/* the
|
26 |
-
/* Remove quotes by uncommenting the following */
|
27 |
-
/*
|
28 |
quotes: none;
|
29 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
}
|
31 |
|
32 |
.testimonialswidget_testimonial cite {
|
33 |
-
/* outer wrapper for
|
34 |
-
display: block; /* To display
|
35 |
-
|
|
|
36 |
}
|
37 |
|
38 |
-
.
|
39 |
-
|
40 |
-
font-style: normal;
|
41 |
}
|
42 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
.testimonialswidget_testimonial .testimonialswidget_join {
|
|
|
|
|
|
|
|
|
|
|
44 |
/* join text */
|
|
|
45 |
}
|
46 |
|
47 |
-
.testimonialswidget_testimonial .
|
48 |
-
|
49 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
}
|
51 |
|
52 |
-
.testimonialswidget_testimonial_list {
|
53 |
display: block;
|
54 |
-
|
55 |
-
position: relative;
|
56 |
-
top: initial;
|
57 |
}
|
1 |
+
.testimonialswidget_testimonials {
|
2 |
+
/* testimonials wrapper */
|
|
|
|
|
|
|
|
|
|
|
3 |
}
|
4 |
|
5 |
.testimonialswidget_testimonials .testimonialswidget_active {
|
6 |
+
/* active testimonials */
|
7 |
display: block;
|
8 |
}
|
9 |
|
10 |
+
.testimonialswidget_testimonials .testimonialswidget_display_none {
|
11 |
+
/* staged testimonials */
|
12 |
+
display: none;
|
13 |
+
}
|
14 |
+
|
15 |
+
.testimonialswidget_paging {
|
16 |
+
clear: both;
|
17 |
+
font-weight: 700;
|
18 |
+
height: 1.4em;
|
19 |
+
}
|
20 |
+
|
21 |
.testimonialswidget_testimonial {
|
22 |
+
clear: left;
|
23 |
display: none;
|
24 |
+
margin: 0 0 1.4em;
|
25 |
+
}
|
26 |
+
|
27 |
+
.testimonialswidget_testimonial .testimonialswidget_image {
|
28 |
+
float: left;
|
29 |
+
margin-bottom: .4em;
|
30 |
+
margin-right: .2em;
|
31 |
+
}
|
32 |
+
|
33 |
+
.widget .testimonialswidget_testimonial .testimonialswidget_image {
|
34 |
+
display: block;
|
35 |
+
float: initial;
|
36 |
}
|
37 |
|
38 |
.testimonialswidget_testimonial q {
|
39 |
+
/* the testimonial itself */
|
|
|
|
|
40 |
quotes: none;
|
41 |
+
}
|
42 |
+
|
43 |
+
.testimonialswidget_testimonial .testimonialswidget_open_quote:before {
|
44 |
+
content: '\201C';
|
45 |
+
}
|
46 |
+
|
47 |
+
.testimonialswidget_testimonial .testimonialswidget_close_quote:after {
|
48 |
+
content: '\201D';
|
49 |
}
|
50 |
|
51 |
.testimonialswidget_testimonial cite {
|
52 |
+
/* outer wrapper for source & company */
|
53 |
+
display: block; /* To display source and company on a new line */
|
54 |
+
margin-top: .2em;
|
55 |
+
text-align: right;
|
56 |
}
|
57 |
|
58 |
+
.widget .testimonialswidget_testimonial cite {
|
59 |
+
margin-top: .8em;
|
|
|
60 |
}
|
61 |
|
62 |
+
.widget .testimonialswidget_testimonial .testimonialswidget_whitespace cite,
|
63 |
+
.widget .testimonialswidget_whitespace cite {
|
64 |
+
margin-top: .2em;
|
65 |
+
}
|
66 |
+
|
67 |
+
.testimonialswidget_testimonial cite:before {
|
68 |
+
content: "– "
|
69 |
+
}
|
70 |
+
|
71 |
+
.testimonialswidget_testimonial .testimonialswidget_source {
|
72 |
+
/* testimonial source */
|
73 |
+
}
|
74 |
+
|
75 |
+
.testimonialswidget_testimonial .testimonialswidget_join_title,
|
76 |
.testimonialswidget_testimonial .testimonialswidget_join {
|
77 |
+
/* section between source and company information */
|
78 |
+
}
|
79 |
+
|
80 |
+
.testimonialswidget_testimonial .testimonialswidget_join_title:before,
|
81 |
+
.testimonialswidget_testimonial .testimonialswidget_join:before {
|
82 |
/* join text */
|
83 |
+
content: ", "
|
84 |
}
|
85 |
|
86 |
+
.testimonialswidget_testimonial .testimonialswidget_title,
|
87 |
+
.testimonialswidget_testimonial .testimonialswidget_company,
|
88 |
+
.testimonialswidget_testimonial .testimonialswidget_url {
|
89 |
+
/* testimonial title, company and url informaiton */
|
90 |
+
}
|
91 |
+
|
92 |
+
.testimonialswidget_testimonial .testimonialswidget_extra {
|
93 |
+
margin-top: .8em;
|
94 |
+
}
|
95 |
+
|
96 |
+
.testimonialswidget_testimonial .testimonialswidget_bottom_text {
|
97 |
+
margin-top: 1.4em;
|
98 |
+
}
|
99 |
+
|
100 |
+
.testimonialswidget_testimonials_list {
|
101 |
+
/* testimonials list wrapper */
|
102 |
}
|
103 |
|
104 |
+
.testimonialswidget_testimonial_list {
|
105 |
display: block;
|
106 |
+
margin-bottom: 1.4em;
|
|
|
|
|
107 |
}
|
testimonials-widget.php
CHANGED
@@ -1,353 +1,1329 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
-
Plugin Name: Testimonials Widget
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
Author
|
8 |
-
|
|
|
9 |
*/
|
10 |
|
11 |
-
/*
|
|
|
12 |
|
13 |
This program is free software; you can redistribute it and/or modify
|
14 |
-
it under the terms of the GNU General Public License
|
15 |
-
the Free Software Foundation
|
16 |
-
(at your option) any later version.
|
17 |
|
18 |
This program is distributed in the hope that it will be useful,
|
19 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
20 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
21 |
GNU General Public License for more details.
|
22 |
|
23 |
You should have received a copy of the GNU General Public License
|
24 |
along with this program; if not, write to the Free Software
|
25 |
-
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
26 |
*/
|
27 |
|
28 |
-
/* This plugin borrows code from the Quotes Collection plugin by Srini G
|
29 |
-
http://srinig.com/wordpress/plugins/quotes-collection/
|
30 |
|
31 |
-
|
32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
|
|
|
|
|
34 |
|
35 |
-
/* Refer http://codex.wordpress.org/Roles_and_Capabilities#Capability_vs._Role_Table */
|
36 |
-
// Super Admin
|
37 |
-
// $testimonialswidget_admin_userlevel = 'manage_network';
|
38 |
|
39 |
-
|
40 |
-
|
|
|
41 |
|
42 |
-
|
43 |
-
|
|
|
44 |
|
45 |
-
|
46 |
-
|
|
|
|
|
|
|
47 |
|
48 |
-
// Contributor
|
49 |
-
// $testimonialswidget_admin_userlevel = 'edit_posts';
|
50 |
|
51 |
-
|
|
|
|
|
52 |
|
53 |
|
54 |
-
|
55 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
|
57 |
|
58 |
-
function
|
59 |
-
|
60 |
|
61 |
-
|
|
|
|
|
62 |
|
63 |
-
|
64 |
-
|
65 |
-
$
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
}
|
74 |
}
|
75 |
-
$tag_conditions .= "FIND_IN_SET('{$tag}', tags)";
|
76 |
}
|
77 |
-
$conditions .= " AND ({$tag_conditions})";
|
78 |
-
}
|
79 |
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
$conditions .= " ORDER BY testimonial_id DESC";
|
84 |
}
|
85 |
|
86 |
-
if ( $limit )
|
87 |
-
$conditions .= " LIMIT {$limit}";
|
88 |
|
89 |
-
|
90 |
-
$
|
91 |
|
92 |
-
|
|
|
|
|
93 |
|
94 |
-
|
95 |
-
$id = 'testimonialswidget_testimonials';
|
96 |
-
$id_base = $id . $widget_number;
|
97 |
-
$html = <<<EOF
|
98 |
-
<style>
|
99 |
-
.$id_base {
|
100 |
-
min-height: $min_height;
|
101 |
}
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
$
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
}
|
|
|
117 |
}
|
118 |
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
</script>
|
124 |
-
EOF;
|
125 |
}
|
126 |
|
127 |
-
$html .= '<div class="'.$id.' '.$id_base.'">';
|
128 |
-
$first = true;
|
129 |
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
134 |
}
|
135 |
|
136 |
-
|
137 |
-
|
138 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
139 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
140 |
|
141 |
-
if (
|
142 |
-
$
|
|
|
|
|
143 |
} else {
|
144 |
-
$
|
145 |
-
$first = false;
|
146 |
}
|
147 |
-
$html .= "<q>". make_clickable( $testimonial['testimonial'] ) ."</q>";
|
148 |
-
$cite = '';
|
149 |
-
if($show_author && ! empty( $testimonial['author'] ) )
|
150 |
-
$cite = '<span class="testimonialswidget_author">'. make_clickable( $testimonial['author'] ) .'</span>';
|
151 |
|
152 |
-
|
153 |
-
|
154 |
-
|
|
|
|
|
|
|
|
|
|
|
155 |
}
|
156 |
-
if($cite) $cite = " <cite>— {$cite}</cite>";
|
157 |
-
$html .= $cite."</div>";
|
158 |
|
|
|
159 |
}
|
160 |
-
$html .= '</div>';
|
161 |
|
162 |
-
return $html;
|
163 |
-
}
|
164 |
|
|
|
|
|
|
|
165 |
|
166 |
-
|
167 |
-
|
168 |
-
$sql = "SELECT testimonial_id, testimonial, author, source, tags, public
|
169 |
-
FROM " . $wpdb->prefix . "testimonialswidget"
|
170 |
-
. $conditions;
|
171 |
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
return array();
|
176 |
-
}
|
177 |
|
|
|
|
|
178 |
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
|
183 |
-
|
184 |
-
$db_charset = 'utf8';
|
185 |
-
$db_charset = "CHARACTER SET ".$db_charset;
|
186 |
-
if(defined('DB_COLLATE') && $db_collate = DB_COLLATE)
|
187 |
-
$db_collate = "COLLATE ".$db_collate;
|
188 |
|
189 |
-
|
190 |
-
if($wpdb->get_var("SHOW TABLES LIKE '$table_name'") == $table_name) {
|
191 |
-
$wpdb->query("ALTER TABLE `{$table_name}` {$db_charset} {$db_collate}");
|
192 |
|
193 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
194 |
|
195 |
-
|
|
|
|
|
|
|
196 |
|
197 |
-
|
|
|
|
|
198 |
|
199 |
-
if(
|
200 |
-
$
|
|
|
201 |
}
|
202 |
-
|
203 |
-
|
|
|
|
|
204 |
}
|
|
|
|
|
205 |
}
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
testimonial TEXT NOT NULL,
|
211 |
-
author VARCHAR(255),
|
212 |
-
source VARCHAR(255),
|
213 |
-
tags VARCHAR(255),
|
214 |
-
public enum('yes', 'no') DEFAULT 'yes' NOT NULL,
|
215 |
-
time_added datetime NOT NULL,
|
216 |
-
time_updated datetime,
|
217 |
-
PRIMARY KEY (testimonial_id)
|
218 |
-
) {$db_charset} {$db_collate};";
|
219 |
-
$results = $wpdb->query( $sql );
|
220 |
}
|
221 |
|
222 |
-
global $testimonialswidget_db_version;
|
223 |
-
$options = get_option('testimonialswidget');
|
224 |
-
$options['db_version'] = $testimonialswidget_db_version;
|
225 |
-
update_option('testimonialswidget', $options);
|
226 |
|
227 |
-
|
|
|
|
|
|
|
228 |
|
229 |
|
230 |
-
function
|
231 |
-
|
232 |
-
|
233 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
234 |
}
|
|
|
|
|
|
|
235 |
|
236 |
-
|
237 |
-
|
|
|
|
|
|
|
238 |
}
|
|
|
|
|
|
|
|
|
|
|
239 |
|
240 |
-
|
241 |
-
|
242 |
|
243 |
-
register_activation_hook( __FILE__, 'testimonialswidget_install' );
|
244 |
|
245 |
-
function
|
246 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
247 |
}
|
248 |
|
249 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
250 |
|
251 |
-
|
252 |
-
$ids = ($atts['ids']) ? $atts['ids'] : false;
|
253 |
-
$limit = ($atts['limit']) ? $atts['limit'] : false;
|
254 |
-
$random = ($atts['random']) ? true : false;
|
255 |
-
$show_author = ($atts['hide_author']) ? false : true;
|
256 |
-
$show_source = ($atts['hide_source']) ? false : true;
|
257 |
-
$tags = ($atts['tags']) ? $atts['tags'] : false;
|
258 |
|
259 |
-
|
260 |
-
$char_limit = intval( $atts['char_limit'] );
|
261 |
-
} else {
|
262 |
-
$char_limit = false;
|
263 |
}
|
264 |
|
265 |
-
$conditions = " WHERE public = 'yes'";
|
266 |
|
267 |
-
|
268 |
-
|
269 |
-
$
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
274 |
}
|
275 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
276 |
}
|
277 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
278 |
}
|
279 |
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
287 |
}
|
288 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
289 |
}
|
290 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
291 |
}
|
292 |
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
297 |
}
|
298 |
|
299 |
-
if ( $limit )
|
300 |
-
$conditions .= " LIMIT {$limit}";
|
301 |
|
302 |
-
$testimonials
|
|
|
303 |
|
304 |
-
|
|
|
|
|
305 |
|
306 |
-
|
307 |
-
|
308 |
-
|
|
|
|
|
|
|
309 |
}
|
310 |
|
311 |
-
$html .= '
|
312 |
-
$html .= "<q>". make_clickable( $testimonial['testimonial'] ) ."</q>";
|
313 |
|
314 |
-
$
|
315 |
-
|
316 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
317 |
|
318 |
-
|
319 |
-
if($cite)
|
320 |
-
$cite .= '<span class="testimonialswidget_join">, </span>';
|
321 |
|
322 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
323 |
}
|
324 |
|
325 |
-
|
326 |
-
$cite = " <cite>— {$cite}</cite>";
|
327 |
|
328 |
-
$html
|
329 |
}
|
330 |
|
331 |
-
$html .= '</div>';
|
332 |
|
333 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
334 |
|
335 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
336 |
|
337 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
338 |
|
339 |
-
|
340 |
-
|
341 |
-
// return with no change if string is shorter than $char_limit
|
342 |
-
if( strlen( $string ) <= $char_limit )
|
343 |
-
return $string;
|
344 |
|
345 |
-
|
346 |
-
|
347 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
348 |
}
|
349 |
|
350 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
351 |
}
|
352 |
|
353 |
?>
|
1 |
<?php
|
2 |
/*
|
3 |
+
Plugin Name: Testimonials Widget
|
4 |
+
Plugin URI: http://wordpress.org/extend/plugins/testimonials-widget/
|
5 |
+
Description: Testimonials Widget plugin allows you to display random or rotating portfolio, quotes, reviews, showcases, or text with images on your WordPress blog.
|
6 |
+
Version: 2.8.2
|
7 |
+
Author: Michael Cannon
|
8 |
+
Author URI: http://aihr.us/about-aihrus/michael-cannon-resume/
|
9 |
+
License: GPLv2 or later
|
10 |
*/
|
11 |
|
12 |
+
/*
|
13 |
+
Copyright 2013 Michael Cannon (email: mc@aihr.us)
|
14 |
|
15 |
This program is free software; you can redistribute it and/or modify
|
16 |
+
it under the terms of the GNU General Public License, version 2, as
|
17 |
+
published by the Free Software Foundation.
|
|
|
18 |
|
19 |
This program is distributed in the hope that it will be useful,
|
20 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
21 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
22 |
GNU General Public License for more details.
|
23 |
|
24 |
You should have received a copy of the GNU General Public License
|
25 |
along with this program; if not, write to the Free Software
|
26 |
+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
27 |
*/
|
28 |
|
|
|
|
|
29 |
|
30 |
+
class Testimonials_Widget {
|
31 |
+
const id = 'testimonialswidget_testimonials';
|
32 |
+
const old_name = 'testimonialswidget';
|
33 |
+
const pt = 'testimonials-widget';
|
34 |
+
const version = '2.8.2';
|
35 |
+
|
36 |
+
private $max_num_pages = 0;
|
37 |
+
private $post_count = 0;
|
38 |
+
private $settings_link = '';
|
39 |
+
private $wp_query = null;
|
40 |
+
|
41 |
+
private static $base;
|
42 |
+
|
43 |
+
public static $css = array();
|
44 |
+
public static $css_called = false;
|
45 |
+
public static $instance_number = 0;
|
46 |
+
public static $scripts = array();
|
47 |
+
public static $scripts_called = false;
|
48 |
+
public static $tag_close_quote = '<span class="testimonialswidget_close_quote"></span>';
|
49 |
+
public static $tag_open_quote = '<span class="testimonialswidget_open_quote"></span>';
|
50 |
+
public static $widget_number = 100000;
|
51 |
+
|
52 |
+
|
53 |
+
public function __construct() {
|
54 |
+
add_action( 'admin_init', array( &$this, 'admin_init' ) );
|
55 |
+
add_action( 'init', array( &$this, 'init' ) );
|
56 |
+
add_action( 'widgets_init', array( &$this, 'init_widgets' ) );
|
57 |
+
add_shortcode( 'testimonialswidget_list', array( &$this, 'testimonialswidget_list' ) );
|
58 |
+
add_shortcode( 'testimonialswidget_widget', array( &$this, 'testimonialswidget_widget' ) );
|
59 |
+
load_plugin_textdomain( self::pt, false, 'testimonials-widget/languages' );
|
60 |
+
register_activation_hook( __FILE__, array( &$this, 'activation' ) );
|
61 |
+
}
|
62 |
+
|
63 |
+
|
64 |
+
public function admin_init() {
|
65 |
+
$this->add_meta_box_testimonials_widget();
|
66 |
+
$this->update();
|
67 |
+
add_action( 'gettext', array( &$this, 'gettext_testimonials' ) );
|
68 |
+
add_action( 'manage_' . self::pt . '_posts_custom_column', array( &$this, 'manage_testimonialswidget_posts_custom_column' ), 10, 2 );
|
69 |
+
add_filter( 'manage_' . self::pt . '_posts_columns', array( &$this, 'manage_edit_testimonialswidget_columns' ) );
|
70 |
+
add_filter( 'plugin_row_meta', array( &$this, 'plugin_row_meta'), 10, 2 );
|
71 |
+
add_filter( 'post_updated_messages', array( &$this, 'post_updated_messages' ) );
|
72 |
+
add_filter( 'pre_get_posts', array( &$this, 'pre_get_posts_author' ) );
|
73 |
+
self::support_thumbnails();
|
74 |
+
}
|
75 |
+
|
76 |
+
|
77 |
+
public function plugin_action_links( $links, $file ) {
|
78 |
+
if ( $file == plugin_basename( __FILE__ ) ) {
|
79 |
+
array_unshift( $links, $this->settings_link );
|
80 |
+
}
|
81 |
|
82 |
+
return $links;
|
83 |
+
}
|
84 |
|
|
|
|
|
|
|
85 |
|
86 |
+
public function init() {
|
87 |
+
if ( function_exists( 'admin_url' ) ) {
|
88 |
+
require_once( 'lib/settings.testimonials-widget.php' );
|
89 |
|
90 |
+
$this->settings_link = '<a href="' . get_admin_url() . 'edit.php?post_type=' . Testimonials_Widget::pt . '&page=' . Testimonials_Widget_Settings::id . '">' . __('Settings', 'testimonials-widget') . '</a>';
|
91 |
+
add_filter( 'plugin_action_links', array( &$this, 'plugin_action_links' ), 10, 2 );
|
92 |
+
}
|
93 |
|
94 |
+
add_filter( 'the_content', array( &$this, 'get_single' ) );
|
95 |
+
self::$base = plugin_basename(__FILE__);
|
96 |
+
self::init_post_type();
|
97 |
+
self::styles();
|
98 |
+
}
|
99 |
|
|
|
|
|
100 |
|
101 |
+
public function get_instance() {
|
102 |
+
return self::$instance_number;
|
103 |
+
}
|
104 |
|
105 |
|
106 |
+
public function add_instance() {
|
107 |
+
self::$instance_number++;
|
108 |
+
}
|
109 |
+
|
110 |
+
|
111 |
+
public function support_thumbnails() {
|
112 |
+
$feature = 'post-thumbnails';
|
113 |
+
$feature_level = get_theme_support( $feature );
|
114 |
+
|
115 |
+
if ( true === $feature_level ) {
|
116 |
+
// already enabled for all post types
|
117 |
+
return;
|
118 |
+
} elseif ( false === $feature_level ) {
|
119 |
+
// none allowed, only enable for our own
|
120 |
+
add_theme_support( $feature, array( self::pt ) );
|
121 |
+
} else {
|
122 |
+
// add our own to list of supported
|
123 |
+
$feature_level[0][] = self::pt;
|
124 |
+
add_theme_support( $feature, $feature_level[0] );
|
125 |
+
}
|
126 |
+
}
|
127 |
+
|
128 |
+
|
129 |
+
public function get_single( $content ) {
|
130 |
+
global $post;
|
131 |
+
|
132 |
+
if ( ! is_single() || self::pt != $post->post_type )
|
133 |
+
return $content;
|
134 |
+
|
135 |
+
$atts = self::get_defaults( true );
|
136 |
+
$atts['hide_content'] = 1;
|
137 |
+
$atts['ids'] = $post->ID;
|
138 |
+
$atts['type'] = 'get_single';
|
139 |
+
|
140 |
+
$testimonials = self::get_testimonials( $atts );
|
141 |
+
$testimonial = $testimonials[0];
|
142 |
+
|
143 |
+
$details = self::get_testimonial_html( $testimonial, $atts );
|
144 |
+
$details = apply_filters( 'testimonials_widget_testimonial_html_single', $details, $testimonial, $atts );
|
145 |
+
$content = apply_filters( 'testimonials_widget_testimonial_html_single_content', $content, $testimonial, $atts );
|
146 |
+
|
147 |
+
return $content . $details;
|
148 |
+
}
|
149 |
+
|
150 |
+
|
151 |
+
public function activation() {
|
152 |
+
self::init();
|
153 |
+
flush_rewrite_rules();
|
154 |
+
}
|
155 |
+
|
156 |
+
|
157 |
+
public static function plugin_row_meta( $input, $file ) {
|
158 |
+
if ( $file != self::$base ) {
|
159 |
+
return $input;
|
160 |
+
}
|
161 |
+
|
162 |
+
$links = array(
|
163 |
+
'<a href="http://aihr.us/about-aihrus/donate/">Donate</a>',
|
164 |
+
'<a href="http://aihr.us/wordpress/testimonials-widget-premium/">Purchase Testimonials Widget Premium</a>'
|
165 |
+
);
|
166 |
+
|
167 |
+
$input = array_merge( $input, $links );
|
168 |
+
|
169 |
+
return $input;
|
170 |
+
}
|
171 |
|
172 |
|
173 |
+
public function update() {
|
174 |
+
$options = get_option( self::old_name );
|
175 |
|
176 |
+
// testimonials already migrated?
|
177 |
+
if ( true === $options['migrated'] )
|
178 |
+
return;
|
179 |
|
180 |
+
global $wpdb;
|
181 |
+
|
182 |
+
$table_name = $wpdb->prefix . self::old_name;
|
183 |
+
$meta_key = '_' . self::pt . ':testimonial_id';
|
184 |
+
|
185 |
+
// check that db table exists and has entries
|
186 |
+
$query = 'SELECT `testimonial_id`, `testimonial`, `author`, `source`, `tags`, `public`, `time_added`, `time_updated` FROM `' . $table_name . '`';
|
187 |
+
|
188 |
+
// ignore already imported
|
189 |
+
$done_import_query = 'SELECT meta_value FROM ' . $wpdb->postmeta . ' WHERE meta_key = "' . $meta_key . '"';
|
190 |
+
$done_import = $wpdb->get_col( $done_import_query );
|
191 |
+
|
192 |
+
if ( ! empty( $done_import ) ) {
|
193 |
+
$done_import = array_unique( $done_import );
|
194 |
+
$query .= " WHERE testimonial_id NOT IN ( " . implode( ',', $done_import ) . " )";
|
195 |
+
}
|
196 |
+
|
197 |
+
$results = $wpdb->get_results( $query );
|
198 |
+
if( ! empty( $results ) ) {
|
199 |
+
foreach ( $results as $result ) {
|
200 |
+
// author can contain title and company details
|
201 |
+
$author = $result->author;
|
202 |
+
$company = false;
|
203 |
+
|
204 |
+
// ex: First Last of Company!
|
205 |
+
$author = str_replace( ' of ', ', ', $author );
|
206 |
+
// now ex: First Last, Company!
|
207 |
+
|
208 |
+
// ex: First Last, Company
|
209 |
+
// ex: First Last, Web Development Manager, Topcon Positioning Systems, Inc.
|
210 |
+
// ex: First Last, Owner, Company, LLC
|
211 |
+
$author = str_replace( ' of ', ', ', $author );
|
212 |
+
$temp_comma = '^^^';
|
213 |
+
$author = str_replace( ', LLC', $temp_comma . ' LLC', $author );
|
214 |
+
// now ex: First Last, Owner, Company^^^ LLC
|
215 |
+
$author = str_replace( ', Inc', $temp_comma . ' Inc', $author );
|
216 |
+
// ex: First Last, Web Development Manager, Company^^^ Inc.
|
217 |
+
// it's possible to have "Michael Cannon, Senior Developer" and "Senior Developer" become the company. Okay for now
|
218 |
+
$author = explode( ', ', $author );
|
219 |
+
|
220 |
+
if ( 1 < count( $author ) ) {
|
221 |
+
$company = array_pop( $author );
|
222 |
+
$company = str_replace( $temp_comma, ',', $company );
|
223 |
+
}
|
224 |
+
|
225 |
+
$author = implode( ', ', $author );
|
226 |
+
$author = str_replace( $temp_comma, ',', $author );
|
227 |
+
|
228 |
+
$post_data = array(
|
229 |
+
'post_type' => self::pt,
|
230 |
+
'post_status' => ( 'yes' == $result->public ) ? 'publish' : 'private',
|
231 |
+
'post_date' => $result->time_added,
|
232 |
+
'post_modified' => $result->time_updated,
|
233 |
+
'post_title' => $author,
|
234 |
+
'post_content' => $result->testimonial,
|
235 |
+
'tags_input' => $result->tags,
|
236 |
+
);
|
237 |
+
|
238 |
+
$post_id = wp_insert_post( $post_data, true );
|
239 |
+
|
240 |
+
// track/link testimonial import to new post
|
241 |
+
add_post_meta( $post_id, $meta_key, $result->testimonial_id );
|
242 |
+
|
243 |
+
if ( ! empty( $company ) ) {
|
244 |
+
add_post_meta( $post_id, 'testimonials-widget-company', $company );
|
245 |
+
}
|
246 |
+
|
247 |
+
$source = $result->source;
|
248 |
+
if ( ! empty( $source ) ) {
|
249 |
+
if ( is_email( $source ) ) {
|
250 |
+
add_post_meta( $post_id, 'testimonials-widget-email', $source );
|
251 |
+
} else {
|
252 |
+
add_post_meta( $post_id, 'testimonials-widget-url', $source );
|
253 |
+
}
|
254 |
}
|
255 |
}
|
|
|
256 |
}
|
|
|
|
|
257 |
|
258 |
+
$options['migrated'] = true;
|
259 |
+
delete_option( self::old_name );
|
260 |
+
add_option( self::old_name, $options, null, 'no' );
|
|
|
261 |
}
|
262 |
|
|
|
|
|
263 |
|
264 |
+
public function pre_get_posts_author( $query ) {
|
265 |
+
global $user_ID;
|
266 |
|
267 |
+
// author's and below
|
268 |
+
if( $query->is_admin && ! empty( $query->is_main_query ) && $query->is_post_type_archive( Testimonials_Widget::pt ) && ! current_user_can( 'edit_others_posts' ) )
|
269 |
+
$query->set( 'post_author', $user_ID );
|
270 |
|
271 |
+
return $query;
|
|
|
|
|
|
|
|
|
|
|
|
|
272 |
}
|
273 |
+
|
274 |
+
|
275 |
+
public function manage_testimonialswidget_posts_custom_column( $column, $post_id ) {
|
276 |
+
$result = false;
|
277 |
+
|
278 |
+
switch ( $column ) {
|
279 |
+
case 'shortcode':
|
280 |
+
$result = '[testimonialswidget_list ids="';
|
281 |
+
$result .= $post_id;
|
282 |
+
$result .= '"]';
|
283 |
+
$result .= '<br />';
|
284 |
+
$result .= '[testimonialswidget_widget ids="';
|
285 |
+
$result .= $post_id;
|
286 |
+
$result .= '"]';
|
287 |
+
break;
|
288 |
+
|
289 |
+
case 'testimonials-widget-company':
|
290 |
+
case 'testimonials-widget-title':
|
291 |
+
$result = get_post_meta( $post_id, $column, true );
|
292 |
+
break;
|
293 |
+
|
294 |
+
case 'testimonials-widget-email':
|
295 |
+
case 'testimonials-widget-url':
|
296 |
+
$url = get_post_meta( $post_id, $column, true );
|
297 |
+
if ( ! empty( $url ) && 0 === preg_match( "#https?://#", $url ) ) {
|
298 |
+
$url = 'http://' . $url;
|
299 |
+
}
|
300 |
+
|
301 |
+
$result = make_clickable( $url );
|
302 |
+
break;
|
303 |
+
|
304 |
+
case 'thumbnail':
|
305 |
+
$email = get_post_meta( $post_id, 'testimonials-widget-email', true );
|
306 |
+
|
307 |
+
if ( has_post_thumbnail( $post_id ) ) {
|
308 |
+
$result = get_the_post_thumbnail( $post_id, 'thumbnail' );
|
309 |
+
} elseif ( is_email( $email ) ) {
|
310 |
+
$result = get_avatar( $email );
|
311 |
+
} else {
|
312 |
+
$result = false;
|
313 |
}
|
314 |
+
break;
|
315 |
}
|
316 |
|
317 |
+
$result = apply_filters( 'testimonials_widget_posts_custom_column', $result, $column, $post_id );
|
318 |
+
|
319 |
+
if ( $result )
|
320 |
+
echo $result;
|
|
|
|
|
321 |
}
|
322 |
|
|
|
|
|
323 |
|
324 |
+
public function manage_edit_testimonialswidget_columns( $columns ) {
|
325 |
+
// order of keys matches column ordering
|
326 |
+
$columns = array(
|
327 |
+
'cb' => '<input type="checkbox" />',
|
328 |
+
'thumbnail' => __( 'Image', 'testimonials-widget' ),
|
329 |
+
'title' => __( 'Source', 'testimonials-widget' ),
|
330 |
+
'shortcode' => __( 'Shortcodes', 'testimonials-widget' ),
|
331 |
+
'testimonials-widget-title' => __( 'Title', 'testimonials-widget' ),
|
332 |
+
'testimonials-widget-email' => __( 'Email', 'testimonials-widget' ),
|
333 |
+
'testimonials-widget-company' => __( 'Company', 'testimonials-widget' ),
|
334 |
+
'testimonials-widget-url' => __( 'URL', 'testimonials-widget' ),
|
335 |
+
'author' => __( 'Published by', 'testimonials-widget' ),
|
336 |
+
'categories' => __( 'Category', 'testimonials-widget' ),
|
337 |
+
'tags' => __( 'Tags', 'testimonials-widget' ),
|
338 |
+
'date' => __( 'Date', 'testimonials-widget' ),
|
339 |
+
);
|
340 |
+
|
341 |
+
$columns = apply_filters( 'testimonials_widget_columns', $columns );
|
342 |
+
|
343 |
+
return $columns;
|
344 |
}
|
345 |
|
346 |
+
|
347 |
+
public function init_post_type() {
|
348 |
+
$labels = array(
|
349 |
+
'add_new' => __( 'Add New', 'testimonials-widget' ),
|
350 |
+
'add_new_item' => __( 'Add New Testimonial', 'testimonials-widget' ),
|
351 |
+
'edit_item' => __( 'Edit Testimonial', 'testimonials-widget' ),
|
352 |
+
'name' => __( 'Testimonials', 'testimonials-widget' ),
|
353 |
+
'new_item' => __( 'Add New Testimonial', 'testimonials-widget' ),
|
354 |
+
'not_found' => __( 'No testimonials found', 'testimonials-widget' ),
|
355 |
+
'not_found_in_trash' => __( 'No testimonials found in Trash', 'testimonials-widget' ),
|
356 |
+
'parent_item_colon' => null,
|
357 |
+
'search_items' => __( 'Search Testimonials', 'testimonials-widget' ),
|
358 |
+
'singular_name' => __( 'Testimonial', 'testimonials-widget' ),
|
359 |
+
'view_item' => __( 'View Testimonial', 'testimonials-widget' ),
|
360 |
+
);
|
361 |
+
|
362 |
+
$supports = array(
|
363 |
+
'title',
|
364 |
+
'editor',
|
365 |
+
'thumbnail',
|
366 |
+
);
|
367 |
+
|
368 |
+
$allow_comments = tw_get_option( 'allow_comments', false );
|
369 |
+
if ( $allow_comments )
|
370 |
+
$supports[] = 'comments';
|
371 |
+
|
372 |
+
$has_archive = tw_get_option( 'has_archive', true );
|
373 |
+
$rewrite_slug = tw_get_option( 'rewrite_slug', 'testimonial' );
|
374 |
+
|
375 |
+
// editor's and up
|
376 |
+
if( current_user_can( 'edit_others_posts' ) )
|
377 |
+
$supports[] = 'author';
|
378 |
+
|
379 |
+
$args = array(
|
380 |
+
'label' => __( 'Testimonials', 'testimonials-widget' ),
|
381 |
+
'capability_type' => 'post',
|
382 |
+
'has_archive' => $has_archive,
|
383 |
+
'hierarchical' => false,
|
384 |
+
'labels' => $labels,
|
385 |
+
'public' => true,
|
386 |
+
'publicly_queryable' => true,
|
387 |
+
'query_var' => true,
|
388 |
+
'rewrite' => array(
|
389 |
+
'slug' => $rewrite_slug,
|
390 |
+
'with_front' => false
|
391 |
+
),
|
392 |
+
'show_in_menu' => true,
|
393 |
+
'show_ui' => true,
|
394 |
+
'supports' => $supports,
|
395 |
+
'taxonomies' => array(
|
396 |
+
'category',
|
397 |
+
'post_tag',
|
398 |
+
)
|
399 |
+
);
|
400 |
+
|
401 |
+
register_post_type( Testimonials_Widget::pt, $args );
|
402 |
+
}
|
403 |
+
|
404 |
+
|
405 |
+
public function get_defaults( $single_view = false ) {
|
406 |
+
if ( empty( $single_view ) ) {
|
407 |
+
return apply_filters( 'testimonials_widget_defaults', tw_get_options() );
|
408 |
+
} else {
|
409 |
+
return apply_filters( 'testimonials_widget_defaults_single', tw_get_options() );
|
410 |
}
|
411 |
+
}
|
412 |
+
|
413 |
+
|
414 |
+
public function testimonialswidget_list( $atts ) {
|
415 |
+
self::add_instance();
|
416 |
+
|
417 |
+
$atts = wp_parse_args( $atts, self::get_defaults() );
|
418 |
+
$atts = Testimonials_Widget_Settings::validate_settings( $atts );
|
419 |
|
420 |
+
if ( get_query_var('paged') ) {
|
421 |
+
$atts['paged'] = get_query_var('paged');
|
422 |
+
} elseif ( get_query_var('page') ) {
|
423 |
+
$atts['paged'] = get_query_var('page');
|
424 |
} else {
|
425 |
+
$atts['paged'] = 1;
|
|
|
426 |
}
|
|
|
|
|
|
|
|
|
427 |
|
428 |
+
$atts['type'] = 'testimonialswidget_list';
|
429 |
+
|
430 |
+
$content = apply_filters( 'testimonials_widget_cache_get', false, $atts );
|
431 |
+
|
432 |
+
if ( false === $content ) {
|
433 |
+
$testimonials = self::get_testimonials( $atts );
|
434 |
+
$content = self::get_testimonials_html( $testimonials, $atts );
|
435 |
+
$content = apply_filters( 'testimonials_widget_cache_set', $content, $atts );
|
436 |
}
|
|
|
|
|
437 |
|
438 |
+
return $content;
|
439 |
}
|
|
|
440 |
|
|
|
|
|
441 |
|
442 |
+
public function testimonialswidget_widget( $atts, $widget_number = null ) {
|
443 |
+
self::add_instance();
|
444 |
+
self::scripts();
|
445 |
|
446 |
+
if ( empty( $widget_number ) ) {
|
447 |
+
$widget_number = self::$widget_number++;
|
|
|
|
|
|
|
448 |
|
449 |
+
if ( empty( $atts['random'] ) )
|
450 |
+
$atts['random'] = 1;
|
451 |
+
}
|
|
|
|
|
452 |
|
453 |
+
$atts = wp_parse_args( $atts, self::get_defaults() );
|
454 |
+
$atts = Testimonials_Widget_Settings::validate_settings( $atts );
|
455 |
|
456 |
+
$atts['paging'] = false;
|
457 |
+
$atts['type'] = 'testimonialswidget_widget';
|
458 |
+
$atts['widget_number'] = $widget_number;
|
459 |
|
460 |
+
$testimonials = self::get_testimonials( $atts );
|
|
|
|
|
|
|
|
|
461 |
|
462 |
+
$content = apply_filters( 'testimonials_widget_cache_get', false, $atts );
|
|
|
|
|
463 |
|
464 |
+
if ( false === $content ) {
|
465 |
+
$content = self::get_testimonials_html( $testimonials, $atts, false, $widget_number );
|
466 |
+
$content = apply_filters( 'testimonials_widget_cache_set', $content, $atts );
|
467 |
+
}
|
468 |
+
|
469 |
+
// Generate CSS
|
470 |
+
$atts['type'] = 'testimonialswidget_widget_css';
|
471 |
+
$css = apply_filters( 'testimonials_widget_cache_get', false, $atts );
|
472 |
+
|
473 |
+
if ( false === $css ) {
|
474 |
+
$css = self::get_testimonials_html_css( $atts, $widget_number );
|
475 |
+
$css = apply_filters( 'testimonials_widget_cache_set', $css, $atts );
|
476 |
+
}
|
477 |
|
478 |
+
if ( ! empty( $css ) ) {
|
479 |
+
self::$css = array_merge( $css, self::$css );
|
480 |
+
add_action( 'wp_footer', array( &$this, 'get_testimonials_css' ), 20 );
|
481 |
+
}
|
482 |
|
483 |
+
// Generate JS
|
484 |
+
$atts['type'] = 'testimonialswidget_widget_js';
|
485 |
+
$js = apply_filters( 'testimonials_widget_cache_get', false, $atts );
|
486 |
|
487 |
+
if ( false === $js ) {
|
488 |
+
$js = self::get_testimonials_html_js( $testimonials, $atts, $widget_number );
|
489 |
+
$js = apply_filters( 'testimonials_widget_cache_set', $js, $atts );
|
490 |
}
|
491 |
+
|
492 |
+
if ( ! empty( $js ) ) {
|
493 |
+
self::$scripts = array_merge( $js, self::$scripts );
|
494 |
+
add_action( 'wp_footer', array( &$this, 'get_testimonials_scripts' ), 20 );
|
495 |
}
|
496 |
+
|
497 |
+
return $content;
|
498 |
}
|
499 |
+
|
500 |
+
|
501 |
+
public function scripts() {
|
502 |
+
wp_enqueue_script( 'jquery' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
503 |
}
|
504 |
|
|
|
|
|
|
|
|
|
505 |
|
506 |
+
public function styles() {
|
507 |
+
wp_register_style( 'testimonials-widget', plugins_url( 'testimonials-widget.css', __FILE__ ) );
|
508 |
+
wp_enqueue_style( 'testimonials-widget' );
|
509 |
+
}
|
510 |
|
511 |
|
512 |
+
public function get_testimonials_html_css( $atts, $widget_number = null ) {
|
513 |
+
// display attributes
|
514 |
+
$max_height = $atts['max_height'];
|
515 |
+
$min_height = $atts['min_height'];
|
516 |
+
|
517 |
+
$css = array();
|
518 |
+
$id_base = self::id . $widget_number;
|
519 |
+
|
520 |
+
if ( $min_height ) {
|
521 |
+
$css[] = <<<EOF
|
522 |
+
<style>
|
523 |
+
.$id_base {
|
524 |
+
min-height: {$min_height}px;
|
525 |
}
|
526 |
+
</style>
|
527 |
+
EOF;
|
528 |
+
}
|
529 |
|
530 |
+
if ( $max_height ) {
|
531 |
+
$css[] = <<<EOF
|
532 |
+
<style>
|
533 |
+
.$id_base {
|
534 |
+
max-height: {$max_height}px;
|
535 |
}
|
536 |
+
</style>
|
537 |
+
EOF;
|
538 |
+
}
|
539 |
+
|
540 |
+
$css = apply_filters( 'testimonials_widget_testimonials_css', $css, $atts, $widget_number );
|
541 |
|
542 |
+
return $css;
|
543 |
+
}
|
544 |
|
|
|
545 |
|
546 |
+
public function get_testimonials_html_js( $testimonials, $atts, $widget_number = null ) {
|
547 |
+
// display attributes
|
548 |
+
$refresh_interval = $atts['refresh_interval'];
|
549 |
+
|
550 |
+
$id_base = self::id . $widget_number;
|
551 |
+
$scripts = array();
|
552 |
+
|
553 |
+
if ( $refresh_interval && 1 < count( $testimonials ) ) {
|
554 |
+
$javascript = <<<EOF
|
555 |
+
<script type="text/javascript">
|
556 |
+
function nextTestimonial{$widget_number}() {
|
557 |
+
if ( ! jQuery('.{$id_base}').first().hasClass('hovered') ) {
|
558 |
+
var active = jQuery('.{$id_base} .testimonialswidget_active');
|
559 |
+
var next = (jQuery('.{$id_base} .testimonialswidget_active').next().length > 0) ? jQuery('.{$id_base} .testimonialswidget_active').next() : jQuery('.{$id_base} .testimonialswidget_testimonial:first');
|
560 |
+
active.fadeOut(1250, function(){
|
561 |
+
active.removeClass('testimonialswidget_active');
|
562 |
+
next.fadeIn(500);
|
563 |
+
next.removeClass('testimonialswidget_display_none');
|
564 |
+
next.addClass('testimonialswidget_active');
|
565 |
+
});
|
566 |
+
}
|
567 |
}
|
568 |
|
569 |
+
jQuery(document).ready(function(){
|
570 |
+
jQuery('.{$id_base}').hover(function() {
|
571 |
+
jQuery(this).addClass('hovered')
|
572 |
+
}, function() {
|
573 |
+
jQuery(this).removeClass('hovered')
|
574 |
+
});
|
575 |
+
nextTestimonial{$widget_number}interval = setInterval('nextTestimonial{$widget_number}()', {$refresh_interval} * 1000);
|
576 |
+
});
|
577 |
+
</script>
|
578 |
+
EOF;
|
579 |
+
|
580 |
+
$scripts[ $id_base ] = $javascript;
|
581 |
+
}
|
582 |
|
583 |
+
$scripts = apply_filters( 'testimonials_widget_testimonials_js', $scripts, $testimonials, $atts, $widget_number );
|
|
|
|
|
|
|
|
|
|
|
|
|
584 |
|
585 |
+
return $scripts;
|
|
|
|
|
|
|
586 |
}
|
587 |
|
|
|
588 |
|
589 |
+
public function get_testimonials_html( $testimonials, $atts, $is_list = true, $widget_number = null ) {
|
590 |
+
// display attributes
|
591 |
+
$hide_not_found = $atts['hide_not_found'];
|
592 |
+
$paging = Testimonials_Widget_Settings::is_true( $atts['paging'] );
|
593 |
+
$paging_before = ( 'before' == $atts['paging'] );
|
594 |
+
$paging_after = ( 'after' == $atts['paging'] );
|
595 |
+
$refresh_interval = $atts['refresh_interval'];
|
596 |
+
$target = $atts['target'];
|
597 |
+
|
598 |
+
$html = '';
|
599 |
+
$id = self::id;
|
600 |
+
|
601 |
+
if ( is_null( $widget_number ) ) {
|
602 |
+
$html .= '<div class="' . $id;
|
603 |
+
|
604 |
+
if ( $is_list )
|
605 |
+
$html .= ' ' . $id . '_list';
|
606 |
+
|
607 |
+
$html .= '">';
|
608 |
+
} else {
|
609 |
+
$id_base = $id . $widget_number;
|
610 |
+
$html .= '<div class="' . $id . ' ' . $id_base . '">';
|
611 |
+
}
|
612 |
+
|
613 |
+
if ( empty( $testimonials ) && ! $hide_not_found ) {
|
614 |
+
$testimonials = array(
|
615 |
+
array( 'testimonial_content' => __( 'No testimonials found', 'testimonials-widget' ) )
|
616 |
+
);
|
617 |
+
}
|
618 |
+
|
619 |
+
if ( $paging || $paging_before ) {
|
620 |
+
$html .= self::get_testimonials_paging( $testimonials, $atts );
|
621 |
+
}
|
622 |
+
|
623 |
+
$is_first = true;
|
624 |
+
|
625 |
+
foreach ( $testimonials as $testimonial ) {
|
626 |
+
$content = self::get_testimonial_html( $testimonial, $atts, $is_list, $is_first, $widget_number );
|
627 |
+
$content = apply_filters( 'testimonials_widget_testimonial_html', $content, $testimonial, $atts, $is_list, $is_first, $widget_number );
|
628 |
+
$html .= $content;
|
629 |
+
$is_first = false;
|
630 |
+
}
|
631 |
+
|
632 |
+
if ( $paging || $paging_after ) {
|
633 |
+
$html .= self::get_testimonials_paging( $testimonials, $atts, false );
|
634 |
+
}
|
635 |
+
|
636 |
+
$html .= '</div>';
|
637 |
+
|
638 |
+
if ( $target )
|
639 |
+
$html = links_add_target( $html, $target );
|
640 |
+
|
641 |
+
return $html;
|
642 |
+
}
|
643 |
+
|
644 |
+
|
645 |
+
public function get_testimonial_html( $testimonial, $atts, $is_list = true, $is_first = false, $widget_number = null ) {
|
646 |
+
// display attributes
|
647 |
+
$char_limit = $atts['char_limit'];
|
648 |
+
$content_more = apply_filters( 'testimonials_widget_content_more', __( '…', 'testimonials-widget' ) );
|
649 |
+
$content_more .= self::$tag_close_quote;
|
650 |
+
$do_company = ! $atts['hide_company'] && ! empty( $testimonial['testimonial_company'] );
|
651 |
+
$do_content = ! $atts['hide_content'] && ! empty( $testimonial['testimonial_content'] );
|
652 |
+
$do_email = ! $atts['hide_email'] && ! empty( $testimonial['testimonial_email'] ) && is_email( $testimonial['testimonial_email'] );
|
653 |
+
$do_image = ! $atts['hide_image'] && ! empty( $testimonial['testimonial_image'] );
|
654 |
+
$do_source = ! $atts['hide_source'] && ! empty( $testimonial['testimonial_source'] );
|
655 |
+
$do_title = ! $atts['hide_title'] && ! empty( $testimonial['testimonial_title'] );
|
656 |
+
$do_url = ! $atts['hide_url'] && ! empty( $testimonial['testimonial_url'] );
|
657 |
+
$keep_whitespace = $atts['keep_whitespace'];
|
658 |
+
$remove_hentry = $atts['remove_hentry'];
|
659 |
+
|
660 |
+
$class = 'testimonialswidget_testimonial';
|
661 |
+
|
662 |
+
if ( $is_list ) {
|
663 |
+
$class .= ' testimonialswidget_testimonial_list';
|
664 |
+
} elseif ( $is_first ) {
|
665 |
+
$class .= ' testimonialswidget_active';
|
666 |
+
} elseif ( ! $is_first ) {
|
667 |
+
$class .= ' testimonialswidget_display_none';
|
668 |
+
}
|
669 |
+
|
670 |
+
if ( $keep_whitespace ) {
|
671 |
+
$class .= ' testimonialswidget_whitespace';
|
672 |
+
}
|
673 |
+
|
674 |
+
$div_open = '<div class="';
|
675 |
+
|
676 |
+
if ( ! empty( $testimonial['post_id'] ) )
|
677 |
+
$div_open .= join( ' ', get_post_class( $class, $testimonial['post_id'] ) );
|
678 |
+
else
|
679 |
+
$div_open .= 'testimonials-widget type-testimonials-widget status-publish hentry ' . $class;
|
680 |
+
|
681 |
+
$div_open .= '">';
|
682 |
+
|
683 |
+
if ( $remove_hentry )
|
684 |
+
$div_open = str_replace( ' hentry', '', $div_open );
|
685 |
+
|
686 |
+
$image = '';
|
687 |
+
if ( $do_image ) {
|
688 |
+
$image .= '<span class="testimonialswidget_image">';
|
689 |
+
$image .= $testimonial['testimonial_image'];
|
690 |
+
$image .= '</span>';
|
691 |
+
}
|
692 |
+
|
693 |
+
$quote = '';
|
694 |
+
if ( $do_content ) {
|
695 |
+
$content = $testimonial['testimonial_content'];
|
696 |
+
$content = self::format_content( $content, $widget_number, $keep_whitespace );
|
697 |
+
|
698 |
+
if ( $char_limit ) {
|
699 |
+
$content = self::testimonials_truncate( $content, $char_limit, ' ', $content_more );
|
700 |
+
$content = force_balance_tags( $content );
|
701 |
}
|
702 |
+
|
703 |
+
$content = apply_filters( 'testimonials_widget_content', $content, $widget_number, $testimonial, $atts );
|
704 |
+
$content = make_clickable( $content );
|
705 |
+
|
706 |
+
$quote = '<q>';
|
707 |
+
$quote .= $content;
|
708 |
+
$quote .= '</q>';
|
709 |
+
}
|
710 |
+
|
711 |
+
$cite = '';
|
712 |
+
$done_url = false;
|
713 |
+
if ( $do_source && $do_email ) {
|
714 |
+
$cite .= '<span class="testimonialswidget_author">';
|
715 |
+
$cite .= '<a href="mailto:' . $testimonial['testimonial_email'] . '">';
|
716 |
+
$cite .= $testimonial['testimonial_source'];
|
717 |
+
$cite .= '</a>';
|
718 |
+
$cite .= '</span>';
|
719 |
+
} elseif ( $do_source && ! $do_company && $do_url ) {
|
720 |
+
$cite .= '<span class="testimonialswidget_author">';
|
721 |
+
$cite .= '<a href="' . $testimonial['testimonial_url'] . '">';
|
722 |
+
$cite .= $testimonial['testimonial_source'];
|
723 |
+
$cite .= '</a>';
|
724 |
+
$cite .= '</span>';
|
725 |
+
$done_url = true;
|
726 |
+
} elseif ( $do_source ) {
|
727 |
+
$cite .= '<span class="testimonialswidget_author">';
|
728 |
+
$cite .= $testimonial['testimonial_source'];
|
729 |
+
$cite .= '</span>';
|
730 |
+
} elseif ( $do_email ) {
|
731 |
+
$cite .= '<span class="testimonialswidget_email">';
|
732 |
+
$cite .= make_clickable( $testimonial['testimonial_email'] );
|
733 |
+
$cite .= '</span>';
|
734 |
+
}
|
735 |
+
|
736 |
+
if ( $do_title && $cite )
|
737 |
+
$cite .= '<span class="testimonialswidget_join_title"></span>';
|
738 |
+
|
739 |
+
if ( $do_title ) {
|
740 |
+
$cite .= '<span class="testimonialswidget_title">';
|
741 |
+
$cite .= $testimonial['testimonial_title'];
|
742 |
+
$cite .= '</span>';
|
743 |
+
}
|
744 |
+
|
745 |
+
if ( ( $do_company || ( $do_url && ! $done_url ) ) && $cite )
|
746 |
+
$cite .= '<span class="testimonialswidget_join"></span>';
|
747 |
+
|
748 |
+
if ( $do_company && $do_url ) {
|
749 |
+
$cite .= '<span class="testimonialswidget_company">';
|
750 |
+
$cite .= '<a href="' . $testimonial['testimonial_url'] . '">';
|
751 |
+
$cite .= $testimonial['testimonial_company'];
|
752 |
+
$cite .= '</a>';
|
753 |
+
$cite .= '</span>';
|
754 |
+
} elseif ( $do_company ) {
|
755 |
+
$cite .= '<span class="testimonialswidget_company">';
|
756 |
+
$cite .= $testimonial['testimonial_company'];
|
757 |
+
$cite .= '</span>';
|
758 |
+
} elseif ( $do_url && ! $done_url ) {
|
759 |
+
$cite .= '<span class="testimonialswidget_url">';
|
760 |
+
$cite .= make_clickable( $testimonial['testimonial_url'] );
|
761 |
+
$cite .= '</span>';
|
762 |
}
|
763 |
+
|
764 |
+
if ( ! empty( $cite ) )
|
765 |
+
$cite = '<cite>' . $cite . '</cite>';
|
766 |
+
|
767 |
+
$extra = '';
|
768 |
+
if ( ! empty( $testimonial['testimonial_extra'] ) ) {
|
769 |
+
$extra .= '<div class="testimonialswidget_extra">';
|
770 |
+
$extra .= $testimonial['testimonial_extra'];
|
771 |
+
$extra .= '</div>';
|
772 |
+
}
|
773 |
+
|
774 |
+
$bottom_text = '';
|
775 |
+
if ( ! empty( $atts['bottom_text'] ) ) {
|
776 |
+
$bottom_text = '<div class="testimonialswidget_bottom_text">';
|
777 |
+
$bottom_text .= $atts['bottom_text'];
|
778 |
+
$bottom_text .= '</div>';
|
779 |
+
}
|
780 |
+
|
781 |
+
$div_close = '</div>';
|
782 |
+
$html = $div_open
|
783 |
+
. $image
|
784 |
+
. $quote
|
785 |
+
. $cite
|
786 |
+
. $extra
|
787 |
+
. $bottom_text
|
788 |
+
. $div_close;
|
789 |
+
|
790 |
+
$html = apply_filters( 'testimonials_widget_get_testimonial_html', $html, $testimonial, $atts, $is_list, $is_first, $widget_number, $div_open, $image, $quote, $cite, $extra, $bottom_text, $div_close );
|
791 |
+
|
792 |
+
return $html;
|
793 |
+
}
|
794 |
+
|
795 |
+
|
796 |
+
// Original PHP code as myTruncate2 by Chirp Internet: www.chirp.com.au
|
797 |
+
public function testimonials_truncate( $string, $char_limit = false, $break = ' ', $pad = '…', $force_pad = false ) {
|
798 |
+
if ( empty( $force_pad ) ) {
|
799 |
+
if ( empty( $char_limit ) )
|
800 |
+
return $string;
|
801 |
+
|
802 |
+
// return with no change if string is shorter than $char_limit
|
803 |
+
if ( strlen( $string ) <= $char_limit )
|
804 |
+
return $string;
|
805 |
+
}
|
806 |
+
|
807 |
+
if ( ! empty( $char_limit ) ) {
|
808 |
+
return self::truncate( $string, $char_limit, $pad, $force_pad );
|
809 |
+
}
|
810 |
+
|
811 |
+
return $string . $pad;
|
812 |
}
|
813 |
|
814 |
+
|
815 |
+
/**
|
816 |
+
* Truncate HTML, close opened tags. UTF-8 aware, and aware of unpaired tags
|
817 |
+
* (which don't need a matching closing tag)
|
818 |
+
*
|
819 |
+
* @param int $max_length Maximum length of the characters of the string
|
820 |
+
* @param string $html
|
821 |
+
* @param string $indicator Suffix to use if string was truncated.
|
822 |
+
* @param boolean $force_indicator Suffix to use if string was truncated.
|
823 |
+
* @return string
|
824 |
+
*
|
825 |
+
* @ref http://pastie.org/3084080
|
826 |
+
*/
|
827 |
+
public static function truncate( $html, $max_length, $indicator = '…', $force_indicator = false )
|
828 |
+
{
|
829 |
+
$output_length = 0; // number of counted characters stored so far in $output
|
830 |
+
$position = 0; // character offset within input string after last tag/entity
|
831 |
+
$tag_stack = array(); // stack of tags we've encountered but not closed
|
832 |
+
$output = '';
|
833 |
+
$truncated = false;
|
834 |
+
|
835 |
+
/** these tags don't have matching closing elements, in HTML (in XHTML they
|
836 |
+
* theoretically need a closing /> )
|
837 |
+
* @see http://www.netstrider.com/tutorials/HTMLRef/a_d.html
|
838 |
+
* @see http://www.w3schools.com/tags/default.asp
|
839 |
+
* @see http://stackoverflow.com/questions/3741896/what-do-you-call-tags-that-need-no-ending-tag
|
840 |
+
*/
|
841 |
+
$unpaired_tags = array( 'doctype', '!doctype',
|
842 |
+
'area','base','basefont','bgsound','br','col',
|
843 |
+
'embed','frame','hr','img','input','link','meta',
|
844 |
+
'param','sound','spacer','wbr');
|
845 |
+
|
846 |
+
$func_strcut = function_exists( 'mb_strcut' ) ? 'mb_strcut' : 'substr';
|
847 |
+
$func_strlen = function_exists( 'mb_strlen' ) ? 'mb_strlen' : 'strlen';
|
848 |
+
|
849 |
+
// loop through, splitting at HTML entities or tags
|
850 |
+
while ($output_length < $max_length
|
851 |
+
&& preg_match('{</?([a-z]+)[^>]*>|&#?[a-zA-Z0-9]+;}', $html, $match, PREG_OFFSET_CAPTURE, $position))
|
852 |
+
{
|
853 |
+
list($tag, $tag_position) = $match[0];
|
854 |
+
|
855 |
+
// get text leading up to the tag, and store it (up to max_length)
|
856 |
+
$text = $func_strcut($html, $position, $tag_position - $position);
|
857 |
+
if ($output_length + $func_strlen($text) > $max_length)
|
858 |
+
{
|
859 |
+
$output .= $func_strcut($text, 0, $max_length - $output_length);
|
860 |
+
$truncated = true;
|
861 |
+
$output_length = $max_length;
|
862 |
+
break;
|
863 |
}
|
864 |
+
|
865 |
+
// store everything, it wasn't too long
|
866 |
+
$output .= $text;
|
867 |
+
$output_length += $func_strlen($text);
|
868 |
+
|
869 |
+
if ($tag[0] == '&') // Handle HTML entity by copying straight through
|
870 |
+
{
|
871 |
+
$output .= $tag;
|
872 |
+
$output_length++; // only counted as one character
|
873 |
+
}
|
874 |
+
else // Handle HTML tag
|
875 |
+
{
|
876 |
+
$tag_inner = $match[1][0];
|
877 |
+
if ($tag[1] == '/') // This is a closing tag.
|
878 |
+
{
|
879 |
+
$output .= $tag;
|
880 |
+
// If input tags aren't balanced, we leave the popped tag
|
881 |
+
// on the stack so hopefully we're not introducing more
|
882 |
+
// problems.
|
883 |
+
if ( end($tag_stack) == $tag_inner )
|
884 |
+
{
|
885 |
+
array_pop($tag_stack);
|
886 |
+
}
|
887 |
+
}
|
888 |
+
else if ($tag[$func_strlen($tag) - 2] == '/'
|
889 |
+
|| in_array(strtolower($tag_inner),$unpaired_tags) )
|
890 |
+
{
|
891 |
+
// Self-closing or unpaired tag
|
892 |
+
$output .= $tag;
|
893 |
+
}
|
894 |
+
else // Opening tag.
|
895 |
+
{
|
896 |
+
$output .= $tag;
|
897 |
+
$tag_stack[] = $tag_inner; // push tag onto the stack
|
898 |
+
}
|
899 |
+
}
|
900 |
+
|
901 |
+
// Continue after the tag we just found
|
902 |
+
$position = $tag_position + $func_strlen($tag);
|
903 |
}
|
904 |
+
|
905 |
+
// Print any remaining text after the last tag, if there's room.
|
906 |
+
if ($output_length < $max_length && $position < $func_strlen($html))
|
907 |
+
{
|
908 |
+
$output .= $func_strcut($html, $position, $max_length - $output_length);
|
909 |
+
}
|
910 |
+
|
911 |
+
$truncated = $func_strlen($html)-$position > $max_length - $output_length;
|
912 |
+
|
913 |
+
// add terminator if it was truncated in loop or just above here
|
914 |
+
if ( $truncated || $force_indicator )
|
915 |
+
$output .= $indicator;
|
916 |
+
|
917 |
+
// Close any open tags
|
918 |
+
while (!empty($tag_stack))
|
919 |
+
$output .= '</'.array_pop($tag_stack).'>';
|
920 |
+
|
921 |
+
return $output;
|
922 |
}
|
923 |
|
924 |
+
|
925 |
+
public function format_content( $content, $widget_number, $keep_whitespace = false ) {
|
926 |
+
if ( empty ( $content ) )
|
927 |
+
return $content;
|
928 |
+
|
929 |
+
// wrap our own quote class around the content before any formatting
|
930 |
+
// happens
|
931 |
+
$temp_content = self::$tag_open_quote;
|
932 |
+
$temp_content .= $content;
|
933 |
+
$temp_content .= self::$tag_close_quote;
|
934 |
+
$content = $temp_content;
|
935 |
+
|
936 |
+
$content = trim( $content );
|
937 |
+
$content = wptexturize( $content );
|
938 |
+
$content = convert_smilies( $content );
|
939 |
+
$content = convert_chars( $content );
|
940 |
+
|
941 |
+
if ( is_null( $widget_number ) ) {
|
942 |
+
$content = wpautop( $content );
|
943 |
+
$content = shortcode_unautop( $content );
|
944 |
+
} elseif ( $keep_whitespace ) {
|
945 |
+
$content = wpautop( $content );
|
946 |
+
} else {
|
947 |
+
$content = strip_shortcodes( $content );
|
948 |
+
}
|
949 |
+
|
950 |
+
$content = str_replace(']]>', ']]>', $content);
|
951 |
+
$content = trim( $content );
|
952 |
+
|
953 |
+
return $content;
|
954 |
}
|
955 |
|
|
|
|
|
956 |
|
957 |
+
public function get_testimonials_paging( $testimonials, $atts, $prepend = true ) {
|
958 |
+
$html = '';
|
959 |
|
960 |
+
if ( is_home() || 1 === $this->max_num_pages ) {
|
961 |
+
return $html;
|
962 |
+
}
|
963 |
|
964 |
+
$html .= '<div class="testimonialswidget_paging';
|
965 |
+
|
966 |
+
if ( $prepend ) {
|
967 |
+
$html .= ' prepend';
|
968 |
+
} else {
|
969 |
+
$html .= ' append';
|
970 |
}
|
971 |
|
972 |
+
$html .= '">';
|
|
|
973 |
|
974 |
+
if ( ! empty( $atts['paged'] ) ) {
|
975 |
+
$paged = $atts['paged'];
|
976 |
+
} else {
|
977 |
+
$paged = 1;
|
978 |
+
}
|
979 |
+
|
980 |
+
if ( ! function_exists( 'wp_pagenavi' ) ) {
|
981 |
+
$html .= ' <div class="alignleft">';
|
982 |
+
|
983 |
+
if ( 1 < $paged ) {
|
984 |
+
$laquo = apply_filters( 'testimonials_widget_previous_posts_link_text', __( '«', 'testimonials-widget' ) );
|
985 |
+
$html .= get_previous_posts_link( $laquo, $paged );
|
986 |
+
}
|
987 |
+
|
988 |
+
$html .= ' </div>';
|
989 |
|
990 |
+
$html .= ' <div class="alignright">';
|
|
|
|
|
991 |
|
992 |
+
if ( $paged != $this->max_num_pages ) {
|
993 |
+
$raquo = apply_filters( 'testimonials_widget_next_posts_link', __( '»', 'testimonials-widget' ) );
|
994 |
+
$html .= get_next_posts_link( $raquo, $this->max_num_pages );
|
995 |
+
}
|
996 |
+
|
997 |
+
$html .= ' </div>';
|
998 |
+
} else {
|
999 |
+
$args = array(
|
1000 |
+
'echo' => false,
|
1001 |
+
'query' => $this->wp_query,
|
1002 |
+
);
|
1003 |
+
$args = apply_filters( 'testimonials_widget_wp_pagenavi', $args );
|
1004 |
+
$html .= wp_pagenavi( $args );
|
1005 |
}
|
1006 |
|
1007 |
+
$html .= '</div>';
|
|
|
1008 |
|
1009 |
+
return $html;
|
1010 |
}
|
1011 |
|
|
|
1012 |
|
1013 |
+
public function get_testimonials_css() {
|
1014 |
+
if ( empty( self::$css_called ) ) {
|
1015 |
+
foreach( self::$css as $key => $css ) {
|
1016 |
+
echo $css;
|
1017 |
+
}
|
1018 |
+
|
1019 |
+
self::$css_called = true;
|
1020 |
+
}
|
1021 |
+
}
|
1022 |
+
|
1023 |
|
1024 |
+
public function get_testimonials_scripts() {
|
1025 |
+
if ( empty( self::$scripts_called ) ) {
|
1026 |
+
foreach( self::$scripts as $key => $script ) {
|
1027 |
+
echo $script;
|
1028 |
+
}
|
1029 |
+
|
1030 |
+
self::$scripts_called = true;
|
1031 |
+
}
|
1032 |
+
}
|
1033 |
+
|
1034 |
+
|
1035 |
+
public function get_query_args( $atts ) {
|
1036 |
+
$category = $atts['category'];
|
1037 |
+
$exclude = $atts['exclude'];
|
1038 |
+
$ids = $atts['ids'];
|
1039 |
+
$limit = $atts['limit'];
|
1040 |
+
$meta_key = $atts['meta_key'];
|
1041 |
+
$order = $atts['order'];
|
1042 |
+
$orderby = $atts['orderby'];
|
1043 |
+
$paging = $atts['paging'];
|
1044 |
+
$random = $atts['random'];
|
1045 |
+
$tags = $atts['tags'];
|
1046 |
+
$tags_all = $atts['tags_all'];
|
1047 |
+
|
1048 |
+
if ( $random ) {
|
1049 |
+
$orderby = 'rand';
|
1050 |
+
$order = false;
|
1051 |
+
}
|
1052 |
+
|
1053 |
+
$args = array(
|
1054 |
+
'orderby' => $orderby,
|
1055 |
+
'post_status' => 'publish',
|
1056 |
+
'post_type' => Testimonials_Widget::pt,
|
1057 |
+
'posts_per_page' => $limit,
|
1058 |
+
);
|
1059 |
+
|
1060 |
+
if ( $paging && ! empty( $atts['paged'] ) && is_singular() ) {
|
1061 |
+
$args['paged'] = $atts['paged'];
|
1062 |
+
}
|
1063 |
|
1064 |
+
if ( ! $random && $meta_key ) {
|
1065 |
+
$args['meta_key'] = $meta_key;
|
1066 |
+
$args['orderby'] = 'meta_value';
|
1067 |
+
}
|
1068 |
+
|
1069 |
+
if ( $order ) {
|
1070 |
+
$args['order'] = $order;
|
1071 |
+
}
|
1072 |
+
|
1073 |
+
if ( $ids ) {
|
1074 |
+
$ids = explode( ',', $ids );
|
1075 |
+
|
1076 |
+
$args['post__in'] = $ids;
|
1077 |
+
|
1078 |
+
if ( 'none' == $args['orderby'] ) {
|
1079 |
+
add_filter( 'posts_results', array( 'Testimonials_Widget', 'posts_results_sort_none' ), 10, 2 );
|
1080 |
+
}
|
1081 |
+
}
|
1082 |
|
1083 |
+
if ( $exclude ) {
|
1084 |
+
$exclude = explode( ',', $exclude );
|
|
|
|
|
|
|
1085 |
|
1086 |
+
$args['post__not_in'] = $exclude;
|
1087 |
+
}
|
1088 |
+
|
1089 |
+
if ( $category ) {
|
1090 |
+
$args['category_name'] = $category;
|
1091 |
+
}
|
1092 |
+
|
1093 |
+
if ( $tags ) {
|
1094 |
+
$tags = explode( ',', $tags );
|
1095 |
+
|
1096 |
+
if ( $tags_all ) {
|
1097 |
+
$args['tag_slug__and'] = $tags;
|
1098 |
+
} else {
|
1099 |
+
$args['tag_slug__in'] = $tags;
|
1100 |
+
}
|
1101 |
+
}
|
1102 |
+
|
1103 |
+
$args = apply_filters( 'testimonials_widget_query_args', $args, $atts );
|
1104 |
+
|
1105 |
+
return $args;
|
1106 |
+
}
|
1107 |
+
|
1108 |
+
|
1109 |
+
public function get_testimonials( $atts ) {
|
1110 |
+
$hide_gravatar = $atts['hide_gravatar'];
|
1111 |
+
|
1112 |
+
$args = self::get_query_args( $atts );
|
1113 |
+
$args['query'] = true;
|
1114 |
+
|
1115 |
+
$testimonials = apply_filters( 'testimonials_widget_cache_get', false, $args );
|
1116 |
+
|
1117 |
+
if ( false === $testimonials ) {
|
1118 |
+
$testimonials = new WP_Query( $args );
|
1119 |
+
$testimonials = apply_filters( 'testimonials_widget_cache_set', $testimonials, $args );
|
1120 |
+
}
|
1121 |
+
|
1122 |
+
if ( has_filter( 'posts_results', array( 'Testimonials_Widget', 'posts_results_sort_none' ) ) ) {
|
1123 |
+
remove_filter( 'posts_results', array( 'Testimonials_Widget', 'posts_results_sort_none' ) );
|
1124 |
+
}
|
1125 |
+
|
1126 |
+
$this->max_num_pages = $testimonials->max_num_pages;
|
1127 |
+
$this->post_count = $testimonials->post_count;
|
1128 |
+
$this->wp_query = $testimonials;
|
1129 |
+
|
1130 |
+
wp_reset_postdata();
|
1131 |
+
|
1132 |
+
$image_size = apply_filters( 'testimonials_widget_image_size', 'thumbnail' );
|
1133 |
+
$gravatar_size = apply_filters( 'testimonials_widget_gravatar_size', 96 );
|
1134 |
+
|
1135 |
+
$testimonial_data = array();
|
1136 |
+
|
1137 |
+
if ( empty( $this->post_count ) )
|
1138 |
+
return $testimonial_data;
|
1139 |
+
|
1140 |
+
foreach( $testimonials->posts as $row ) {
|
1141 |
+
$post_id = $row->ID;
|
1142 |
+
|
1143 |
+
$email = get_post_meta( $post_id, 'testimonials-widget-email', true );
|
1144 |
+
|
1145 |
+
if ( has_post_thumbnail( $post_id ) ) {
|
1146 |
+
$image = get_the_post_thumbnail( $post_id, $image_size );
|
1147 |
+
} elseif ( ! $hide_gravatar && is_email( $email ) ) {
|
1148 |
+
$image = get_avatar( $email, $gravatar_size );
|
1149 |
+
} else {
|
1150 |
+
$image = false;
|
1151 |
+
}
|
1152 |
+
|
1153 |
+
$url = get_post_meta( $post_id, 'testimonials-widget-url', true );
|
1154 |
+
if ( ! empty( $url ) && 0 === preg_match( "#https?://#", $url ) ) {
|
1155 |
+
$url = 'http://' . $url;
|
1156 |
+
}
|
1157 |
+
|
1158 |
+
$data = array(
|
1159 |
+
'post_id' => $post_id,
|
1160 |
+
'testimonial_company' => get_post_meta( $post_id, 'testimonials-widget-company', true ),
|
1161 |
+
'testimonial_content' => $row->post_content,
|
1162 |
+
'testimonial_email' => $email,
|
1163 |
+
'testimonial_extra' => '',
|
1164 |
+
'testimonial_image' => $image,
|
1165 |
+
'testimonial_source' => $row->post_title,
|
1166 |
+
'testimonial_title' => get_post_meta( $post_id, 'testimonials-widget-title', true ),
|
1167 |
+
'testimonial_url' => $url,
|
1168 |
+
);
|
1169 |
+
|
1170 |
+
$testimonial_data[] = $data;
|
1171 |
+
}
|
1172 |
+
|
1173 |
+
$testimonial_data = apply_filters( 'testimonials_widget_data', $testimonial_data );
|
1174 |
+
|
1175 |
+
return $testimonial_data;
|
1176 |
+
}
|
1177 |
+
|
1178 |
+
|
1179 |
+
public function posts_results_sort_none( $posts, $query ) {
|
1180 |
+
$order = $query->query_vars['post__in'];
|
1181 |
+
if ( empty( $order ) )
|
1182 |
+
return $posts;
|
1183 |
+
|
1184 |
+
$posts_none_sorted = array();
|
1185 |
+
// put posts in same orders as post__in
|
1186 |
+
foreach( $order as $id ) {
|
1187 |
+
foreach( $posts as $key => $post ) {
|
1188 |
+
if ( $id == $post->ID ) {
|
1189 |
+
$posts_none_sorted[] = $post;
|
1190 |
+
unset( $posts[$key] );
|
1191 |
+
}
|
1192 |
+
}
|
1193 |
+
}
|
1194 |
+
|
1195 |
+
return $posts_none_sorted;
|
1196 |
+
}
|
1197 |
+
|
1198 |
+
|
1199 |
+
public function init_widgets() {
|
1200 |
+
require_once 'lib/testimonials-widget-widget.php';
|
1201 |
+
|
1202 |
+
register_widget( 'Testimonials_Widget_Widget' );
|
1203 |
+
}
|
1204 |
+
|
1205 |
+
|
1206 |
+
public function add_meta_box_testimonials_widget() {
|
1207 |
+
require_once( 'lib/metabox.class.php' );
|
1208 |
+
|
1209 |
+
$fields = array(
|
1210 |
+
array(
|
1211 |
+
'name' => __( 'Title', 'testimonials-widget' ),
|
1212 |
+
'id' => 'testimonials-widget-title',
|
1213 |
+
'type' => 'text',
|
1214 |
+
'desc' => '',
|
1215 |
+
),
|
1216 |
+
array(
|
1217 |
+
'name' => __( 'Email', 'testimonials-widget' ),
|
1218 |
+
'id' => 'testimonials-widget-email',
|
1219 |
+
'type' => 'text',
|
1220 |
+
'desc' => '',
|
1221 |
+
),
|
1222 |
+
array(
|
1223 |
+
'name' => __( 'Company', 'testimonials-widget' ),
|
1224 |
+
'id' => 'testimonials-widget-company',
|
1225 |
+
'type' => 'text',
|
1226 |
+
'desc' => '',
|
1227 |
+
),
|
1228 |
+
array(
|
1229 |
+
'name' => __( 'URL', 'testimonials-widget' ),
|
1230 |
+
'id' => 'testimonials-widget-url',
|
1231 |
+
'type' => 'text',
|
1232 |
+
'desc' => '',
|
1233 |
+
),
|
1234 |
+
);
|
1235 |
+
|
1236 |
+
$fields = apply_filters( 'testimonials_widget_meta_box', $fields );
|
1237 |
+
|
1238 |
+
$meta_box = redrokk_metabox_class::getInstance(
|
1239 |
+
self::old_name,
|
1240 |
+
array(
|
1241 |
+
'title' => __( 'Testimonial Data', 'testimonials-widget' ),
|
1242 |
+
'description' => '',
|
1243 |
+
'_object_types' => 'testimonials-widget',
|
1244 |
+
'priority' => 'high',
|
1245 |
+
'_fields' => $fields,
|
1246 |
+
)
|
1247 |
+
);
|
1248 |
+
}
|
1249 |
+
|
1250 |
+
|
1251 |
+
/**
|
1252 |
+
* Revise default new testimonial text
|
1253 |
+
*
|
1254 |
+
* Original author: Travis Ballard http://www.travisballard.com
|
1255 |
+
*
|
1256 |
+
* @param string $translation
|
1257 |
+
* @return string $translation
|
1258 |
+
*/
|
1259 |
+
public function gettext_testimonials( $translation ) {
|
1260 |
+
remove_action( 'gettext', array( &$this, 'gettext_testimonials' ) );
|
1261 |
+
|
1262 |
+
global $post;
|
1263 |
+
|
1264 |
+
if ( is_object( $post ) && self::pt == $post->post_type ) {
|
1265 |
+
switch( $translation ) {
|
1266 |
+
case __( 'Enter title here', 'testimonials-widget' ):
|
1267 |
+
return __( 'Enter testimonial source here', 'testimonials-widget' );
|
1268 |
+
break;
|
1269 |
+
}
|
1270 |
+
}
|
1271 |
+
|
1272 |
+
add_action( 'gettext', array( &$this, 'gettext_testimonials' ) );
|
1273 |
+
|
1274 |
+
return $translation;
|
1275 |
}
|
1276 |
|
1277 |
+
|
1278 |
+
/**
|
1279 |
+
* Update messages for custom post type
|
1280 |
+
*
|
1281 |
+
* Original author: Travis Ballard http://www.travisballard.com
|
1282 |
+
*
|
1283 |
+
* @param mixed $m
|
1284 |
+
* @return mixed $m
|
1285 |
+
*/
|
1286 |
+
public function post_updated_messages( $m ) {
|
1287 |
+
global $post;
|
1288 |
+
|
1289 |
+
$m[ self::pt ] = array(
|
1290 |
+
0 => '', // Unused. Messages start at index 1.
|
1291 |
+
1 => sprintf( __( 'Testimonial updated. <a href="%s">View testimonial</a>', 'testimonials-widget' ), esc_url( get_permalink( $post->ID ) ) ),
|
1292 |
+
2 => __( 'Custom field updated.', 'testimonials-widget' ),
|
1293 |
+
3 => __( 'Custom field deleted.', 'testimonials-widget' ),
|
1294 |
+
4 => __( 'Testimonial updated.', 'testimonials-widget' ),
|
1295 |
+
/* translators: %s: date and time of the revision */
|
1296 |
+
5 => isset( $_GET['revision'] ) ? sprintf( __( 'Testimonial restored to revision from %s', 'testimonials-widget' ), wp_post_revision_title( (int)$_GET['revision'], false ) ) : false,
|
1297 |
+
6 => sprintf( __( 'Testimonial published. <a href="%s">View testimonial</a>', 'testimonials-widget' ), esc_url( get_permalink( $post->ID ) ) ),
|
1298 |
+
7 => __( 'Testimonial saved.', 'testimonials-widget' ),
|
1299 |
+
8 => sprintf( __( 'Testimonial submitted. <a target="_blank" href="%s">Preview testimonial</a>', 'testimonials-widget' ), esc_url( add_query_arg( 'preview', 'true', get_permalink($post->ID) ) ) ),
|
1300 |
+
9 => sprintf( __( 'Testimonial scheduled for: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview testimonial</a>', 'testimonials-widget' ), date_i18n( 'M j, Y @ G:i', strtotime( $post->post_date ) ), esc_url( get_permalink( $post->ID ) ) ),
|
1301 |
+
10 => sprintf( __( 'Testimonial draft updated. <a target="_blank" href="%s">Preview testimonial</a>', 'testimonials-widget' ), esc_url( add_query_arg( 'preview', 'true', get_permalink( $post->ID ) ) ) )
|
1302 |
+
);
|
1303 |
+
|
1304 |
+
return $m;
|
1305 |
+
}
|
1306 |
+
|
1307 |
+
}
|
1308 |
+
|
1309 |
+
|
1310 |
+
$Testimonials_Widget = new Testimonials_Widget();
|
1311 |
+
|
1312 |
+
|
1313 |
+
function testimonialswidget_list( $atts = array() ) {
|
1314 |
+
global $Testimonials_Widget;
|
1315 |
+
|
1316 |
+
return $Testimonials_Widget->testimonialswidget_list( $atts );
|
1317 |
+
}
|
1318 |
+
|
1319 |
+
|
1320 |
+
function testimonialswidget_widget( $atts = array(), $widget_number = null ) {
|
1321 |
+
global $Testimonials_Widget;
|
1322 |
+
|
1323 |
+
if ( empty( $atts['random'] ) )
|
1324 |
+
$atts['random'] = 1;
|
1325 |
+
|
1326 |
+
return $Testimonials_Widget->testimonialswidget_widget( $atts, $widget_number );
|
1327 |
}
|
1328 |
|
1329 |
?>
|
wpml-config.xml
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<wpml-config>
|
2 |
+
<custom-fields>
|
3 |
+
<custom-field action="copy">testimonials-widget-url</custom-field>
|
4 |
+
<custom-field action="copy">testimonials-widget-email</custom-field>
|
5 |
+
<custom-field action="translate">testimonials-widget-company</custom-field>
|
6 |
+
<custom-field action="translate">testimonials-widget-title</custom-field>
|
7 |
+
<custom-field action="ignore">_testimonials-widget:testimonial_id</custom-field>
|
8 |
+
</custom-fields>
|
9 |
+
<custom-types>
|
10 |
+
<custom-type translate="1">testimonials-widget</custom-type>
|
11 |
+
</custom-types>
|
12 |
+
<taxonomies>
|
13 |
+
<taxonomy translate="1">category</taxonomy>
|
14 |
+
<taxonomy translate="1">post_tag</taxonomy>
|
15 |
+
</taxonomies>
|
16 |
+
</wpml-config>
|