Version Description
= 2.19.0 =
- CSS class
.title
is now.job-title
. Thank you Mark - Please resave your WordPress Admin > Testimonials > Settings so that missing aoptions are included again.
- Shortcode and theme function
testimonialswidget_list
being deprecated bytestimonials
- Shortcode and theme function
testimonialswidget_widget
being deprecated bytestimonials_slider
= 2.18.3 =
- CSS class
.hide
renamed.display-none
- This is the last version supporting pre-bxSlider options
= 2.18.2 =
- CSS class
.display-none
renamed.hide
= 2.18.1 =
- CSS is back to being always loaded in the header
- Removed "Use bxSlider?" and "Include IE7 CSS" from widget options
= 2.18.0 =
-
remove_hentry
is now true by default
= 2.16.0 =
- Requires PHP 5.3+
= 2.15.0 =
- If upgrading, bxSlider will not be enabled by default. You must enable it in your widget and global settings. CSS customizations must be reviewed to have the
.active
and.display-none
classes removed. The main.testimonials-widget-testimonial
class also need thedisplay: none;
andclear: left;
removed.
= 2.14.0 =
- 60 modifications See Changelog
- CSS wp_register_style and wp_enqueue_style slug changed from 'testimonials-widget' to 'Testimonials_Widget'
- Gravatar image size now based upon Thumbnail size in Media Settings
- Scripts
ksort
removed. Usearray_unshift
in yourtestimonials_widget_testimonials_js
filters instead. - Testimonials > Settings, General tab, option Enable Review Schema? is enabled by default.
= 2.13.6 =
- IE 7 CSS moved to separate file. Include via Testimonials > Settings if needed
= 2.12.0 =
- CSS and JavaScript renaming
-
bottom_text
renamed tobottom-text
-
close_quote
renamed toclose-quote
-
display_none
renamed todisplay-none
-
join_location
renamed tojoin-location
-
join_title
renamed tojoin-title
-
open_quote
renamed toopen-quote
-
testimonialswidget_testimonial
renamed totestimonials-widget-testimonial
-
testimonialswidget_testimonials
renamed totestimonials-widget-testimonials
-
= 2.11.3 =
- Correct filter name
testimonials_widget_next_posts_link
totestimonials_widget_next_posts_link_text
= 2.11.0 =
- CSS class names are simplified. For the most part, other than
testimonialswidget_testimonial
removetestimonialswidget_
from the CSS class name in your CSS customizations.- Ex:
.testimonialswidget_join
becomes.join
- Ex:
.testimonialswidget_author
becomes.author
- Ex:
- Testimonials are now formatted using
blockquote
thanq
for HTML5 compliance. If you needq
tag formatting, enable it at WP Admin > Testimonials > Settings, Compatibility & Reset tab-
cite
is nowdiv.credit
-
= 2.8.0 =
- Deprecated
-
hide_author
nowhide_source
-
- Removed filters
testimonials_widget_options_update
,testimonials_widget_options_form
- Use
testimonials_widget_validate_settings
andtestimonials_widget_settings
instead
- Use
- Renamed variable and related class
widget_text
tobottom_text
= 2.7.3 =
- Quotes are no longer handled via
q
,p:before
, orp:after
CSS. It's handled via.testimonialswidget_testimonial .testimonialswidget_open_quote:before
and.testimonialswidget_testimonial .testimonialswidget_close_quote:after
- 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.
= 2.7.0 =
- 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
- Widget testimonial
p
tags are no longer CSSdisplay: inline
,display: block
as expected
= 2.4.1 =
- Paging is on by default, except for widgets
= 2.0.0 =
- CSS
- Class
testimonialswidget_company
replacestestimonialswidget_source
- Class
testimonialswidget_source
replacestestimonialswidget_author
- The tighten widget display up, p tags within q are displayed inline.
- Class
- JavaScript
- The JavaScript for rotating testimonials is moved to the footer. As such, your theme requires
wp_footer()
in the footer.
- The JavaScript for rotating testimonials is moved to the footer. As such, your theme requires
- Shortcode options
-
hide_source
replaced byhide_url
-
hide_author
replaced byhide_source
-
- Testimonials
- Migration from the old custom table to new custom post type is automatically done. Import might take a few moments to complete.
- 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 thesource
is an email, it's saved as such. Otherwise, it's assumed to be a URL. - Public testimonials are saved as Published. Non-public testimonials are marked as Private.
- Widget options
- "Show author" and "Show source" options are replaced by "Hide source" and "Hide URL" respectively. There's no backwards compatibility for these changes.
- Default
min-height
is now 250px than 150px.
Download this release
Release Info
Developer | comprock |
Plugin | Testimonials Widget |
Version | 2.19.2 |
Comparing to | |
See all releases |
Code changes from version 2.19.1 to 2.19.2
- CHANGELOG.md +4 -0
- includes/libraries/aihrus-framework/CHANGELOG.md +1 -1
- includes/libraries/aihrus-framework/aihrus-framework.php +1 -1
- languages/testimonials-widget.pot +2 -2
- readme.txt +26 -26
- testimonials-widget.php +2 -2
- trunk/API.md +0 -188
- trunk/CHANGELOG.md +0 -1272
- trunk/CONTRIBUTING.md +0 -39
- trunk/LICENSE +0 -339
- trunk/README.md +0 -42
- trunk/assets/css/images/bx_loader.gif +0 -0
- trunk/assets/css/images/controls.png +0 -0
- trunk/assets/css/jquery.bxslider.css +0 -204
- trunk/assets/css/testimonials-widget-2.14.0.css +0 -120
- trunk/assets/css/testimonials-widget-ie7.css +0 -15
- trunk/assets/css/testimonials-widget.css +0 -124
- trunk/assets/images/michael-cannon-red-square-300x2251.jpg +0 -0
- trunk/assets/js/jquery.bxslider.js +0 -1343
- trunk/assets/js/jquery.bxslider.min.js +0 -10
- trunk/assets/js/jquery.easing.1.3.js +0 -205
- trunk/assets/js/jquery.fitvids.js +0 -80
- trunk/includes/class-testimonials-widget-settings.php +0 -1074
- trunk/includes/class-testimonials-widget-widget.php +0 -117
- trunk/includes/class-testimonials-widget.php +0 -2167
- trunk/includes/libraries/aihrus-framework/CHANGELOG.md +0 -96
- trunk/includes/libraries/aihrus-framework/LICENSE +0 -339
- trunk/includes/libraries/aihrus-framework/README.md +0 -74
- trunk/includes/libraries/aihrus-framework/aihrus-framework.php +0 -341
- trunk/includes/libraries/aihrus-framework/class-aihrus-common.php +0 -462
- trunk/includes/libraries/aihrus-framework/class-aihrus-licensing.php +0 -188
- trunk/includes/libraries/aihrus-framework/class-aihrus-settings.php +0 -757
- trunk/includes/libraries/aihrus-framework/class-aihrus-widget.php +0 -252
- trunk/includes/libraries/aihrus-framework/includes/class-aihrus-common.php +0 -468
- trunk/includes/libraries/aihrus-framework/includes/class-aihrus-licensing.php +0 -188
- trunk/includes/libraries/aihrus-framework/includes/class-aihrus-settings.php +0 -784
- trunk/includes/libraries/aihrus-framework/includes/class-aihrus-widget.php +0 -254
- trunk/includes/libraries/aihrus-framework/includes/interface-aihrus-common.php +0 -27
- trunk/includes/libraries/aihrus-framework/includes/interface-aihrus-licensing.php +0 -28
- trunk/includes/libraries/aihrus-framework/includes/interface-aihrus-widget.php +0 -33
- trunk/includes/libraries/aihrus-framework/includes/libraries/class-redrokk-metabox-class.php +0 -1470
- trunk/includes/libraries/aihrus-framework/includes/libraries/wp_custom_post_status.php +0 -230
- trunk/includes/libraries/aihrus-framework/interface-aihrus-common.php +0 -27
- trunk/includes/libraries/aihrus-framework/interface-aihrus-licensing.php +0 -28
- trunk/includes/libraries/aihrus-framework/interface-aihrus-widget.php +0 -33
- trunk/includes/libraries/aihrus-framework/requirements.php +0 -270
- trunk/includes/libraries/class-redrokk-metabox-class.php +0 -1436
- trunk/includes/requirements.php +0 -67
- trunk/languages/testimonials-widget-he_IL.mo +0 -0
- trunk/languages/testimonials-widget-he_IL.po +0 -546
- trunk/languages/testimonials-widget-nl_NL.mo +0 -0
- trunk/languages/testimonials-widget-nl_NL.po +0 -631
- trunk/languages/testimonials-widget.pot +0 -963
- trunk/readme.txt +0 -588
- trunk/testimonials-widget.php +0 -134
- trunk/wpml-config.xml +0 -19
CHANGELOG.md
CHANGED
@@ -2,6 +2,10 @@
|
|
2 |
|
3 |
## master
|
4 |
|
|
|
|
|
|
|
|
|
5 |
## 2.19.1
|
6 |
* Please resave your Testimonials > Settings and Widget options for defaults to be corrected
|
7 |
* Remove unsued `widget_options`
|
2 |
|
3 |
## master
|
4 |
|
5 |
+
## 2.19.2
|
6 |
+
|
7 |
+
* Force WordPress to update files
|
8 |
+
|
9 |
## 2.19.1
|
10 |
* Please resave your Testimonials > Settings and Widget options for defaults to be corrected
|
11 |
* Remove unsued `widget_options`
|
includes/libraries/aihrus-framework/CHANGELOG.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
## master
|
4 |
|
5 |
-
## 1.1.
|
6 |
* Remove unused `widget_options`
|
7 |
* RESOLVE michael-cannon/testimonials-widget#65 Widget blank options aren't saving correctly
|
8 |
|
2 |
|
3 |
## master
|
4 |
|
5 |
+
## 1.1.1
|
6 |
* Remove unused `widget_options`
|
7 |
* RESOLVE michael-cannon/testimonials-widget#65 Widget blank options aren't saving correctly
|
8 |
|
includes/libraries/aihrus-framework/aihrus-framework.php
CHANGED
@@ -29,7 +29,7 @@ if ( ! defined( 'AIHR_DIR_LIB' ) )
|
|
29 |
define( 'AIHR_DIR_LIB', AIHR_DIR_INC . 'libraries/' );
|
30 |
|
31 |
if ( ! defined( 'AIHR_VERSION' ) )
|
32 |
-
define( 'AIHR_VERSION', '1.1.
|
33 |
|
34 |
require_once ABSPATH . 'wp-admin/includes/plugin.php';
|
35 |
|
29 |
define( 'AIHR_DIR_LIB', AIHR_DIR_INC . 'libraries/' );
|
30 |
|
31 |
if ( ! defined( 'AIHR_VERSION' ) )
|
32 |
+
define( 'AIHR_VERSION', '1.1.1' );
|
33 |
|
34 |
require_once ABSPATH . 'wp-admin/includes/plugin.php';
|
35 |
|
languages/testimonials-widget.pot
CHANGED
@@ -2,9 +2,9 @@
|
|
2 |
# This file is distributed under the same license as the Testimonials by Aihrus package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Testimonials by Aihrus 2.19.
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/testimonials-widget\n"
|
7 |
-
"POT-Creation-Date: 2014-04-08
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
2 |
# This file is distributed under the same license as the Testimonials by Aihrus package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Testimonials by Aihrus 2.19.2\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/testimonials-widget\n"
|
7 |
+
"POT-Creation-Date: 2014-04-08 07:47:03+00:00\n"
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ Donate link: http://aihr.us/about-aihrus/donate/
|
|
5 |
Tags: client, customer, portfolio, quotations, quote, quotes, random, recommendation, reference, review, reviews, testimonial, testimonials, testimony, wpml
|
6 |
Requires at least: 3.6
|
7 |
Tested up to: 3.9.0
|
8 |
-
Stable tag: 2.19.
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
@@ -62,8 +62,8 @@ The single testimonial view supports image, source, title, location, email, comp
|
|
62 |
|
63 |
= Shortcodes =
|
64 |
|
65 |
-
* `[
|
66 |
-
* `[
|
67 |
|
68 |
= Theme Functions =
|
69 |
|
@@ -97,9 +97,9 @@ Testimonials Premium adds onto the best WordPress testimonials plugin there is,
|
|
97 |
|
98 |
= Premium Shortcodes =
|
99 |
|
100 |
-
* Count of testimonials `[
|
101 |
-
* List of testimonial source and title linking to full entry `[
|
102 |
-
* Testimonials entry form `[
|
103 |
|
104 |
= Premium Theme Functions =
|
105 |
|
@@ -156,23 +156,23 @@ Testimonials Premium adds onto the best WordPress testimonials plugin there is,
|
|
156 |
|
157 |
= Shortcode Examples =
|
158 |
|
159 |
-
**[
|
160 |
|
161 |
-
* `[
|
162 |
-
* `[
|
163 |
-
* `[
|
164 |
-
* `[
|
165 |
-
* `[
|
166 |
-
* `[
|
167 |
-
* `[
|
168 |
-
* `[
|
169 |
-
* `[
|
170 |
-
* `[
|
171 |
|
172 |
-
**[
|
173 |
|
174 |
-
* `[
|
175 |
-
* `[
|
176 |
|
177 |
= Shortcode and Widget Options =
|
178 |
|
@@ -216,7 +216,7 @@ Further, global settings are the baseline for shortcodes. If you want to alter t
|
|
216 |
* `exclude_bxslider_css` - default show; exclude_bxslider_css=true
|
217 |
* URL Target - Add target to all URLs; leave blank if none
|
218 |
* `target` - default none; target=_new
|
219 |
-
* Enable Paging? - for [
|
220 |
* `paging` - default true [true|before|after|false]; paging=false
|
221 |
* `true` – display paging before and after testimonial entries
|
222 |
* `before` – display paging only before testimonial entries
|
@@ -342,7 +342,7 @@ Further, global settings are the baseline for shortcodes. If you want to alter t
|
|
342 |
1. Add and manage testimonials through the "Testimonials" menu in the WordPress admin area
|
343 |
1. To display testimonials in the sidebar, go to "Widgets" menu and drag "Testimonials" widget into the desired widget area
|
344 |
1. Configure "Testimonials" to select quotes and display as needed
|
345 |
-
1. Use the `[
|
346 |
1. Read [theme functions usage](https://aihrus.zendesk.com/entries/23702878) for `testimonials()` and `testimonials_slider()`
|
347 |
|
348 |
= Upgrading =
|
@@ -388,8 +388,8 @@ Further, global settings are the baseline for shortcodes. If you want to alter t
|
|
388 |
2. Collapsed Testimonials options
|
389 |
3. Expanded "General Options" in Testimonials options
|
390 |
4. Testimonial widget in the sidebar
|
391 |
-
5. [
|
392 |
-
6. [
|
393 |
7. Widget whitespace kept
|
394 |
8. Widget with clickable title and custom text/HTML on bottom
|
395 |
9. [WP-PageNavi compatible](http://wordpress.org/extend/plugins/wp-pagenavi/) for page numbers than default arrows
|
@@ -557,8 +557,8 @@ Prior to version 2.0.0, this plugin was a fork of [Quotes Collection](http://sri
|
|
557 |
|
558 |
= Deprecated Shortcodes =
|
559 |
|
560 |
-
* `[
|
561 |
-
* `[
|
562 |
|
563 |
= Deprecated Theme Functions =
|
564 |
|
5 |
Tags: client, customer, portfolio, quotations, quote, quotes, random, recommendation, reference, review, reviews, testimonial, testimonials, testimony, wpml
|
6 |
Requires at least: 3.6
|
7 |
Tested up to: 3.9.0
|
8 |
+
Stable tag: 2.19.3RC1
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
62 |
|
63 |
= Shortcodes =
|
64 |
|
65 |
+
* `[testimonials]` - Listings with paging
|
66 |
+
* `[testimonials_slider]` - Rotating
|
67 |
|
68 |
= Theme Functions =
|
69 |
|
97 |
|
98 |
= Premium Shortcodes =
|
99 |
|
100 |
+
* Count of testimonials `[testimonials_count]`
|
101 |
+
* List of testimonial source and title linking to full entry `[testimonials_links]`
|
102 |
+
* Testimonials entry form `[testimonials_form]`
|
103 |
|
104 |
= Premium Theme Functions =
|
105 |
|
156 |
|
157 |
= Shortcode Examples =
|
158 |
|
159 |
+
**[testimonials]**
|
160 |
|
161 |
+
* `[testimonials category="category-name"]` - Testimonial list by category
|
162 |
+
* `[testimonials category=product hide_not_found=true]` - Testimonial list by category and hide "No testimonials found" message
|
163 |
+
* `[testimonials category=product tags=widget limit=5]` - Testimonial list by tag, showing 5 at most
|
164 |
+
* `[testimonials char_limit=0 limit=-1]` - Show all testimonials on one page
|
165 |
+
* `[testimonials char_limit=0 target=_new limit=3 disable_quotes=true]` - Show 3 full-length testimonials, with opening and closing quote marks removed
|
166 |
+
* `[testimonials hide_source=true hide_url=true]` - Show testimonial list with source and urls hidden
|
167 |
+
* `[testimonials ids="1,11,111" paging=false]` - Show only these 3 testimonials
|
168 |
+
* `[testimonials meta_key=testimonials-widget-company order=asc limit=15]` - Show 15 testimonials, in company order
|
169 |
+
* `[testimonials order=ASC orderby=title]` - List testimonials by post title
|
170 |
+
* `[testimonials tags="test,fun" random=true exclude="2,22,333"]` - Select testimonials tagged with either "test" or "fun", in random order, but ignore those of the excluded ids
|
171 |
|
172 |
+
**[testimonials_slider]**
|
173 |
|
174 |
+
* `[testimonials_slider category=product order=asc]` - Show rotating testimonials, of the product category, lowest post ids first
|
175 |
+
* `[testimonials_slider tags=sometag random=true]` - Show rotating, random testimonials having tag "sometag"
|
176 |
|
177 |
= Shortcode and Widget Options =
|
178 |
|
216 |
* `exclude_bxslider_css` - default show; exclude_bxslider_css=true
|
217 |
* URL Target - Add target to all URLs; leave blank if none
|
218 |
* `target` - default none; target=_new
|
219 |
+
* Enable Paging? - for [testimonials]
|
220 |
* `paging` - default true [true|before|after|false]; paging=false
|
221 |
* `true` – display paging before and after testimonial entries
|
222 |
* `before` – display paging only before testimonial entries
|
342 |
1. Add and manage testimonials through the "Testimonials" menu in the WordPress admin area
|
343 |
1. To display testimonials in the sidebar, go to "Widgets" menu and drag "Testimonials" widget into the desired widget area
|
344 |
1. Configure "Testimonials" to select quotes and display as needed
|
345 |
+
1. Use the `[testimonials]` or `[testimonials_slider]` shortcodes to display testimonials on a page or in a post
|
346 |
1. Read [theme functions usage](https://aihrus.zendesk.com/entries/23702878) for `testimonials()` and `testimonials_slider()`
|
347 |
|
348 |
= Upgrading =
|
388 |
2. Collapsed Testimonials options
|
389 |
3. Expanded "General Options" in Testimonials options
|
390 |
4. Testimonial widget in the sidebar
|
391 |
+
5. [testimonials] in post
|
392 |
+
6. [testimonials] results with paging
|
393 |
7. Widget whitespace kept
|
394 |
8. Widget with clickable title and custom text/HTML on bottom
|
395 |
9. [WP-PageNavi compatible](http://wordpress.org/extend/plugins/wp-pagenavi/) for page numbers than default arrows
|
557 |
|
558 |
= Deprecated Shortcodes =
|
559 |
|
560 |
+
* `[testimonialswidget_list]` - Listings with paging
|
561 |
+
* `[testimonialswidget_widget]` - Rotating
|
562 |
|
563 |
= Deprecated Theme Functions =
|
564 |
|
testimonials-widget.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: Testimonials by Aihrus
|
4 |
* Plugin URI: http://wordpress.org/plugins/testimonials-widget/
|
5 |
* Description: Testimonials by Aihrus lets you randomly slide or list selected portfolios, quotes, reviews, or text with images or videos on your WordPress site.
|
6 |
-
* Version: 2.19.
|
7 |
* Author: Michael Cannon
|
8 |
* Author URI: http://aihr.us/resume/
|
9 |
* License: GPLv2 or later
|
@@ -52,7 +52,7 @@ if ( ! defined( 'TW_PREMIUM_LINK' ) )
|
|
52 |
define( 'TW_PREMIUM_LINK', '<a href="http://aihr.us/downloads/testimonials-widget-premium-wordpress-plugin/">Buy Premium</a>' );
|
53 |
|
54 |
if ( ! defined( 'TW_VERSION' ) )
|
55 |
-
define( 'TW_VERSION', '2.19.
|
56 |
|
57 |
require_once TW_DIR_INC . 'requirements.php';
|
58 |
|
3 |
* Plugin Name: Testimonials by Aihrus
|
4 |
* Plugin URI: http://wordpress.org/plugins/testimonials-widget/
|
5 |
* Description: Testimonials by Aihrus lets you randomly slide or list selected portfolios, quotes, reviews, or text with images or videos on your WordPress site.
|
6 |
+
* Version: 2.19.2
|
7 |
* Author: Michael Cannon
|
8 |
* Author URI: http://aihr.us/resume/
|
9 |
* License: GPLv2 or later
|
52 |
define( 'TW_PREMIUM_LINK', '<a href="http://aihr.us/downloads/testimonials-widget-premium-wordpress-plugin/">Buy Premium</a>' );
|
53 |
|
54 |
if ( ! defined( 'TW_VERSION' ) )
|
55 |
+
define( 'TW_VERSION', '2.19.2' );
|
56 |
|
57 |
require_once TW_DIR_INC . 'requirements.php';
|
58 |
|
trunk/API.md
DELETED
@@ -1,188 +0,0 @@
|
|
1 |
-
# API Testimonials
|
2 |
-
|
3 |
-
The [Testimonials plugin](http://wordpress.org/plugins/testimonials-widget/) comes with its own set of actions and filters, as described below.
|
4 |
-
|
5 |
-
## Actions
|
6 |
-
|
7 |
-
* `testimonials_widget_settings_add_help_tabs`
|
8 |
-
|
9 |
-
Modify the settings page help tabs.
|
10 |
-
|
11 |
-
* `testimonials_widget_scripts`
|
12 |
-
|
13 |
-
Make additional `wp_register_script` and `wp_enqueue_script` calls as needed.
|
14 |
-
|
15 |
-
* `testimonials_widget_styles`
|
16 |
-
|
17 |
-
Make additional `wp_register_style` and `wp_enqueue_style` calls as needed.
|
18 |
-
|
19 |
-
* `testimonials_widget_update`
|
20 |
-
|
21 |
-
Make additional update related calls as needed.
|
22 |
-
|
23 |
-
## Filters
|
24 |
-
|
25 |
-
### Frontend
|
26 |
-
|
27 |
-
* `testimonials_widget_cite_html`
|
28 |
-
|
29 |
-
Adjust cite contents. [example](https://aihrus.zendesk.com/entries/24012926-How-do-I-add-the-date-to-the-cite-)
|
30 |
-
|
31 |
-
* `testimonials_widget_content_more`
|
32 |
-
|
33 |
-
More content ellipsis. [example](https://aihrus.zendesk.com/entries/23691577-How-do-I-change-the-more-content-ellipsis-)
|
34 |
-
|
35 |
-
* `testimonials_widget_get_testimonials_html`
|
36 |
-
|
37 |
-
Customize the contents and layout within `get_testimonials_html`.
|
38 |
-
|
39 |
-
* `testimonials_widget_get_testimonial_html`
|
40 |
-
|
41 |
-
Customize testimonial contents and layout within `get_testimonial_html`. Useful for moving processed parts around than regenerating everything from scratch.. [example](https://aihrus.zendesk.com/entries/23693433-How-do-I-use-filter-testimonials-widget-get-testimonial-html-)
|
42 |
-
|
43 |
-
* `testimonials_widget_gravatar_size`
|
44 |
-
|
45 |
-
Change the Gravatar size. [example](https://aihrus.zendesk.com/entries/23679271-How-do-I-change-the-Gravatar-size-)
|
46 |
-
|
47 |
-
* `testimonials_widget_image_size`
|
48 |
-
|
49 |
-
Change the image size. [example](https://aihrus.zendesk.com/entries/23677122-How-do-I-change-the-image-size-)
|
50 |
-
|
51 |
-
* `testimonials_widget_next_posts_link_text`
|
52 |
-
|
53 |
-
Configure Next page indicator. [example](https://aihrus.zendesk.com/entries/23691587-How-do-I-configure-Next-and-Previous-page-indicators-)
|
54 |
-
|
55 |
-
* `testimonials_widget_previous_posts_link_text`
|
56 |
-
|
57 |
-
Configure Previous page indicator. [example](https://aihrus.zendesk.com/entries/23691587-How-do-I-configure-Next-and-Previous-page-indicators-)
|
58 |
-
|
59 |
-
* `testimonials_widget_testimonial_html_single_content`
|
60 |
-
|
61 |
-
Customize single view content before appending filter `testimonials_widget_testimonial_html_single` results. [example](https://gist.github.com/michael-cannon/5833657)
|
62 |
-
|
63 |
-
* `testimonials_widget_testimonial_html_single`
|
64 |
-
|
65 |
-
Customize testimonials single view output post `get_testimonial_html`. [example](https://aihrus.zendesk.com/entries/23679391-How-do-I-customize-my-testimonial-single-output-)
|
66 |
-
|
67 |
-
* `testimonials_widget_testimonial_html`
|
68 |
-
|
69 |
-
Customize testimonials list and widget output post `get_testimonial_html`. [example](https://aihrus.zendesk.com/entries/23693413-How-do-I-customize-my-testimonial-list-and-widget-output-)
|
70 |
-
|
71 |
-
* `testimonials_widget_get_testimonial_html_class`
|
72 |
-
|
73 |
-
Alter dynamically generated CSS per testimonial
|
74 |
-
|
75 |
-
* `testimonials_widget_testimonials_css`
|
76 |
-
|
77 |
-
Alter dynamically generated CSS
|
78 |
-
|
79 |
-
* `testimonials_widget_testimonials_js`
|
80 |
-
|
81 |
-
Alter dynamically generated JavaScript. [example](https://gist.github.com/michael-cannon/5833678)
|
82 |
-
|
83 |
-
* `testimonials_widget_testimonials_js_internal`
|
84 |
-
|
85 |
-
Inject dynamically generated JavaScript to `active/next` functional area..
|
86 |
-
|
87 |
-
* `testimonials_widget_wp_pagenavi`
|
88 |
-
|
89 |
-
Configure WP-PageNavi specifically for Testimonial Widgets. [example](https://aihrus.zendesk.com/entries/23679361-How-do-I-get-page-numbers-for-pagination-)
|
90 |
-
|
91 |
-
* `testimonials_widget_review_name_length`
|
92 |
-
|
93 |
-
Maximium length of review schema's name. Default is 156 characters.
|
94 |
-
|
95 |
-
* `testimonials_widget_schema`
|
96 |
-
|
97 |
-
Customize schema contents.
|
98 |
-
|
99 |
-
* `testimonials_widget_schema_review`
|
100 |
-
|
101 |
-
Customize schema review meta contents.
|
102 |
-
|
103 |
-
* `testimonials_widget_schema_agg_rating`
|
104 |
-
|
105 |
-
Customize schema aggregate rating for item.
|
106 |
-
|
107 |
-
* `testimonials_widget_schema_author`
|
108 |
-
|
109 |
-
Customize schema author contents.
|
110 |
-
|
111 |
-
* `testimonials_widget_schema_item`
|
112 |
-
|
113 |
-
Customize schema reviewed item contents.
|
114 |
-
|
115 |
-
|
116 |
-
### Backend
|
117 |
-
|
118 |
-
* `testimonials_widget_cache_get`
|
119 |
-
|
120 |
-
Caching grabber. [example](https://gist.github.com/michael-cannon/5833685)
|
121 |
-
|
122 |
-
* `testimonials_widget_cache_set`
|
123 |
-
|
124 |
-
Caching setter. [example](https://gist.github.com/michael-cannon/5833685)
|
125 |
-
|
126 |
-
* `testimonials_widget_columns`
|
127 |
-
|
128 |
-
Customize testimonial posts column headers. [example](https://gist.github.com/michael-cannon/5833693)
|
129 |
-
|
130 |
-
* `testimonials_widget_content`
|
131 |
-
|
132 |
-
Testimonial content parser helper. [example](https://gist.github.com/michael-cannon/5833700)
|
133 |
-
|
134 |
-
* `testimonials_widget_data`
|
135 |
-
|
136 |
-
Process testimonials data before display processing. [example](https://aihrus.zendesk.com/entries/23692056-How-do-I-filter-the-testimonials-data-before-display-processing-)
|
137 |
-
|
138 |
-
* `testimonials_widget_defaults_single`
|
139 |
-
|
140 |
-
Create a global or central Testimonials configuration for single view. [example](https://aihrus.zendesk.com/entries/23679071-How-do-I-add-testimonial-excerpt-to-single-view-). [example](https://aihrus.zendesk.com/entries/23679111-How-do-I-show-the-expert-and-hide-the-image-in-the-testimonial-single-view-)
|
141 |
-
|
142 |
-
* `testimonials_widget_defaults`
|
143 |
-
|
144 |
-
Create a global or central Testimonials configuration. [example](https://aihrus.zendesk.com/entries/23691607-How-do-I-use-filter-testimonials-widget-defaults-)
|
145 |
-
|
146 |
-
* `testimonials_widget_meta_box`
|
147 |
-
|
148 |
-
Modify Testimonial Data fields. [example](https://gist.github.com/michael-cannon/5833704)
|
149 |
-
|
150 |
-
* `testimonials_widget_posts_custom_column`
|
151 |
-
|
152 |
-
Customize testimonial posts column contents. [example](https://gist.github.com/michael-cannon/5833716)
|
153 |
-
|
154 |
-
* `testimonials_widget_query_args`
|
155 |
-
|
156 |
-
Alter WP_Query arguments for testimonial selection. [example](https://gist.github.com/michael-cannon/5833740)
|
157 |
-
|
158 |
-
* `testimonials_widget_sections`
|
159 |
-
|
160 |
-
Alter section options. [example](https://gist.github.com/michael-cannon/5833757)
|
161 |
-
|
162 |
-
* `testimonials_widget_settings`
|
163 |
-
|
164 |
-
Alter setting options. [example](https://gist.github.com/michael-cannon/5833757)
|
165 |
-
|
166 |
-
* `testimonials_widget_validate_settings`
|
167 |
-
|
168 |
-
Validate settings helper. [example](https://gist.github.com/michael-cannon/5833768)
|
169 |
-
|
170 |
-
* `testimonials_widget_version`
|
171 |
-
|
172 |
-
Version tracking for settings. [example](https://gist.github.com/michael-cannon/5833774)
|
173 |
-
|
174 |
-
* `testimonials_widget_widget_options`
|
175 |
-
|
176 |
-
Alters displayed widget options. [example](https://gist.github.com/michael-cannon/5833782)
|
177 |
-
|
178 |
-
* `testimonials_widget_display_setting`
|
179 |
-
|
180 |
-
Alows for display of custom input types.
|
181 |
-
|
182 |
-
* `testimonials_widget_settings_defaults`
|
183 |
-
|
184 |
-
Override settings defaults with your own.
|
185 |
-
|
186 |
-
## Need More?
|
187 |
-
|
188 |
-
Further examples and more can be found by reading and searching the [Testimonials Knowledge Base](https://aihrus.zendesk.com/categories/20104507-Testimonials-Widget) and [source code](https://github.com/michael-cannon/testimonials-widget).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trunk/CHANGELOG.md
DELETED
@@ -1,1272 +0,0 @@
|
|
1 |
-
# CHANGELOG Testimonials by Aihrus
|
2 |
-
|
3 |
-
## master
|
4 |
-
|
5 |
-
## 2.19.1
|
6 |
-
* Please resave your Testimonials > Settings and Widget options for defaults to be corrected
|
7 |
-
* Remove unsued `widget_options`
|
8 |
-
* Require Aihrus 1.1.1
|
9 |
-
|
10 |
-
## 2.19.0
|
11 |
-
* Add screenshot 22. Testimonials Settings > Columns tab
|
12 |
-
* Check system requirements after update
|
13 |
-
* CSS class `.title` is now `.job-title`. Thank you Mark
|
14 |
-
* Only check system requirements once a week
|
15 |
-
* Please resave your WordPress Admin > Testimonials > Settings so that missing aoptions are included again.
|
16 |
-
* RELATE #64 Remove deprecated options and codes
|
17 |
-
* Require Aihrus 1.1.0
|
18 |
-
* RESOLVE #20 Simplify shortcodes
|
19 |
-
* RESOLVE #45 Plugin Disables Itself
|
20 |
-
* RESOLVE #56 Prevent edit page column overload
|
21 |
-
* RESOLVE #67 Use .job-title than .title for job title span class
|
22 |
-
* RESOLVE #76 Undefined index: hide_image_single
|
23 |
-
* Revise Aihrus framework includes
|
24 |
-
* Revise version_check
|
25 |
-
* Shortcode and theme function `testimonialswidget_list` being deprecated by `testimonials`
|
26 |
-
* Shortcode and theme function `testimonialswidget_widget` being deprecated by `testimonials_slider`
|
27 |
-
* Update BxSlider v4.1.2
|
28 |
-
* Use aihr_deactivate_plugin call to deactivate
|
29 |
-
|
30 |
-
## 2.18.4
|
31 |
-
* RESOLVE #69 Disallow .display-none when only 1 testimonials or no refresh_interval
|
32 |
-
|
33 |
-
## 2.18.3
|
34 |
-
* Add option "Exclude bxSlider CSS?"
|
35 |
-
* Exit if accessed directly
|
36 |
-
* Initially no show bxSlider widget testimonials entries
|
37 |
-
* RESOLVE #61 Horizontal transitions not working in widget
|
38 |
-
* RESOLVE #62 Bootstrap class name hide conflict
|
39 |
-
* RESOLVE #65 Widget blank options aren't saving correctly
|
40 |
-
* Update copyright year
|
41 |
-
|
42 |
-
## 2.18.2
|
43 |
-
* RESOLVE #57 Testimonials Stacking on first load
|
44 |
-
|
45 |
-
## 2.18.1
|
46 |
-
* Add FAQ How do I create a testimonial record?
|
47 |
-
* Add screenshot 21. Shortcode helpers on category and tag admin screens
|
48 |
-
* Correct Codeship image include
|
49 |
-
* jQuery 1.10+ note
|
50 |
-
* Remove "Use bxSlider?" and "Include IE7 CSS" from widget options
|
51 |
-
* Remove option "Always Load CSS?" `force_css_loading`
|
52 |
-
* Remove Travis CI configuration. Using Codeship.io instead
|
53 |
-
* Require Aihrus Framework 1.0.3
|
54 |
-
* RESOLVE #2 Add shortcode column to categories page
|
55 |
-
* RESOLVE #3 Add shortcode column to tags page
|
56 |
-
* RESOLVE #54 Notice: Constant TW_AIHR_VERSION already defined
|
57 |
-
* RESOLVE #8 Validate HTML
|
58 |
-
* RESOLVE Featured image via Gravatar not saving correctly
|
59 |
-
* RESOLVE Not passing requirements failure to premium plugin
|
60 |
-
* RESOLVE Schema output cluttered up single view
|
61 |
-
* RESOLVE Scripts not loading in footer
|
62 |
-
* Support JetPack's Publicize module
|
63 |
-
* Verbiage updates
|
64 |
-
* Widgets don't rotate notice
|
65 |
-
|
66 |
-
## 2.18.0
|
67 |
-
* Add Codeship.io status
|
68 |
-
* Check for init and theme functions to exist
|
69 |
-
* CLOSE #11 Conflicts with "Re-order posts within Categories"
|
70 |
-
* Link to Testimonials by WooThemes migrator
|
71 |
-
* Move ci to tests
|
72 |
-
* Move CSS to assets
|
73 |
-
* Move files to assets
|
74 |
-
* Move lib to includes/libraries
|
75 |
-
* Move main class to own class file
|
76 |
-
* Remove Travis CI status
|
77 |
-
* RESOLVE #43 hatom feed errors
|
78 |
-
* RESOLVE #45 Plugin Disables Itself
|
79 |
-
* RESOLVE #7 Support subdirectory testimonial landing page
|
80 |
-
* RESOLVE Non-SSL protocol used for scripts and styles
|
81 |
-
* Revise required file paths
|
82 |
-
* Specify a “Text Domain” and “Domain Path”
|
83 |
-
* Update shortcode examples
|
84 |
-
* Update verbiage
|
85 |
-
* Use $plugin_assets than $plugin_path
|
86 |
-
|
87 |
-
## 2.17.3
|
88 |
-
* RESOLVE #44 Blank testimonial between each rotating testimonial
|
89 |
-
|
90 |
-
## 2.17.2
|
91 |
-
* RESOLVE Testimonials Premium load issue
|
92 |
-
* RESOLVE [Testimonial box displays as all white in widget on IE9](http://wordpress.org/support/topic/testimonial-box-displays-as-all-white-in-widget-on-ie9). Thank you [jbmoore](http://wordpress.org/support/profile/jbmoore)
|
93 |
-
|
94 |
-
## 2.17.1
|
95 |
-
* No show premium link when it's installed
|
96 |
-
* RESOLVE #34 Non-SSL protocol used for image inclusion
|
97 |
-
* Use Aihrus Framework 1.0.1
|
98 |
-
* Use aihr_check_aihrus_framework
|
99 |
-
* Use strip_protocol
|
100 |
-
|
101 |
-
## 2.17.0
|
102 |
-
* BUGFIX No notices on deactivation
|
103 |
-
* Convert TODO to https://github.com/michael-cannon/testimonials-widget/issues
|
104 |
-
* Implement PHP version checking
|
105 |
-
* Implement WordPress version checking
|
106 |
-
* Restructure readme
|
107 |
-
* Tested up to 3.9.0
|
108 |
-
|
109 |
-
## 2.16.6
|
110 |
-
* BUGFIX Widget title is same as link
|
111 |
-
|
112 |
-
## 2.16.5
|
113 |
-
* BUGFIX Setting's defaults missing during validation
|
114 |
-
|
115 |
-
## 2.16.4
|
116 |
-
* BUGFIX #1 Widget title displays "array" than link
|
117 |
-
* BUGUnreproducible Call to undefined method Testimonials_Widget::clean_string
|
118 |
-
|
119 |
-
## 2.16.3
|
120 |
-
* Check for PHP 5.3
|
121 |
-
* Move helper methods to Aihrus_Common
|
122 |
-
* Restore pre-2.0.0 auto-migration
|
123 |
-
* Use Aihrus_Common::add_media
|
124 |
-
|
125 |
-
## 2.16.2
|
126 |
-
* **Version 2.16.0 requires PHP 5.3+**
|
127 |
-
|
128 |
-
## 2.16.1
|
129 |
-
* $this to __CLASS__
|
130 |
-
|
131 |
-
## 2.16.0
|
132 |
-
* Add Expand/Collapse All Options helper for widget options - Thank you Scott Hendison
|
133 |
-
* Add Shortcodes helper page - Thank you Scott Hendison
|
134 |
-
* Add screenshot 20. Testimonials Shortcode Examples page
|
135 |
-
* Add version_check
|
136 |
-
* BUGFIX Donate notice shows despite `disable_donate` set
|
137 |
-
* BUGFIX JavaScript generated even when no testimonials
|
138 |
-
* BUGFIX Page Display of Testimonial duplicating Text - Elegant Themes' Trim theme
|
139 |
-
* BUGFIX Saving settings doesn't show update notice
|
140 |
-
* Delete notices on deactivation
|
141 |
-
* Disable schemas by default for widgets
|
142 |
-
* Enabled resetting widget options
|
143 |
-
* Mark cacheables with similar key for easier cleanup
|
144 |
-
* Rebrand Testimonials Widget as Testimonials
|
145 |
-
* Removed Testimonials Widget pre-2.0.0 migration code
|
146 |
-
* Rename no_code to show_code
|
147 |
-
* Replace JS_KEY with SLUG
|
148 |
-
* Revise Shortcode Examples formatting
|
149 |
-
* Revise short description
|
150 |
-
* Simplify display_setting
|
151 |
-
* Update TODO
|
152 |
-
* Update readme verbiage
|
153 |
-
* Update to use `TW_PLUGIN_DIR_LIB`
|
154 |
-
* Use abstract class Aihrus_Settings
|
155 |
-
* Use abstract class Aihrus_Widget
|
156 |
-
* Use aihrus framework
|
157 |
-
|
158 |
-
## 2.15.1
|
159 |
-
* BUGFIX Fatal error: Access to undeclared static property: Testimonials_Widget_Settings::$cpt_category
|
160 |
-
* Encapsulate shortcodes
|
161 |
-
* [BUGFIX](http://wordpress.org/support/topic/2151-warning-illegal-offset-type-in-isset-or-empty?replies=3) Warning: Illegal offset type in isset or empty
|
162 |
-
|
163 |
-
## 2.15.0
|
164 |
-
* Add 2.15.0 upgrade notice
|
165 |
-
* Add filter `testimonials_widget_get_testimonials_html`
|
166 |
-
* Add option Always Load CSS?
|
167 |
-
* Add option Enable Video?
|
168 |
-
* Add option Start/Stop
|
169 |
-
* Add option Transition Mode
|
170 |
-
* BUGFIX JS slider_var not global
|
171 |
-
* BUGFIX active and display-none classes still included though using bxSlider
|
172 |
-
* Bump $2 donation request to $5
|
173 |
-
* Hide non-widget settings
|
174 |
-
* If upgrading, bxSlider will not be enabled by default. You must enable it in your widget and global settings. CSS customizations must be reviewed to have the `.active` and `.display-none` classes removed. The main `.testimonials-widget-testimonial` class also need the `display: none;` and `clear: left;` removed.
|
175 |
-
* Match transition defaults to those of current testimonials widget
|
176 |
-
* Move 2.14.0 transition options to Compatibility tab
|
177 |
-
* Move height options to Compatibility tab
|
178 |
-
* Moved testimonials-widget-2.14.0.css -> css/testimonials-widget-2.14.0.css
|
179 |
-
* Moved testimonials-widget-ie7.css -> css/testimonials-widget-ie7.css
|
180 |
-
* Reduce `empty` usage
|
181 |
-
* Require at least WordPress 3.6
|
182 |
-
* Simplify `wp_enqueue_style` handling
|
183 |
-
* Update .travis for phpmd exclusions
|
184 |
-
* Update FAQ
|
185 |
-
* Update PHPCS config
|
186 |
-
* Update TODO
|
187 |
-
* Use const JS_KEY
|
188 |
-
* [Auto-suggest category and tag options](http://wordpress.org/support/topic/feature-request-menus-in-the-widget)
|
189 |
-
* [Responsively set height](http://wordpress.org/support/topic/better-set-height?replies=3#post-4788316)
|
190 |
-
* [Use bxSlider JavaScript slider](http://bxslider.com/examples/auto-show-start-stop-controls) to make the transitions and navigation more slider like with a [pause button on testimonials](http://wordpress.org/support/topic/play-pause-icon-on-testimonial)
|
191 |
-
|
192 |
-
## 2.14.0
|
193 |
-
* Abstact schema generation
|
194 |
-
* Add API action testimonials_widget_styles
|
195 |
-
* Add API action testimonials_widget_update
|
196 |
-
* Add API filter testimonials_widget_display_setting
|
197 |
-
* Add API filter testimonials_widget_review_name_length
|
198 |
-
* Add API filter testimonials_widget_schema
|
199 |
-
* Add API filter testimonials_widget_schema_agg_rating
|
200 |
-
* Add API filter testimonials_widget_schema_author
|
201 |
-
* Add API filter testimonials_widget_schema_item
|
202 |
-
* Add API filter testimonials_widget_schema_review
|
203 |
-
* Add Review schema date modified
|
204 |
-
* Add aggregate review data
|
205 |
-
* Add item reviewed name and url to Review schema
|
206 |
-
* Add screenshot 19. Using Review and AggregateRating schema data structures
|
207 |
-
* Added shortcode option variable names on Settings screen
|
208 |
-
* Added validate case is_true
|
209 |
-
* Auto create Review schema name from post content - like excerpt
|
210 |
-
* BUGFIX Errors show when no testimonials
|
211 |
-
* BUGFIX Javascript and CSS not carried through when testimonials are cached
|
212 |
-
* BUGFIX PHP Notice `no_code`
|
213 |
-
* BUGFIX Schema properties contain HTML and entities
|
214 |
-
* BUGFIX Testimonials go blank during rotations (javacript var)
|
215 |
-
* BUGFIX aggregate data prevents testimonials from recycling
|
216 |
-
* BUGFIX animation transitions aren't smooth
|
217 |
-
* BUGFIX correct aggregate total
|
218 |
-
* BUGFIX gravatar size not based upon image size
|
219 |
-
* BUGFIX has_archive option network_site_url
|
220 |
-
* BUGFIX missing space after itemprop="image"
|
221 |
-
* BUGFIX paging arrows not positioned correctly
|
222 |
-
* BUGFIX schema meta method doesn't handle schema property wrapping
|
223 |
-
* BUGFIX single content not wrapped with review schema
|
224 |
-
* BUGFIX single view doesn't support caching
|
225 |
-
* BUGFIX styles not included for `get_single`
|
226 |
-
* CSS wp_register_style and wp_enqueue_style slug changed from 'testimonials-widget' to 'Testimonials_Widget'
|
227 |
-
* Clean up JavaScript
|
228 |
-
* Correct Review schema name usage
|
229 |
-
* Default `do_shortcode` on
|
230 |
-
* Default enable custom taxonomy 'show_admin_column'
|
231 |
-
* Enable [rich snippets/structured data](http://wordpress.org/support/topic/lots-of-options-4?replies=3#post-4754108) per [review schema](http://schema.org/Review)
|
232 |
-
* Gravatars saved as featured images to testimonials when no featured image exists
|
233 |
-
* Implement AggregateRating, Organization, Person, Place, Review, and Thing structured data
|
234 |
-
* Move Review schema image to `get_schema`
|
235 |
-
* Prevent `has_archive` and `rewrite_slug` matching existing slugs and same
|
236 |
-
* Refactor Review schema handling with easier API use
|
237 |
-
* Refactored CSS/JS generation and inclusion
|
238 |
-
* Refactored scripts and styles handling
|
239 |
-
* Remove `refresh_interval=0`'s automatic setting of `limit=1` - Thank you Phillip Gapp
|
240 |
-
* Remove default overrides for custom post type
|
241 |
-
* Scripts `ksort` removed. Use `array_unshift` in your `testimonials_widget_testimonials_js` filters instead.
|
242 |
-
* Travis ignore WordPress.WhiteSpace.ControlStructureSpacing - false positives
|
243 |
-
* Update FAQ
|
244 |
-
* Update TODO
|
245 |
-
* Update examples
|
246 |
-
* Update readme option ordering
|
247 |
-
* Update screenshots
|
248 |
-
* Update screenshots
|
249 |
-
* Update verbiage
|
250 |
-
* Validate reviewed_item_url as url
|
251 |
-
* [Load scripts and stylesheets only on Testimonials Page](http://wordpress.org/support/topic/load-scripts-and-stylesheets-only-on-testimonials-page)
|
252 |
-
* https jQuery transport
|
253 |
-
|
254 |
-
## 2.13.6
|
255 |
-
* Add IDs column to edit testimonials listing page
|
256 |
-
* Add filter `testimonials_widget_settings_add_help_tabs`
|
257 |
-
* Add option Fade In Speed
|
258 |
-
* Add option Fade Out Speed
|
259 |
-
* Add settings page help tab
|
260 |
-
* BUGFIX index has_archive and rewrite_slug not set
|
261 |
-
* BUGFIX plugin_row_meta not returning default state
|
262 |
-
* IE7 CSS moved to separate file. Include via Testimonials > Settings if needed
|
263 |
-
* Localize text
|
264 |
-
* Pass YSlow and Google PageSpeed testing
|
265 |
-
* Performance optimizations
|
266 |
-
* Prevent Testimonials Widget custom post type URL slug naming conflicts
|
267 |
-
* Update premium shortcodes
|
268 |
-
* Validate URL submissions
|
269 |
-
* [Begin CSS testing](http://www.netmagazine.com/tutorials/4-tools-automatic-css-testing)
|
270 |
-
|
271 |
-
## 2.13.5
|
272 |
-
* BUGFIX Caching defaults not correct
|
273 |
-
|
274 |
-
## 2.13.4
|
275 |
-
* Add $atts parameter to filter `testimonials_widget_data`
|
276 |
-
* Add action `testimonials_widget_scripts`
|
277 |
-
* Add filter `testimonials_widget_get_testimonial_html_class`
|
278 |
-
* Add filter `testimonials_widget_testimonials_js_internal`
|
279 |
-
* BUGFIX instance numbers breaking caching
|
280 |
-
* BUGFIX settings page missing page title
|
281 |
-
* Change &$this variable calls to $this
|
282 |
-
* Enabling sorting of scripts for precedence
|
283 |
-
* Remove unused first parameter from `testimonials_widget_cache_get` filter call
|
284 |
-
* Tie-in premium disable_donate option
|
285 |
-
|
286 |
-
## 2.13.3
|
287 |
-
* [Add shortcode category example](http://wordpress.org/support/topic/category-shortcode-1?replies=2#post-4550244) - Thank you ashleynlinares
|
288 |
-
* Add do shortcodes option inside of testimonials content
|
289 |
-
* BUGFIX keep shortcodes inside of widgets, let theme function handle to do them or not
|
290 |
-
* Expand FAQ section
|
291 |
-
* Rename Title to Job Title as appropriate
|
292 |
-
* Update POT
|
293 |
-
* Update TODO
|
294 |
-
|
295 |
-
## 2.13.2
|
296 |
-
* Add StillMaintained.com notice
|
297 |
-
* BUGFIX Extra meta box fields are no show
|
298 |
-
* Disengaged from hard coded wp-content path
|
299 |
-
* Escape translations
|
300 |
-
|
301 |
-
## 2.13.1
|
302 |
-
* Add demo link
|
303 |
-
* Add shortcode example explanations
|
304 |
-
* Add video introduction
|
305 |
-
* Disable animation by default
|
306 |
-
* Move localization load to init()
|
307 |
-
* Update donation request text
|
308 |
-
* Update premium features
|
309 |
-
|
310 |
-
## 2.13.0
|
311 |
-
* Add PHP Copy and Paste Detector
|
312 |
-
* Add PHP run-time checks
|
313 |
-
* Add Travis CI with PHP Code Sniffer
|
314 |
-
* Add developer README and CONTRIBUTING docs
|
315 |
-
* BUGFIX DOM Element error on last testimonial rotation
|
316 |
-
* BUGFIX Data delete on uninstall not firing
|
317 |
-
* BUGFIX Testimonials Widget edit page doesn't display custom taxonomies
|
318 |
-
* Beta test update text
|
319 |
-
* Coding standards updates
|
320 |
-
* Create TODO doc
|
321 |
-
* Disabled PHP Mess Detector
|
322 |
-
* Don't escape already escaped text
|
323 |
-
* Don't load plugin till all are loaded
|
324 |
-
* FEATURE [Animated widget rotation](http://wordpress.org/support/topic/animate-jumpy-widget)
|
325 |
-
* OPTION Add Disable animation?
|
326 |
-
* Relocate activation, deactivation, and uninstall hooks
|
327 |
-
* Remove WP_UNINSTALL_PLUGIN reference
|
328 |
-
* Remove class from settings page link
|
329 |
-
* Rename class-settings-testimonials-widget.php to class-testimonials-widget-settings.php
|
330 |
-
* Revise API doc headings
|
331 |
-
* Revise instance creators to only fire when ready
|
332 |
-
* Update Filters listing to API document
|
333 |
-
* Update POT
|
334 |
-
|
335 |
-
## 2.12.8
|
336 |
-
* Add filter `testimonials_widget_cite_html` to adjust cite contents - Thank you [Dimitrios](http://visualweb.gr/) for the suggestion
|
337 |
-
* BUGFIX Warning: Illegal string offset 'exclude'
|
338 |
-
* Replace __ with esc_html__
|
339 |
-
* Update Premium features
|
340 |
-
|
341 |
-
## 2.12.7
|
342 |
-
* BUGFIX Link targets affected page navigation
|
343 |
-
* Removed donate monthly show code
|
344 |
-
|
345 |
-
## 2.12.6
|
346 |
-
* BUGFIX If no refresh_interval, then LIMIT 1
|
347 |
-
* Change donate from $1 to $2 due to fees
|
348 |
-
* Dashboard testimonials count statistics
|
349 |
-
* Display donate on major/minor version release or if it's been a month
|
350 |
-
* Remove braces from simple if/else structures
|
351 |
-
* Settings page inheritance note
|
352 |
-
* Update premium features listing
|
353 |
-
* Use donate button than text
|
354 |
-
|
355 |
-
## 2.12.5
|
356 |
-
* BUGFIX Correct loose vs strict comparison for intval and absint
|
357 |
-
* If no refresh_interval, then LIMIT 1
|
358 |
-
|
359 |
-
## 2.12.4
|
360 |
-
* BUGFIX Settings jQuery UI Tabs conflict
|
361 |
-
* NOT BUG [WPML bug](http://wordpress.org/support/topic/wpml-bug?replies=1)
|
362 |
-
* Remove settings.css
|
363 |
-
* Settings about section height fix
|
364 |
-
* TODOs update
|
365 |
-
* Update Premium product page URL
|
366 |
-
* Update WPML configuration
|
367 |
-
* Use PayPal donate image in settings
|
368 |
-
|
369 |
-
## 2.12.3
|
370 |
-
* BUGFIX Import option constantly overrides settings
|
371 |
-
* BUGFIX [Error When Database Does Not Exist Yet](http://wordpress.org/support/topic/error-when-database-does-not-exist-yet)
|
372 |
-
|
373 |
-
## 2.12.2
|
374 |
-
* $1 donation link admin_notice on installation or major/minor update
|
375 |
-
* Add forum responses cheat sheet
|
376 |
-
* Auto flush URLs if archive or testimonial slugs change
|
377 |
-
* BUGFIX Respect attribute settings by preventing reset_defaults and importexport activating on front-end
|
378 |
-
* Convert slug, slugs, and term setting items to lowercase on save
|
379 |
-
* Correctly delete all testimonials options on delete
|
380 |
-
* Don't create class instance unless plugin is activated
|
381 |
-
* FEATURE Allow for custom post type categories and tags [Idea via crdunst](http://wordpress.org/support/topic/feedback-tagscategories?replies=3#post-4160839)
|
382 |
-
* Prevent same has_archive and rewrite_slug which causes URL problems
|
383 |
-
* Remove excess FAQ text
|
384 |
-
* Remove unused settings and methods
|
385 |
-
* Remove unused testing settings
|
386 |
-
* Set version for which admin notice to display
|
387 |
-
|
388 |
-
## 2.12.1
|
389 |
-
* BUGFIX Settings memory leak [Sites hosed after update 2.12.0](http://wordpress.org/support/topic/premium-sites-hosed-after-update-2120)
|
390 |
-
* BUGFIX [importexport settings failure](http://wordpress.org/support/topic/errors-after-updating)
|
391 |
-
* Change update warning verbiage
|
392 |
-
* Update FAQ & support links to knowledge base
|
393 |
-
|
394 |
-
## 2.12.0
|
395 |
-
* Add file headers to lib/class*
|
396 |
-
* Add filter testimonials_widget_widget_options to alter displayed widget options
|
397 |
-
* BUGFIX Correct settings required validation `break 2`
|
398 |
-
* BUGFIX Non-static method Testimonials_Widget::get_testimonials_html() should not be called statically
|
399 |
-
* CSS rename testimonialswidget_testimonial(s) to testimonials-widget-testimonial(s)
|
400 |
-
* Correct static get_testimonials_html, get_testimonials_htmls, widget_options function declaration
|
401 |
-
* Correct static validators call
|
402 |
-
* Explain options inheritance
|
403 |
-
* FEATURE Remove Plugin Data on Deletion? - Delete all Testimonials Widget data and options from database on plugin deletion
|
404 |
-
* FEATURE Settings export/import
|
405 |
-
* Refactor out get_quote and get_cite from get_testimonial_html
|
406 |
-
* Refactor excess settings grab in widget_options
|
407 |
-
* Remove $blank from testimonials_truncate()
|
408 |
-
* Remove unused code
|
409 |
-
* Rename metabox.class.php class-redrokk-metabox-class.php
|
410 |
-
* Rename settings.testimonials-widget.php class-settings-testimonials-widget.php
|
411 |
-
* Rename testimonials-widget-widget.php class-testimonials-widget-widget.php
|
412 |
-
* Revise FAQ
|
413 |
-
* SCREENSHOT 17. Testimonials Widget Settings > Compatibility & Reset tab
|
414 |
-
* Show latest updates notice on activation
|
415 |
-
* Spellcheck readme.txt
|
416 |
-
* Update CSS for WordPress Coding standards
|
417 |
-
* Update FAQ
|
418 |
-
* Update JavaScript for WordPress Coding standards
|
419 |
-
* Update PHP for WordPress Coding Standards
|
420 |
-
* Update POT
|
421 |
-
* Update TODOs
|
422 |
-
* Update premium features
|
423 |
-
* Update rulesets
|
424 |
-
* Use ID for widget
|
425 |
-
|
426 |
-
## 2.11.3
|
427 |
-
* BUGFIX [Can't set featured image](http://wordpress.org/support/topic/cant-set-featured-image-3)
|
428 |
-
* Begin WordPress coding standard cleanup
|
429 |
-
* Bold option headers
|
430 |
-
* Change `has_archive` default from `testimonials` to `testimonials-archive`
|
431 |
-
* Clean up static method calls to prevent PHP Strict notices
|
432 |
-
* Correct filter name `testimonials_widget_next_posts_link` to `testimonials_widget_next_posts_link_text`
|
433 |
-
* Correct static methods calling
|
434 |
-
* Secure activation, deactivation, uninstall operations
|
435 |
-
* Update POT
|
436 |
-
* Update profile
|
437 |
-
|
438 |
-
## 2.11.2
|
439 |
-
* Add `min1` and `nozero` validation
|
440 |
-
* Always include settings class
|
441 |
-
* BUGFIX Don't prepend http to email addresses
|
442 |
-
* Move lesser used widget options to expandable Additional Widget Options section
|
443 |
-
* Move settings setup to `init`
|
444 |
-
* Revise `absint` and `intval` validation to default on blank entry
|
445 |
-
* Update POT
|
446 |
-
* Update TODO
|
447 |
-
* Update text domain for localization and POT
|
448 |
-
* Use `links_add_target` for widget title link
|
449 |
-
|
450 |
-
## 2.11.1
|
451 |
-
* BUGFIX [Fatal error: Testimonials_Widget_Settings](http://wordpress.org/support/topic/fatal-error-testimonials_widget_settings)
|
452 |
-
|
453 |
-
## 2.11.0
|
454 |
-
* Add Option "Hide Image in Single View?" `hide_image_single`
|
455 |
-
* Add `.author` and `.email` to CSS
|
456 |
-
* Add `.single` to single view testimonials
|
457 |
-
* Add location to meta_key ordering options
|
458 |
-
* BUGFIX [Convert q tags to blockquote](http://wordpress.org/support/topic/open-link-in-new-tab-html-validation) [Why?](http://www.w3schools.com/tags/tag_blockquote.asp)
|
459 |
-
* BUGFIX [Fix cite tag usage - it's title, not source](http://www.w3.org/html/wg/drafts/html/master/text-level-semantics.html#the-cite-element) using [T](http://html5doctor.com/blockquote-q-cite/) [BD](http://oli.jp/2011/blockquote/)
|
460 |
-
* Beta testers needed section added
|
461 |
-
* Disable self-generated quotation marks
|
462 |
-
* Enable backwards compatibility for default options
|
463 |
-
* Ignore init() during AJAX and autosave operations
|
464 |
-
* Optimize DB after uninstall
|
465 |
-
* Rename CSS attributes to credit
|
466 |
-
* Revise README verbiage in general
|
467 |
-
* Simplify CSS naming
|
468 |
-
* Update Allow Comments verbiage
|
469 |
-
* Update TODOs
|
470 |
-
* Update features listing
|
471 |
-
* Update options listing
|
472 |
-
* Update premium features
|
473 |
-
* Update readme formatting
|
474 |
-
|
475 |
-
## 2.10.3
|
476 |
-
* Add "Menu Order" to Order By options
|
477 |
-
* Add Height option to automatically set min and max height
|
478 |
-
* BUGFIX [Only one testimonial displaying](http://wordpress.org/support/topic/only-one-testimonial-displaying)
|
479 |
-
* BUGFIX [Post Types Order](http://wordpress.org/support/topic/random-order-doesnt-work) - sorting conflict
|
480 |
-
* Delete data on uninstall
|
481 |
-
* Enable quotes and join for IE7 - Thank you [SFMichael](http://wordpress.org/support/topic/ie-7-quotes-fix)
|
482 |
-
* Flush URLs on deactivation
|
483 |
-
* Revise self::$base usage
|
484 |
-
* Revise settings_link handling
|
485 |
-
* Screenshot 16 Testimonials Widget Settings > Widget tab
|
486 |
-
* Update Premium link
|
487 |
-
* Update TODOs
|
488 |
-
|
489 |
-
## 2.10.2
|
490 |
-
* BUGFIX Settings initialization overwrote previous settings
|
491 |
-
|
492 |
-
## 2.10.1
|
493 |
-
* Moved [FAQ](http://aihr.us/testimonials-widget/faq/)
|
494 |
-
* Removed premium screenshots
|
495 |
-
* Rename screenshot-3.png screenshot-2.png
|
496 |
-
* Rename screenshot-4.png screenshot-3.png
|
497 |
-
* Rename screenshot-5.png screenshot-4.png
|
498 |
-
* Rename screenshot-6.png screenshot-5.png
|
499 |
-
* Rename screenshot-7.png screenshot-6.png
|
500 |
-
* Rename screenshot-8.png screenshot-7.png
|
501 |
-
* Rename screenshot-13.png screenshot-8.png
|
502 |
-
* Rename screenshot-14.png screenshot-9.png
|
503 |
-
* Rename screenshot-21.png screenshot-10.png
|
504 |
-
* Rename screenshot-22.png screenshot-11.png
|
505 |
-
* Rename screenshot-23.png screenshot-12.png
|
506 |
-
* Rename screenshot-24.png screenshot-13.png
|
507 |
-
* Rename screenshot-25.png screenshot-14.png
|
508 |
-
* Rename screenshot-26.png screenshot-15.png
|
509 |
-
* Screenshot 2 removed
|
510 |
-
* Screenshot 9 removed
|
511 |
-
* Screenshot 10 removed
|
512 |
-
* Screenshot 11 removed
|
513 |
-
* Screenshot 12 removed
|
514 |
-
* Screenshot 15 removed
|
515 |
-
* Screenshot 16 removed
|
516 |
-
* Screenshot 17 removed
|
517 |
-
* Screenshot 18 removed
|
518 |
-
* Screenshot 19 removed
|
519 |
-
* Screenshot 20 removed
|
520 |
-
* Screenshot 27 removed
|
521 |
-
* Screenshot 28 removed
|
522 |
-
|
523 |
-
## 2.10.0
|
524 |
-
* Add `hide_content` option verbiage
|
525 |
-
* Add screenshot 27 `[[testimonialswidgetpremium_form]]` – Add a Testimonial
|
526 |
-
* Add screenshot 28 Testimonials Widget Settings > Entry Form tab
|
527 |
-
* Added rel="nofollow" to URL - Thank you Nicholas Corrieri for the suggestion
|
528 |
-
* Convert validation to configuration
|
529 |
-
* Correct breakline on radio settings display
|
530 |
-
* Correct checkbox checking
|
531 |
-
* Correct paging handling
|
532 |
-
* Correct post_status selection for single view
|
533 |
-
* Describe settings defaults
|
534 |
-
* Dutch translation by Bjorn Robijns
|
535 |
-
* Enable echo/return for display_setting
|
536 |
-
* Enable file input for settings
|
537 |
-
* Enable widget options no-show
|
538 |
-
* Finish validation configuration move
|
539 |
-
* Form demo link
|
540 |
-
* Move Changelog to changelog.txt
|
541 |
-
* Rename load_sections > _sections
|
542 |
-
* Rename load_settings > settings
|
543 |
-
* Save option defaults
|
544 |
-
* Set missing checkbox values to 0 on validate
|
545 |
-
* TODO Delete data option on deactivation
|
546 |
-
* Update Premium description
|
547 |
-
* Update WPML configuration
|
548 |
-
|
549 |
-
## 2.9.1
|
550 |
-
* BUGFIX Assigning the return value of new by reference is deprecated in metabox.class.php
|
551 |
-
|
552 |
-
## 2.9.0
|
553 |
-
* Add location meta field after title
|
554 |
-
* Add location related options
|
555 |
-
* FAQ 18, 34, 35 update
|
556 |
-
* Screenshot 2, 4, 5 updated
|
557 |
-
* Update POT
|
558 |
-
|
559 |
-
## 2.8.4
|
560 |
-
* BUGFIX [Title link does not allow a relative link](http://wordpress.org/support/topic/title-link-does-not-allow-a-relative-link)
|
561 |
-
|
562 |
-
## 2.8.3
|
563 |
-
* BUGFIX [Selection > Category Filter doesn't remember >1 category](http://wordpress.org/support/topic/selection-category-filter-doesnt-remember-1-category)
|
564 |
-
* FAQ 67 testimonials paging doesn't work
|
565 |
-
* FAQ 68 feature XYZ
|
566 |
-
|
567 |
-
## 2.8.2
|
568 |
-
* Add filter `testimonials_widget_version`
|
569 |
-
* Screenshot 11/16 updated
|
570 |
-
* Update POT
|
571 |
-
* Update Premium features
|
572 |
-
* Version tracking for default settings
|
573 |
-
|
574 |
-
## 2.8.1
|
575 |
-
* Customizable archive and testimonial URLs
|
576 |
-
* FAQ 66 Change the testimonials archive or single view URL
|
577 |
-
* Optional commenting on testimonial single-view pages
|
578 |
-
* Screenshot 26 Testimonials Widget Settings > Post Type tab
|
579 |
-
* Update POT
|
580 |
-
|
581 |
-
## 2.8.0
|
582 |
-
* Merge in settings branch
|
583 |
-
* Add `tw_get_options`
|
584 |
-
* Add filter `testimonials_widget_sections` – Alter section options
|
585 |
-
* Add filter `testimonials_widget_settings` – Alter setting options
|
586 |
-
* Add settings page 'Selection', 'Ordering', and 'Widget' tabs
|
587 |
-
* BUG with "Post Types Order"
|
588 |
-
* BUGFIX paging when not in singular view
|
589 |
-
* Configure settings within Testimonials_Widget_Settings class
|
590 |
-
* Enable 'Expand/Collapse' view in Widget options
|
591 |
-
* FAQ 65 Disable the stylesheet
|
592 |
-
* FEATURE Remove `.hentry` CSS?
|
593 |
-
* FEATURE Testimonials Widget Settings screen
|
594 |
-
* Removed filters `testimonials_widget_options_update`, `testimonials_widget_options_form`
|
595 |
-
* Rename `widget_text` to `bottom_text`
|
596 |
-
* Revise About page content
|
597 |
-
* Revise Settings page footer
|
598 |
-
* Revise widget options update and validation
|
599 |
-
* Screenshot 11 updated
|
600 |
-
* Screenshot 16 updated
|
601 |
-
* Screenshot 2 updated
|
602 |
-
* Screenshot 22 Testimonials Widget Settings > General tab
|
603 |
-
* Screenshot 23 Expanded 'Selection Options' Testimonials Widget
|
604 |
-
* Screenshot 24 Expanded 'Ordering Options' Testimonials Widget
|
605 |
-
* Screenshot 25 Testimonials Widget Settings > Selection tab
|
606 |
-
* Screenshot 3 updated
|
607 |
-
* Screenshot 4 updated, Expanded 'General Options' Testimonials Widget
|
608 |
-
* Update "Shortcode and Widget Options" verbiage
|
609 |
-
* Update POT file
|
610 |
-
* Use defaults via Testimonials_Widget_Settings class
|
611 |
-
* Validate shortcode and widget options via Testimonials_Widget_Settings::validate_settings
|
612 |
-
* Verbiage updates
|
613 |
-
|
614 |
-
## 2.7.17
|
615 |
-
* Add purchase Testimonials Widget Premium plugin meta link
|
616 |
-
* Begin settings screen work
|
617 |
-
* FAQ 20 Update
|
618 |
-
* FAQ 31 Update
|
619 |
-
* FAQ 63 Remove the cite –
|
620 |
-
* FAQ 64 Plugin conflict
|
621 |
-
* Screenshot 21 Poedit Catalog properties
|
622 |
-
* TODO class removal
|
623 |
-
* Update localization verbiage
|
624 |
-
|
625 |
-
## 2.7.16
|
626 |
-
* Add comments panel to edit screen - [Thank you BarrieSpence](http://wordpress.org/support/topic/disable-comments-10?replies=1)
|
627 |
-
* TODO Admin panel
|
628 |
-
|
629 |
-
## 2.7.15
|
630 |
-
* Add "CSS class" to widget options window
|
631 |
-
* FAQ 31/34/35/50/53/55 updates
|
632 |
-
* FAQ 61 Determine .testimonialswidget_testimonialsNNN
|
633 |
-
* FAQ 62 Category and tag selection
|
634 |
-
* Feature updates
|
635 |
-
* Localization, Hebrew
|
636 |
-
* Screenshot 3 updated
|
637 |
-
|
638 |
-
## 2.7.14
|
639 |
-
* BUGFIX [Testimonials archive view URL conflicts with Page slug](http://wordpress.org/support/topic/testimonials-archive-view-url-conflicts-with-page-slug)
|
640 |
-
* FAQ 1 Update - Thank you [aaaronscat](http://wordpress.org/support/topic/writing-php-to-display-rotating-widget-in-a-template) for the inspiration
|
641 |
-
* FAQ 60 Download older versions of Testimonials Widget
|
642 |
-
* Premium feature update
|
643 |
-
* Screenshot 20 added
|
644 |
-
|
645 |
-
## 2.7.13
|
646 |
-
* Adapt for `mb_strcut` and `mb_strlen` alternatives
|
647 |
-
* BUGFIX [Widget doesn't appear](http://wordpress.org/support/topic/widget-doesnt-appear-1)
|
648 |
-
* Update POT
|
649 |
-
|
650 |
-
## 2.7.12
|
651 |
-
* Change Aihrus support email to contact form
|
652 |
-
* FAQ 1 Update - Thank you [aaaronscat](http://wordpress.org/support/topic/writing-php-to-display-rotating-widget-in-a-template) for the inspiration
|
653 |
-
* Update Testimonials Widget Premium URL
|
654 |
-
|
655 |
-
## 2.7.11
|
656 |
-
* Citation styling note
|
657 |
-
* Removed sub-category shortcode example
|
658 |
-
* Thanks to Joe Weber for asset header
|
659 |
-
* Update premium URL
|
660 |
-
* Update premium features
|
661 |
-
* Update premium purchase URL
|
662 |
-
|
663 |
-
## 2.7.10
|
664 |
-
* BUGFIX extra excerpt in single view
|
665 |
-
* Screenshot 11 updated
|
666 |
-
* Update premium features
|
667 |
-
|
668 |
-
## 2.7.9
|
669 |
-
* Revise content truncation to respect HTML tags
|
670 |
-
* Update premium description
|
671 |
-
* Update premium features
|
672 |
-
|
673 |
-
## 2.7.8
|
674 |
-
* Add `before` and `after` options to `paging`
|
675 |
-
* FAQ 58 Specify testimonials per page or section
|
676 |
-
* FAQ 59 Rotating widget show all testimonials than only one at a time
|
677 |
-
* Revert on-demand CSS to always included
|
678 |
-
* Support process and donation update
|
679 |
-
* Thank you to [mkearns](http://wordpress.org/support/topic/just-excellent-3) for specifying a sub-category shortcode example
|
680 |
-
* Update premium URL
|
681 |
-
* Update premium features
|
682 |
-
|
683 |
-
## 2.7.7
|
684 |
-
* FAQ 13 Update
|
685 |
-
* FAQ 31 Update
|
686 |
-
* Shortcode examples "[[" to "["
|
687 |
-
|
688 |
-
## 2.7.6
|
689 |
-
* Add `[[testimonialswidget_widget]]` to Shortcodes column
|
690 |
-
* CSS cite `margin-top` adjustment
|
691 |
-
* Enable testimonials archive view
|
692 |
-
* FAQ 1 Update
|
693 |
-
* FAQ 52 Update
|
694 |
-
* FAQ 53 Update
|
695 |
-
* FAQ 55 Style page and instance testimonials
|
696 |
-
* FAQ 56 Testimonials archive view URL
|
697 |
-
* FAQ 57 Testimonial single view URL
|
698 |
-
* Only include CSS if testimonials instance called
|
699 |
-
* Screenshot 19 `[[testimonialswidget_widget unique=true]]` Show multiple testimonials in rotation
|
700 |
-
* Set arg defaults via `defaults`
|
701 |
-
|
702 |
-
## 2.7.5
|
703 |
-
* BUGFIX PHP Warning for new fields in widget when widget already exists
|
704 |
-
* Exclude IDs option
|
705 |
-
* Implement instance tracking
|
706 |
-
* Protect shortcode examples
|
707 |
-
* Update asset header size
|
708 |
-
* Update premium features
|
709 |
-
|
710 |
-
## 2.7.4
|
711 |
-
* Asset header help request
|
712 |
-
* Premium feature updates
|
713 |
-
* Screenshot 9 updated
|
714 |
-
* Screenshot 10 replaced
|
715 |
-
* Screenshot 11 updated
|
716 |
-
* Screenshot 15 updated
|
717 |
-
* Screenshot 17 Single `[[testimonialswidget_list]]` entry with and without 'Read more' link
|
718 |
-
* Screenshot 18 `[[testimonialswidgetpremium_count]]` Examples
|
719 |
-
|
720 |
-
## 2.7.3
|
721 |
-
* Apply quotes only around testimonial content
|
722 |
-
* FAQ 13 update
|
723 |
-
* FAQ 34 update
|
724 |
-
* FAQ 35 update
|
725 |
-
* Screenshot 8 replaced
|
726 |
-
* Simplified quotes handling
|
727 |
-
* Upgrade notification
|
728 |
-
|
729 |
-
## 2.7.2
|
730 |
-
* FAQ 54 update
|
731 |
-
* Screenshot 12 update
|
732 |
-
* Screenshot 16 Edit testimonial with "Excerpt" and "Read More Link" fields - Testimonials Widget Premium plugin
|
733 |
-
|
734 |
-
## 2.7.1
|
735 |
-
* Description update
|
736 |
-
* FAQ 1 update
|
737 |
-
* FAQ 2 update
|
738 |
-
* FAQ 4 update
|
739 |
-
* FAQ 5 update
|
740 |
-
* FAQ 6 update
|
741 |
-
* FAQ 7 update
|
742 |
-
* FAQ 8 update
|
743 |
-
* FAQ 9 update
|
744 |
-
* FAQ 12 update
|
745 |
-
* FAQ 14 update
|
746 |
-
* FAQ 15 update
|
747 |
-
* FAQ 17 update
|
748 |
-
* FAQ 22 update
|
749 |
-
* FAQ 25 update
|
750 |
-
* FAQ 26 update
|
751 |
-
* FAQ 30 update
|
752 |
-
* FAQ 32 update
|
753 |
-
* FAQ 34 update
|
754 |
-
* FAQ 35 update
|
755 |
-
* FAQ 37 update
|
756 |
-
* FAQ 53 update
|
757 |
-
* Feature update
|
758 |
-
* Installation update
|
759 |
-
* Screenshot 1 update
|
760 |
-
* Screenshot 2 update
|
761 |
-
* Screenshot 3 update
|
762 |
-
* Screenshot 4 update
|
763 |
-
* Screenshot 5 update
|
764 |
-
* Screenshot 6 update
|
765 |
-
* Screenshot 7 update
|
766 |
-
* Screenshot 8 replaced
|
767 |
-
* Screenshot 9 replaced
|
768 |
-
* Screenshot 12 update
|
769 |
-
* Screenshot 15 update
|
770 |
-
* Screenshot 16 removed
|
771 |
-
* Screenshot 17 removed
|
772 |
-
* Screenshot 18 removed
|
773 |
-
|
774 |
-
## 2.7.0
|
775 |
-
* FAQ 13 Update
|
776 |
-
* FAQ 54 Release early. Release often.
|
777 |
-
* Redo content opening and closing quotes display
|
778 |
-
* Upgrade notification for 2.7.0
|
779 |
-
|
780 |
-
## 2.6.6
|
781 |
-
* Remove CSS `overflow: auto` - too many complaints
|
782 |
-
* FAQ 53 Scroll widget based testimonial content
|
783 |
-
|
784 |
-
## 2.6.5
|
785 |
-
* BUGFIX: overflow auto than scroll
|
786 |
-
* Correct screenshot 11 & 18
|
787 |
-
|
788 |
-
## 2.6.4
|
789 |
-
* Add filters `testimonials_widget_posts_custom_column`, `testimonials_widget_columns`, `testimonials_widget_meta_box`
|
790 |
-
* BUGFIX Testimonial posts page column URL now correctly clickable
|
791 |
-
* Code spacing cleanup
|
792 |
-
* Enabled [scrolling text](http://wordpress.org/support/topic/plugin-testimonials-widget-scroll-for-a-single-but-long-testimonial) for maximum height restricted testimonial widgets
|
793 |
-
* FAQ 34/35 CSS styling update
|
794 |
-
* Scrolling testimonials for maximum height restricted widgets
|
795 |
-
* Testimonials have `get_post_class` applied
|
796 |
-
* Update premium features
|
797 |
-
|
798 |
-
## 2.6.3
|
799 |
-
* Add filter `testimonials_widget_query_args`
|
800 |
-
* Add filters `testimonials_widget_testimonials_css`, `testimonials_widget_testimonials_js`
|
801 |
-
* Allow `limit=-1`
|
802 |
-
* BUGFIX Repeated footer CSS and JavaScript
|
803 |
-
* CSS - block disply widget image
|
804 |
-
* FAQ 52 Include testimonies in archive view
|
805 |
-
* Refactor `get_query_args` out of `get_testimonials`
|
806 |
-
* Revise JavaScript handling
|
807 |
-
* Screenshot 17 `require_image`, `minimum_length` and `maximum_length` shortcode option examples
|
808 |
-
* Screenshot 18 Widget with 'Next testimonial…' link
|
809 |
-
* Update POT
|
810 |
-
* Update premium features
|
811 |
-
* Update premium screenshots
|
812 |
-
|
813 |
-
## 2.6.2
|
814 |
-
* Compatible with WordPress 3.6
|
815 |
-
* Fix single view PHP warning
|
816 |
-
|
817 |
-
## 2.6.1
|
818 |
-
* Add filter `testimonials_widget_testimonial_html_single_content`
|
819 |
-
* Add `force_pad` option to `testimonials_truncate`
|
820 |
-
* Copyright year update
|
821 |
-
* Update Premium features
|
822 |
-
|
823 |
-
## 2.6.0
|
824 |
-
* Add FAQ 51 filter `testimonials_widget_get_testimonial_html` usage
|
825 |
-
* FAQ 50 Revise
|
826 |
-
* Reorganize `get_testimonial_html`
|
827 |
-
|
828 |
-
## 2.5.6
|
829 |
-
* Add FAQ 50 Example to set widget gradient background color
|
830 |
-
* FAQ 13 Update
|
831 |
-
* FAQ 20 Add PHP tags
|
832 |
-
* FAQ 48 Code correction
|
833 |
-
* FAQ 49 Code correction
|
834 |
-
|
835 |
-
## 2.5.5
|
836 |
-
* Enable widget caching
|
837 |
-
* Refactor `get_testimonials_html` to break out CSS/JS generation
|
838 |
-
* Respect [meta capabilities](http://wordpress.org/support/topic/plugin-testimonials-widget-version-20-rewrite-suggestions-request?replies=18#post-3359157)
|
839 |
-
* Revise TODO text
|
840 |
-
* TODO remove Template engine - see `testimonials_widget_testimonial_html*` filters
|
841 |
-
|
842 |
-
## 2.5.4
|
843 |
-
* Add filter `testimonials_widget_testimonial_html_single`
|
844 |
-
* Add filter `testimonials_widget_testimonial_html`
|
845 |
-
* Aihrus testimonial URL correction
|
846 |
-
* FAQ 34 Find `testimonialswidget_testimonialsNNN` instance naming
|
847 |
-
* FAQ 48 Customize testimonial list/widget output
|
848 |
-
* FAQ 49 Customize testimonial single output
|
849 |
-
|
850 |
-
## 2.5.3
|
851 |
-
* Add donate link in plugin section
|
852 |
-
* Donate links
|
853 |
-
|
854 |
-
## 2.5.2
|
855 |
-
* Aihrus branding
|
856 |
-
|
857 |
-
## 2.5.1
|
858 |
-
* Update POT file
|
859 |
-
|
860 |
-
## 2.5.0
|
861 |
-
* Add option Keep whitespace? - Thank you [kangchenjunga](http://wordpress.org/support/topic/optional-wpautop-functionality-for-better-formatting?replies=2) for the suggestion
|
862 |
-
* Revise FAQ 47
|
863 |
-
* Screenshot 16 - Widget whitespace kept
|
864 |
-
* Update Author URL
|
865 |
-
|
866 |
-
## 2.4.8
|
867 |
-
* Donate to purchase verbiage change - One bad experience ruins it for all
|
868 |
-
* FAQ 47 testimonials list in a widget
|
869 |
-
* TODO Add location field
|
870 |
-
* TODO Add plugin donate link
|
871 |
-
* [CleanCSS](http://cleancss.com/) the CSS
|
872 |
-
|
873 |
-
## 2.4.7
|
874 |
-
* Add filter `testimonials_widget_defaults_single`
|
875 |
-
* TODO clean up for premium version
|
876 |
-
* TODO Optional wpautop functionality for better formatting
|
877 |
-
|
878 |
-
## 2.4.6
|
879 |
-
* Add 'No order' as an Order By widget option
|
880 |
-
* Add FAQ 45 testimonial character limit
|
881 |
-
* Add Recommendation heading
|
882 |
-
* FAQ 23 mention 404
|
883 |
-
* FAQ 46 testimonial ordering by given IDs
|
884 |
-
* Update filters listing
|
885 |
-
* Use `posts_results` filter to put posts in same orders as post__in when orderby=none
|
886 |
-
|
887 |
-
## 2.4.5
|
888 |
-
* BUGFIX Missing CSS for testimonialswidget_join_title
|
889 |
-
* FAQ 44 Refresh interval - Thank you [biztips](http://wordpress.org/support/topic/fatal-error-558?replies=6#post-3475595)
|
890 |
-
|
891 |
-
## 2.4.4
|
892 |
-
* Add screenshot 15
|
893 |
-
* FAQ 34 Update CSS
|
894 |
-
* FAQ 35 Update CSS
|
895 |
-
* FAQ 42 Exclude testimonial categories from Category widget
|
896 |
-
* FAQ 43 Exclude testimonial categories from my sitemap
|
897 |
-
* Update premium features
|
898 |
-
|
899 |
-
## 2.4.3
|
900 |
-
* Adjust default `limit` to 10 from 25
|
901 |
-
* Add CSS `margin-top` to `cite`, `.testimonialswidget_extra` and `.testimonialswidget_text`
|
902 |
-
* BUGFIX [Keep `widget_text` with each testimonial](http://wordpress.org/support/topic/images-not-showin?replies=10)
|
903 |
-
* Donate link update
|
904 |
-
* FAQ 41 Widget height consistency
|
905 |
-
|
906 |
-
## 2.4.2
|
907 |
-
* 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)
|
908 |
-
* TODO Add refactor `get_testimonials_html`
|
909 |
-
|
910 |
-
## 2.4.1
|
911 |
-
* BUGFIX `testimonialswidget_widget` always random
|
912 |
-
* Comment and verbiage cleanups
|
913 |
-
* Minor refactor of `get_testimonial_html`
|
914 |
-
* TODO Added Template engine
|
915 |
-
|
916 |
-
## 2.4.0
|
917 |
-
* FAQ 39 Style the custom widget text
|
918 |
-
* FAQ 40 Page number pagination
|
919 |
-
* FEATURE Custom widget text
|
920 |
-
* FEATURE Make the widget title clickable
|
921 |
-
* FEATURE Page numbers via WP-PageNavi
|
922 |
-
* Refactor paging to use WordPress functions
|
923 |
-
* SCREENSHOT 12 recrop
|
924 |
-
* SCREENSHOT 13 Widget with clickable title and custom text/HTML on bottom
|
925 |
-
* SCREENSHOT 14 WP-PageNavi compatible for page numbers than default arrows
|
926 |
-
* SCREENSHOT 3 update
|
927 |
-
* SCREENSHOT 4 update
|
928 |
-
* TODO Remove Custom widget text - added
|
929 |
-
* TODO Remove Make the widget title clickable - added
|
930 |
-
* TODO Remove Page numbers - added
|
931 |
-
* TODO Remove fields to show - done via theme
|
932 |
-
|
933 |
-
## 2.3.4
|
934 |
-
* BUGFIX [Testimonial plugin means Set Feature Image Not Displaying](http://wordpress.org/support/topic/testimonial-plugin-means-set-feature-image-not-displaying)
|
935 |
-
* Test with WordPress 3.5.0 RC1
|
936 |
-
* TODO remove Publish & New - just click 'New Testimonial' after Publishing
|
937 |
-
* Update donate link
|
938 |
-
|
939 |
-
## 2.3.3
|
940 |
-
* FEATURE Improved single page view
|
941 |
-
* SCREENSHOT Single testimonial view
|
942 |
-
* TODO Meta capabilities
|
943 |
-
|
944 |
-
## 2.3.2
|
945 |
-
* Add filters `testimonials_widget_options_update`, `testimonials_widget_options_form`
|
946 |
-
* BUGFIX ["featured image" module disappeared](http://wordpress.org/support/topic/no-image-upload?replies=12#post-3423001)
|
947 |
-
* Clean up tags per [plugin guidelines](http://wordpress.org/extend/plugins/about/guidelines/)
|
948 |
-
* Combine source and url display when no email or company
|
949 |
-
* FAQ renumber second 36 to 37
|
950 |
-
* FAQ 38 Use filter `testimonials_widget_defaults`
|
951 |
-
* FEATURE Centralized defaults via filter `testimonials_widget_defaults`
|
952 |
-
* Only grab `paged` information once
|
953 |
-
* Prepend HTTP protocol if missing in URL
|
954 |
-
* SCREENSHOT Widget Premium Options
|
955 |
-
* Simplify filter `testimonials_widget_content`
|
956 |
-
* Simplify read more ellipsis
|
957 |
-
* Trim content after formatting
|
958 |
-
|
959 |
-
## 2.3.1
|
960 |
-
* BUGFIX [No image upload](http://wordpress.org/support/topic/no-image-upload)
|
961 |
-
* FAQ 36 Why donate?
|
962 |
-
|
963 |
-
## 2.3.0
|
964 |
-
* BUGFIX No paging when cached
|
965 |
-
* FAQ 3 Check for empty $data
|
966 |
-
* FAQ 33 Change more content ellipsis
|
967 |
-
* FAQ 34/35 Clarify CSS classes
|
968 |
-
* FAQ 36 Configure Next and Previous page indicators
|
969 |
-
* 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)
|
970 |
-
* FEATURE Easier to configure Next and Previous page indicators
|
971 |
-
* Refactor `get_testimonial_html`
|
972 |
-
* Refactor testimonial HTML creation methods
|
973 |
-
* Remove "Read more…" preparations
|
974 |
-
* Replace `testimonials_truncate` with WordPress's `wp_trim_words`
|
975 |
-
* SCREENSHOTS 'Read more' links
|
976 |
-
* Sanitize names
|
977 |
-
* TEMP Prevent widget caching
|
978 |
-
* TODO Clarify 'Read more'
|
979 |
-
* TODO Remove - CSV Export
|
980 |
-
* TODO Updates
|
981 |
-
* Update POT file
|
982 |
-
|
983 |
-
## 2.2.9
|
984 |
-
* BUGFIX [Testimonial List Loading 2nd Blank Box](http://wordpress.org/support/topic/testimonial-list-loading-2nd-blank-box)
|
985 |
-
|
986 |
-
## 2.2.8
|
987 |
-
* Begin "Read more…" preparations
|
988 |
-
* Correct content display processing
|
989 |
-
* FAQ 32 Min-height usage
|
990 |
-
* FAQ 4 Custom code placement clarification
|
991 |
-
* TODO Updates
|
992 |
-
* Widgets display content sans `wpautop` formatting
|
993 |
-
|
994 |
-
## 2.2.7
|
995 |
-
* Catch widget number in cache
|
996 |
-
* FAQ Custom query code. Thank you [tcwebguru](http://wordpress.org/support/topic/display-on-page-without-widget)
|
997 |
-
* FAQ Change Testimonials Widget text labels
|
998 |
-
* Language verbiage correction
|
999 |
-
* PHP notice fix - esc_attr
|
1000 |
-
* Remove premium code include
|
1001 |
-
|
1002 |
-
## 2.2.6
|
1003 |
-
* BUGFIX Widget config not saving correctly
|
1004 |
-
* FAQ Export/import
|
1005 |
-
* TODO Updates
|
1006 |
-
|
1007 |
-
## 2.2.5
|
1008 |
-
* Adapt for [Testimonials Widget Premium plugin](http://aihr.us/downloads/testimonials-widget-premium-wordpress-plugin/)
|
1009 |
-
* Add support text
|
1010 |
-
* Correct verbiage spacing
|
1011 |
-
* Explain `limit`
|
1012 |
-
* TODO revisions
|
1013 |
-
|
1014 |
-
## 2.2.4
|
1015 |
-
* BUGFIX [Tags - no more than 2?](http://wordpress.org/support/topic/tags-no-more-than-2)
|
1016 |
-
* Clean up PHP notices
|
1017 |
-
* Fix Changelog link
|
1018 |
-
* PREMIUM Implement testimonials query and content caching
|
1019 |
-
* TODO update
|
1020 |
-
|
1021 |
-
## 2.2.3
|
1022 |
-
* Begin premium plugin adaptions
|
1023 |
-
* BUGFIX [Tags - no more than 2?](http://wordpress.org/support/topic/tags-no-more-than-2)
|
1024 |
-
* BUGFIX [Updated - Now getting fatal error when using testimonialswidget_list()](http://wordpress.org/support/topic/updated-now-getting-fatal-error-when-using-testimonialswidget_list)
|
1025 |
-
* Clean up links in readme.txt
|
1026 |
-
* Correct company and URL link usage
|
1027 |
-
* [Correct readme.txt to standard](http://wordpress.org/extend/plugins/about/readme.txt)
|
1028 |
-
* Don't rotate testimonial if only 1
|
1029 |
-
* TODO updates
|
1030 |
-
|
1031 |
-
## 2.2.2
|
1032 |
-
* BUGFIX [Now getting fatal error when using testimonialswidget_list()](http://wordpress.org/support/topic/updated-now-getting-fatal-error-when-using-testimonialswidget_list)
|
1033 |
-
* Theme function defaults
|
1034 |
-
* TODO updates
|
1035 |
-
* URL pointing update
|
1036 |
-
|
1037 |
-
## 2.2.1
|
1038 |
-
* Number FAQ Entries
|
1039 |
-
* Revise Installation Usage text
|
1040 |
-
* Revise Shortcode and Widget Options text
|
1041 |
-
|
1042 |
-
## 2.2.0
|
1043 |
-
* FAQ `testimonialswidget_widget()` example
|
1044 |
-
* Multisite compatible
|
1045 |
-
* Reversion as 2.1.10 was a minor release than only bug fixes
|
1046 |
-
|
1047 |
-
## 2.1.10
|
1048 |
-
* [Add title field ](http://wordpress.org/support/topic/plugin-testimonials-widget-just-tried-216-thoughts-suggestions)
|
1049 |
-
* Consolidate defaults to simplify code maintenance
|
1050 |
-
* Correct CSS testimonial list spacing
|
1051 |
-
* Debug true - clear out PHP notices and such
|
1052 |
-
* Default minimum height removed for widgets, now optional
|
1053 |
-
* Maximum height setting
|
1054 |
-
* [Remove CSS `position` attributes `.testimonialswidget_testimonial { position: absolute; }`](http://wordpress.org/support/topic/testimonials-widget-not-showing-correctly-on-sub-pages)
|
1055 |
-
* TODO cleanup
|
1056 |
-
* Update language POT
|
1057 |
-
* Update screenshots
|
1058 |
-
* Update WPML
|
1059 |
-
* Widget options dropdown for ORDER BY entries
|
1060 |
-
|
1061 |
-
## 2.1.9
|
1062 |
-
* Allow min_height 0
|
1063 |
-
* FAQ - How do I use the theme function `testimonialswidget_list()`?
|
1064 |
-
* Move CSS include to header
|
1065 |
-
|
1066 |
-
## 2.1.8
|
1067 |
-
* Remove testimonialswidget_widget char_limit default
|
1068 |
-
* TODO - debug true
|
1069 |
-
|
1070 |
-
## 2.1.7
|
1071 |
-
* [0 disables char_limit](http://wordpress.org/support/topic/plugin-testimonials-widget-more-than-one-testimonial-appears-overlaps-content-below-the-widget)
|
1072 |
-
* [Set link target](http://wordpress.org/support/topic/plugin-testimonials-widget-just-tried-216-thoughts-suggestions)
|
1073 |
-
* Update widget option top screenshot
|
1074 |
-
|
1075 |
-
## 2.1.6
|
1076 |
-
* FAQ: `ORDER BY` explanation
|
1077 |
-
* FAQ: `testimonial_extra` explanation
|
1078 |
-
* [Moved CSS to footer](http://wordpress.org/support/topic/plugin-testimonials-widget-html-validation)
|
1079 |
-
* Next testimonial link idea
|
1080 |
-
* Option: Add `hide_not_found` to prevent showing "No testimonials found"
|
1081 |
-
* Revise theme methods as functions
|
1082 |
-
* Screenshot: Update upper widget options
|
1083 |
-
* Staged widget testimonials are initially `display: none` via CSS `.testimonialswidget_display_none`
|
1084 |
-
* TODO updates
|
1085 |
-
* Verbiage: Refresh Interval to Rotation Speed
|
1086 |
-
* Widget option explanations
|
1087 |
-
|
1088 |
-
## 2.1.5
|
1089 |
-
* Always apply min-height
|
1090 |
-
|
1091 |
-
## 2.1.4
|
1092 |
-
* Enable WPML
|
1093 |
-
* Idea - Maximum height setting
|
1094 |
-
* Revise description
|
1095 |
-
* Revise TODO
|
1096 |
-
|
1097 |
-
## 2.1.3
|
1098 |
-
* Allow commas in meta_key
|
1099 |
-
* FAQ on page not found
|
1100 |
-
* Fix widget Random order always true condition
|
1101 |
-
* Increase bottom margin spacing for listed testimonials
|
1102 |
-
* TODO vote casting note
|
1103 |
-
* Update localization pot file
|
1104 |
-
|
1105 |
-
## 2.1.2
|
1106 |
-
* Add `hide_gravatar` option
|
1107 |
-
* Add apply_filters( 'testimonials_widget_data', $testimonial_data ) to process data before display
|
1108 |
-
* Add right margin to gravatar image
|
1109 |
-
* Added empty testimonial data field `testimonial_extra` for customization in testimonials
|
1110 |
-
* Allow widget and shortcode sorting by post meta values via `meta_key`
|
1111 |
-
* Correct PHP static accessors
|
1112 |
-
* Update FAQ
|
1113 |
-
* Update widget options screenshots
|
1114 |
-
* Working full testimonial URLs
|
1115 |
-
|
1116 |
-
## 2.1.1
|
1117 |
-
* Add [[testimonialswidget_list]] paging screenshot
|
1118 |
-
|
1119 |
-
## 2.1.0
|
1120 |
-
* Enable paging for [[testimonialswidget_list]] shortcode
|
1121 |
-
* Flush rewrite rules on activation
|
1122 |
-
* Disallow paging in widget and [[testimonialswidget_widget]] shortcode
|
1123 |
-
|
1124 |
-
## 2.0.6
|
1125 |
-
* Update shortcode option directions
|
1126 |
-
|
1127 |
-
## 2.0.5
|
1128 |
-
* Ignore already imported
|
1129 |
-
* Mark `testimonialswidget_widget() $number` argument as optional
|
1130 |
-
|
1131 |
-
## 2.0.4
|
1132 |
-
* Allow for 0 refresh_interval in get_testimonials_html
|
1133 |
-
|
1134 |
-
## 2.0.3
|
1135 |
-
* Allow for 0 refresh_interval in widget
|
1136 |
-
|
1137 |
-
## 2.0.2
|
1138 |
-
* BUGFIX [Warning: call_user_func_array() ??](http://wordpress.org/support/topic/plugin-testimonials-widget-warning-call_user_func_array)
|
1139 |
-
* Added Testimonials_Widget_Widget::get_testimonials_scripts for use with add_filter for wp_footer
|
1140 |
-
|
1141 |
-
## 2.0.1
|
1142 |
-
* Verbiage updates
|
1143 |
-
* Readme.txt validation
|
1144 |
-
* widget q p tag display inline
|
1145 |
-
* GPL2 licensing
|
1146 |
-
* Move upgrade notice text towards installation
|
1147 |
-
* Reorder screenshots
|
1148 |
-
* Apply 'the_content' filters directly to prevent plugin baggage
|
1149 |
-
* Update screenshot-7.png
|
1150 |
-
|
1151 |
-
## 2.0.0
|
1152 |
-
* Major rewrite
|
1153 |
-
* Add filters for image & gravatar sizes
|
1154 |
-
* Admin bar New > Testimonial
|
1155 |
-
* Authors and lower can manage their own testimonials
|
1156 |
-
* Auto-migration from old to new format upon install
|
1157 |
-
* Public > Published
|
1158 |
-
* Not public > Private
|
1159 |
-
* Categories - product, project, service
|
1160 |
-
* Clean up verbiage
|
1161 |
-
* Cleaner widget class
|
1162 |
-
* Custom columns list view
|
1163 |
-
* Image
|
1164 |
-
* Source
|
1165 |
-
* Shortcode
|
1166 |
-
* Email
|
1167 |
-
* Company
|
1168 |
-
* URL
|
1169 |
-
* Published by
|
1170 |
-
* Category
|
1171 |
-
* Tags
|
1172 |
-
* Date
|
1173 |
-
* Custom fields metabox
|
1174 |
-
* Email
|
1175 |
-
* Company
|
1176 |
-
* URL
|
1177 |
-
* Custom post-type
|
1178 |
-
* Default fields - source, email, company, URL
|
1179 |
-
* Editors and higher can manage all testimonials and edit testimonial publisher
|
1180 |
-
* Enable categories and tags
|
1181 |
-
* Enable full shortcode options in widget
|
1182 |
-
* Gravatar
|
1183 |
-
* HTML content allowed
|
1184 |
-
* Images
|
1185 |
-
* JavaScript in footer
|
1186 |
-
* Localization
|
1187 |
-
* Reference shortcode column
|
1188 |
-
* Reorganize widget options panel
|
1189 |
-
* Rotation JavaScript in footer than body
|
1190 |
-
* Shortcode options validation
|
1191 |
-
* WP_Query for get_testimonials()
|
1192 |
-
* Widget image on own line
|
1193 |
-
* Widget options
|
1194 |
-
* Title
|
1195 |
-
* Category filter
|
1196 |
-
* Tags filter
|
1197 |
-
* Require all tags
|
1198 |
-
* Advanced options
|
1199 |
-
* Hide image?
|
1200 |
-
* Hide source?
|
1201 |
-
* Hide email?
|
1202 |
-
* Hide company?
|
1203 |
-
* Hide URL?
|
1204 |
-
* Character limit
|
1205 |
-
* IDs filter
|
1206 |
-
* Limit
|
1207 |
-
* Maximum Height
|
1208 |
-
* Minimum Height
|
1209 |
-
* ORDER BY
|
1210 |
-
* ORDER BY Order
|
1211 |
-
* Random order
|
1212 |
-
* Rotation Speed
|
1213 |
-
* Move caching to ideas
|
1214 |
-
* Add theme function `testimonialswidget_widget()` doc
|
1215 |
-
* Update POT
|
1216 |
-
* [[testimonialswidget_widget]] shortcode
|
1217 |
-
* Match [[testimonialswidget_widget]] shortcode option defaults to widget
|
1218 |
-
* Update screenshots
|
1219 |
-
* Readd Minimum Height - need help getting around this
|
1220 |
-
|
1221 |
-
## 0.2.13
|
1222 |
-
* Clean up CSS
|
1223 |
-
* Remove q & cite p wrapper
|
1224 |
-
|
1225 |
-
## 0.2.12
|
1226 |
-
* the_title filter fix
|
1227 |
-
|
1228 |
-
## 0.2.11
|
1229 |
-
* Enable character limit for shortcode
|
1230 |
-
|
1231 |
-
## 0.2.10
|
1232 |
-
* Character limit nows forces text truncation than preventing of testimonial to show
|
1233 |
-
* Add option - Limit number of testimonials to pull at a time
|
1234 |
-
* Sanitize widget variables
|
1235 |
-
* Fix random_order issue on testimonials widget
|
1236 |
-
|
1237 |
-
## 0.2.9
|
1238 |
-
* Require Editor role for managing Testimonials
|
1239 |
-
|
1240 |
-
## 0.2.8
|
1241 |
-
* CSS testimonialswidget_testimonial_list fix #2
|
1242 |
-
|
1243 |
-
## 0.2.7
|
1244 |
-
* CSS testimonialswidget_testimonial_list fix
|
1245 |
-
|
1246 |
-
## 0.2.6
|
1247 |
-
* CSS updates for widgets and lists
|
1248 |
-
|
1249 |
-
## 0.2.5
|
1250 |
-
* Add span.testimonialswidget_join for author , join text
|
1251 |
-
* Add nl2br for testimonials display on a page
|
1252 |
-
|
1253 |
-
## 0.2.4
|
1254 |
-
* Shortcode added - Thank you Hal Gatewood
|
1255 |
-
|
1256 |
-
## 0.2.3
|
1257 |
-
* Allow testimonials to have multiple tags
|
1258 |
-
* Show only quotes with all tags
|
1259 |
-
|
1260 |
-
## 0.2.2
|
1261 |
-
* Show newest testimonials first in admin list by default
|
1262 |
-
* Quick locallization
|
1263 |
-
* Quotes Collection recommendation
|
1264 |
-
|
1265 |
-
## 2011-10-03: Version 0.2
|
1266 |
-
* Multi-widget enabled
|
1267 |
-
* Testimonial, author & source text are clickable automatically
|
1268 |
-
* Allow 0 refresh to make widget static
|
1269 |
-
* Allow pressing return when editing testimonial to save record
|
1270 |
-
|
1271 |
-
## 2011-08-12: Version 0.1
|
1272 |
-
* initial release
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trunk/CONTRIBUTING.md
DELETED
@@ -1,39 +0,0 @@
|
|
1 |
-
# CONTRIBUTE Testimonials
|
2 |
-
|
3 |
-
Community made patches, localisation, bug reports and contributions are very welcome and help make Testimonials the #1 testimonials plugin for WordPress.
|
4 |
-
|
5 |
-
When contributing please ensure you follow the guidelines below so that we can keep on top of things.
|
6 |
-
|
7 |
-
__Please Note:__ GitHub is for bug reports and contributions only - if you have a support question or a request for a customisation don't post here, go to our [Support Forum](http://wordpress.org/support/plugin/testimonials-widget) instead.
|
8 |
-
|
9 |
-
For localization, please refer to [How do I change Testimonials text labels?](https://aihrus.zendesk.com/entries/23691557-How-do-I-change-Testimonials-Widget-text-labels-), though bugs with strings that can't be translated are welcome here.
|
10 |
-
|
11 |
-
## Getting Started
|
12 |
-
|
13 |
-
* Submit a ticket for your issue, assuming one does not already exist.
|
14 |
-
* Raise it on our [Issue Tracker](https://github.com/michael-cannon/testimonials-widget/issues)
|
15 |
-
* Clearly describe the issue including steps to reproduce the bug.
|
16 |
-
* Make sure you fill in the earliest version that you know has the issue as well as the version of WordPress you're using.
|
17 |
-
|
18 |
-
## Making Changes
|
19 |
-
|
20 |
-
* Fork the repository on GitHub
|
21 |
-
* Make the changes to your forked repository
|
22 |
-
* Ensure you stick to the [WordPress Coding Standards](http://codex.wordpress.org/WordPress_Coding_Standards) and have properly documented any new functions.
|
23 |
-
* When committing, reference your issue (if present) and include a note about the fix.
|
24 |
-
* Push the changes to your fork and submit a pull request to the 'master' branch of the Testimonials repository.
|
25 |
-
|
26 |
-
## Code Documentation
|
27 |
-
|
28 |
-
* Try to ensure that every Testimonials function is documented well and follows the standards set by phpDoc.
|
29 |
-
* An example function, by Yoast, can be found [here](https://gist.github.com/jdevalk/5574677)
|
30 |
-
* Please make sure that every function is documented so that when we update our API Documentation things don't go awry!
|
31 |
-
* Finally, please use tabs and not spaces. The tab indent size should be 4 for all Testimonials code.
|
32 |
-
|
33 |
-
At this point you're waiting on us to merge your pull request. We'll review all pull requests, and make suggestions and changes if necessary.
|
34 |
-
|
35 |
-
|
36 |
-
## Additional Resources
|
37 |
-
* [Testimonials API](https://github.com/michael-cannon/testimonials-widget/blob/master/API.md)
|
38 |
-
* [General GitHub Documentation](http://help.github.com/)
|
39 |
-
* [GitHub Pull Request documentation](http://help.github.com/send-pull-requests/)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trunk/LICENSE
DELETED
@@ -1,339 +0,0 @@
|
|
1 |
-
GNU GENERAL PUBLIC LICENSE
|
2 |
-
Version 2, June 1991
|
3 |
-
|
4 |
-
Copyright (C) 1989, 1991 Free Software Foundation, Inc., <http://fsf.org/>
|
5 |
-
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
6 |
-
Everyone is permitted to copy and distribute verbatim copies
|
7 |
-
of this license document, but changing it is not allowed.
|
8 |
-
|
9 |
-
Preamble
|
10 |
-
|
11 |
-
The licenses for most software are designed to take away your
|
12 |
-
freedom to share and change it. By contrast, the GNU General Public
|
13 |
-
License is intended to guarantee your freedom to share and change free
|
14 |
-
software--to make sure the software is free for all its users. This
|
15 |
-
General Public License applies to most of the Free Software
|
16 |
-
Foundation's software and to any other program whose authors commit to
|
17 |
-
using it. (Some other Free Software Foundation software is covered by
|
18 |
-
the GNU Lesser General Public License instead.) You can apply it to
|
19 |
-
your programs, too.
|
20 |
-
|
21 |
-
When we speak of free software, we are referring to freedom, not
|
22 |
-
price. Our General Public Licenses are designed to make sure that you
|
23 |
-
have the freedom to distribute copies of free software (and charge for
|
24 |
-
this service if you wish), that you receive source code or can get it
|
25 |
-
if you want it, that you can change the software or use pieces of it
|
26 |
-
in new free programs; and that you know you can do these things.
|
27 |
-
|
28 |
-
To protect your rights, we need to make restrictions that forbid
|
29 |
-
anyone to deny you these rights or to ask you to surrender the rights.
|
30 |
-
These restrictions translate to certain responsibilities for you if you
|
31 |
-
distribute copies of the software, or if you modify it.
|
32 |
-
|
33 |
-
For example, if you distribute copies of such a program, whether
|
34 |
-
gratis or for a fee, you must give the recipients all the rights that
|
35 |
-
you have. You must make sure that they, too, receive or can get the
|
36 |
-
source code. And you must show them these terms so they know their
|
37 |
-
rights.
|
38 |
-
|
39 |
-
We protect your rights with two steps: (1) copyright the software, and
|
40 |
-
(2) offer you this license which gives you legal permission to copy,
|
41 |
-
distribute and/or modify the software.
|
42 |
-
|
43 |
-
Also, for each author's protection and ours, we want to make certain
|
44 |
-
that everyone understands that there is no warranty for this free
|
45 |
-
software. If the software is modified by someone else and passed on, we
|
46 |
-
want its recipients to know that what they have is not the original, so
|
47 |
-
that any problems introduced by others will not reflect on the original
|
48 |
-
authors' reputations.
|
49 |
-
|
50 |
-
Finally, any free program is threatened constantly by software
|
51 |
-
patents. We wish to avoid the danger that redistributors of a free
|
52 |
-
program will individually obtain patent licenses, in effect making the
|
53 |
-
program proprietary. To prevent this, we have made it clear that any
|
54 |
-
patent must be licensed for everyone's free use or not licensed at all.
|
55 |
-
|
56 |
-
The precise terms and conditions for copying, distribution and
|
57 |
-
modification follow.
|
58 |
-
|
59 |
-
GNU GENERAL PUBLIC LICENSE
|
60 |
-
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
61 |
-
|
62 |
-
0. This License applies to any program or other work which contains
|
63 |
-
a notice placed by the copyright holder saying it may be distributed
|
64 |
-
under the terms of this General Public License. The "Program", below,
|
65 |
-
refers to any such program or work, and a "work based on the Program"
|
66 |
-
means either the Program or any derivative work under copyright law:
|
67 |
-
that is to say, a work containing the Program or a portion of it,
|
68 |
-
either verbatim or with modifications and/or translated into another
|
69 |
-
language. (Hereinafter, translation is included without limitation in
|
70 |
-
the term "modification".) Each licensee is addressed as "you".
|
71 |
-
|
72 |
-
Activities other than copying, distribution and modification are not
|
73 |
-
covered by this License; they are outside its scope. The act of
|
74 |
-
running the Program is not restricted, and the output from the Program
|
75 |
-
is covered only if its contents constitute a work based on the
|
76 |
-
Program (independent of having been made by running the Program).
|
77 |
-
Whether that is true depends on what the Program does.
|
78 |
-
|
79 |
-
1. You may copy and distribute verbatim copies of the Program's
|
80 |
-
source code as you receive it, in any medium, provided that you
|
81 |
-
conspicuously and appropriately publish on each copy an appropriate
|
82 |
-
copyright notice and disclaimer of warranty; keep intact all the
|
83 |
-
notices that refer to this License and to the absence of any warranty;
|
84 |
-
and give any other recipients of the Program a copy of this License
|
85 |
-
along with the Program.
|
86 |
-
|
87 |
-
You may charge a fee for the physical act of transferring a copy, and
|
88 |
-
you may at your option offer warranty protection in exchange for a fee.
|
89 |
-
|
90 |
-
2. You may modify your copy or copies of the Program or any portion
|
91 |
-
of it, thus forming a work based on the Program, and copy and
|
92 |
-
distribute such modifications or work under the terms of Section 1
|
93 |
-
above, provided that you also meet all of these conditions:
|
94 |
-
|
95 |
-
a) You must cause the modified files to carry prominent notices
|
96 |
-
stating that you changed the files and the date of any change.
|
97 |
-
|
98 |
-
b) You must cause any work that you distribute or publish, that in
|
99 |
-
whole or in part contains or is derived from the Program or any
|
100 |
-
part thereof, to be licensed as a whole at no charge to all third
|
101 |
-
parties under the terms of this License.
|
102 |
-
|
103 |
-
c) If the modified program normally reads commands interactively
|
104 |
-
when run, you must cause it, when started running for such
|
105 |
-
interactive use in the most ordinary way, to print or display an
|
106 |
-
announcement including an appropriate copyright notice and a
|
107 |
-
notice that there is no warranty (or else, saying that you provide
|
108 |
-
a warranty) and that users may redistribute the program under
|
109 |
-
these conditions, and telling the user how to view a copy of this
|
110 |
-
License. (Exception: if the Program itself is interactive but
|
111 |
-
does not normally print such an announcement, your work based on
|
112 |
-
the Program is not required to print an announcement.)
|
113 |
-
|
114 |
-
These requirements apply to the modified work as a whole. If
|
115 |
-
identifiable sections of that work are not derived from the Program,
|
116 |
-
and can be reasonably considered independent and separate works in
|
117 |
-
themselves, then this License, and its terms, do not apply to those
|
118 |
-
sections when you distribute them as separate works. But when you
|
119 |
-
distribute the same sections as part of a whole which is a work based
|
120 |
-
on the Program, the distribution of the whole must be on the terms of
|
121 |
-
this License, whose permissions for other licensees extend to the
|
122 |
-
entire whole, and thus to each and every part regardless of who wrote it.
|
123 |
-
|
124 |
-
Thus, it is not the intent of this section to claim rights or contest
|
125 |
-
your rights to work written entirely by you; rather, the intent is to
|
126 |
-
exercise the right to control the distribution of derivative or
|
127 |
-
collective works based on the Program.
|
128 |
-
|
129 |
-
In addition, mere aggregation of another work not based on the Program
|
130 |
-
with the Program (or with a work based on the Program) on a volume of
|
131 |
-
a storage or distribution medium does not bring the other work under
|
132 |
-
the scope of this License.
|
133 |
-
|
134 |
-
3. You may copy and distribute the Program (or a work based on it,
|
135 |
-
under Section 2) in object code or executable form under the terms of
|
136 |
-
Sections 1 and 2 above provided that you also do one of the following:
|
137 |
-
|
138 |
-
a) Accompany it with the complete corresponding machine-readable
|
139 |
-
source code, which must be distributed under the terms of Sections
|
140 |
-
1 and 2 above on a medium customarily used for software interchange; or,
|
141 |
-
|
142 |
-
b) Accompany it with a written offer, valid for at least three
|
143 |
-
years, to give any third party, for a charge no more than your
|
144 |
-
cost of physically performing source distribution, a complete
|
145 |
-
machine-readable copy of the corresponding source code, to be
|
146 |
-
distributed under the terms of Sections 1 and 2 above on a medium
|
147 |
-
customarily used for software interchange; or,
|
148 |
-
|
149 |
-
c) Accompany it with the information you received as to the offer
|
150 |
-
to distribute corresponding source code. (This alternative is
|
151 |
-
allowed only for noncommercial distribution and only if you
|
152 |
-
received the program in object code or executable form with such
|
153 |
-
an offer, in accord with Subsection b above.)
|
154 |
-
|
155 |
-
The source code for a work means the preferred form of the work for
|
156 |
-
making modifications to it. For an executable work, complete source
|
157 |
-
code means all the source code for all modules it contains, plus any
|
158 |
-
associated interface definition files, plus the scripts used to
|
159 |
-
control compilation and installation of the executable. However, as a
|
160 |
-
special exception, the source code distributed need not include
|
161 |
-
anything that is normally distributed (in either source or binary
|
162 |
-
form) with the major components (compiler, kernel, and so on) of the
|
163 |
-
operating system on which the executable runs, unless that component
|
164 |
-
itself accompanies the executable.
|
165 |
-
|
166 |
-
If distribution of executable or object code is made by offering
|
167 |
-
access to copy from a designated place, then offering equivalent
|
168 |
-
access to copy the source code from the same place counts as
|
169 |
-
distribution of the source code, even though third parties are not
|
170 |
-
compelled to copy the source along with the object code.
|
171 |
-
|
172 |
-
4. You may not copy, modify, sublicense, or distribute the Program
|
173 |
-
except as expressly provided under this License. Any attempt
|
174 |
-
otherwise to copy, modify, sublicense or distribute the Program is
|
175 |
-
void, and will automatically terminate your rights under this License.
|
176 |
-
However, parties who have received copies, or rights, from you under
|
177 |
-
this License will not have their licenses terminated so long as such
|
178 |
-
parties remain in full compliance.
|
179 |
-
|
180 |
-
5. You are not required to accept this License, since you have not
|
181 |
-
signed it. However, nothing else grants you permission to modify or
|
182 |
-
distribute the Program or its derivative works. These actions are
|
183 |
-
prohibited by law if you do not accept this License. Therefore, by
|
184 |
-
modifying or distributing the Program (or any work based on the
|
185 |
-
Program), you indicate your acceptance of this License to do so, and
|
186 |
-
all its terms and conditions for copying, distributing or modifying
|
187 |
-
the Program or works based on it.
|
188 |
-
|
189 |
-
6. Each time you redistribute the Program (or any work based on the
|
190 |
-
Program), the recipient automatically receives a license from the
|
191 |
-
original licensor to copy, distribute or modify the Program subject to
|
192 |
-
these terms and conditions. You may not impose any further
|
193 |
-
restrictions on the recipients' exercise of the rights granted herein.
|
194 |
-
You are not responsible for enforcing compliance by third parties to
|
195 |
-
this License.
|
196 |
-
|
197 |
-
7. If, as a consequence of a court judgment or allegation of patent
|
198 |
-
infringement or for any other reason (not limited to patent issues),
|
199 |
-
conditions are imposed on you (whether by court order, agreement or
|
200 |
-
otherwise) that contradict the conditions of this License, they do not
|
201 |
-
excuse you from the conditions of this License. If you cannot
|
202 |
-
distribute so as to satisfy simultaneously your obligations under this
|
203 |
-
License and any other pertinent obligations, then as a consequence you
|
204 |
-
may not distribute the Program at all. For example, if a patent
|
205 |
-
license would not permit royalty-free redistribution of the Program by
|
206 |
-
all those who receive copies directly or indirectly through you, then
|
207 |
-
the only way you could satisfy both it and this License would be to
|
208 |
-
refrain entirely from distribution of the Program.
|
209 |
-
|
210 |
-
If any portion of this section is held invalid or unenforceable under
|
211 |
-
any particular circumstance, the balance of the section is intended to
|
212 |
-
apply and the section as a whole is intended to apply in other
|
213 |
-
circumstances.
|
214 |
-
|
215 |
-
It is not the purpose of this section to induce you to infringe any
|
216 |
-
patents or other property right claims or to contest validity of any
|
217 |
-
such claims; this section has the sole purpose of protecting the
|
218 |
-
integrity of the free software distribution system, which is
|
219 |
-
implemented by public license practices. Many people have made
|
220 |
-
generous contributions to the wide range of software distributed
|
221 |
-
through that system in reliance on consistent application of that
|
222 |
-
system; it is up to the author/donor to decide if he or she is willing
|
223 |
-
to distribute software through any other system and a licensee cannot
|
224 |
-
impose that choice.
|
225 |
-
|
226 |
-
This section is intended to make thoroughly clear what is believed to
|
227 |
-
be a consequence of the rest of this License.
|
228 |
-
|
229 |
-
8. If the distribution and/or use of the Program is restricted in
|
230 |
-
certain countries either by patents or by copyrighted interfaces, the
|
231 |
-
original copyright holder who places the Program under this License
|
232 |
-
may add an explicit geographical distribution limitation excluding
|
233 |
-
those countries, so that distribution is permitted only in or among
|
234 |
-
countries not thus excluded. In such case, this License incorporates
|
235 |
-
the limitation as if written in the body of this License.
|
236 |
-
|
237 |
-
9. The Free Software Foundation may publish revised and/or new versions
|
238 |
-
of the General Public License from time to time. Such new versions will
|
239 |
-
be similar in spirit to the present version, but may differ in detail to
|
240 |
-
address new problems or concerns.
|
241 |
-
|
242 |
-
Each version is given a distinguishing version number. If the Program
|
243 |
-
specifies a version number of this License which applies to it and "any
|
244 |
-
later version", you have the option of following the terms and conditions
|
245 |
-
either of that version or of any later version published by the Free
|
246 |
-
Software Foundation. If the Program does not specify a version number of
|
247 |
-
this License, you may choose any version ever published by the Free Software
|
248 |
-
Foundation.
|
249 |
-
|
250 |
-
10. If you wish to incorporate parts of the Program into other free
|
251 |
-
programs whose distribution conditions are different, write to the author
|
252 |
-
to ask for permission. For software which is copyrighted by the Free
|
253 |
-
Software Foundation, write to the Free Software Foundation; we sometimes
|
254 |
-
make exceptions for this. Our decision will be guided by the two goals
|
255 |
-
of preserving the free status of all derivatives of our free software and
|
256 |
-
of promoting the sharing and reuse of software generally.
|
257 |
-
|
258 |
-
NO WARRANTY
|
259 |
-
|
260 |
-
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
261 |
-
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
262 |
-
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
263 |
-
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
264 |
-
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
265 |
-
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
266 |
-
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
267 |
-
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
268 |
-
REPAIR OR CORRECTION.
|
269 |
-
|
270 |
-
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
271 |
-
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
272 |
-
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
273 |
-
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
274 |
-
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
275 |
-
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
276 |
-
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
277 |
-
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
278 |
-
POSSIBILITY OF SUCH DAMAGES.
|
279 |
-
|
280 |
-
END OF TERMS AND CONDITIONS
|
281 |
-
|
282 |
-
How to Apply These Terms to Your New Programs
|
283 |
-
|
284 |
-
If you develop a new program, and you want it to be of the greatest
|
285 |
-
possible use to the public, the best way to achieve this is to make it
|
286 |
-
free software which everyone can redistribute and change under these terms.
|
287 |
-
|
288 |
-
To do so, attach the following notices to the program. It is safest
|
289 |
-
to attach them to the start of each source file to most effectively
|
290 |
-
convey the exclusion of warranty; and each file should have at least
|
291 |
-
the "copyright" line and a pointer to where the full notice is found.
|
292 |
-
|
293 |
-
{description}
|
294 |
-
Copyright (C) {year} {fullname}
|
295 |
-
|
296 |
-
This program is free software; you can redistribute it and/or modify
|
297 |
-
it under the terms of the GNU General Public License as published by
|
298 |
-
the Free Software Foundation; either version 2 of the License, or
|
299 |
-
(at your option) any later version.
|
300 |
-
|
301 |
-
This program is distributed in the hope that it will be useful,
|
302 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
303 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
304 |
-
GNU General Public License for more details.
|
305 |
-
|
306 |
-
You should have received a copy of the GNU General Public License along
|
307 |
-
with this program; if not, write to the Free Software Foundation, Inc.,
|
308 |
-
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
309 |
-
|
310 |
-
Also add information on how to contact you by electronic and paper mail.
|
311 |
-
|
312 |
-
If the program is interactive, make it output a short notice like this
|
313 |
-
when it starts in an interactive mode:
|
314 |
-
|
315 |
-
Gnomovision version 69, Copyright (C) year name of author
|
316 |
-
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
317 |
-
This is free software, and you are welcome to redistribute it
|
318 |
-
under certain conditions; type `show c' for details.
|
319 |
-
|
320 |
-
The hypothetical commands `show w' and `show c' should show the appropriate
|
321 |
-
parts of the General Public License. Of course, the commands you use may
|
322 |
-
be called something other than `show w' and `show c'; they could even be
|
323 |
-
mouse-clicks or menu items--whatever suits your program.
|
324 |
-
|
325 |
-
You should also get your employer (if you work as a programmer) or your
|
326 |
-
school, if any, to sign a "copyright disclaimer" for the program, if
|
327 |
-
necessary. Here is a sample; alter the names:
|
328 |
-
|
329 |
-
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
330 |
-
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
331 |
-
|
332 |
-
{signature of Ty Coon}, 1 April 1989
|
333 |
-
Ty Coon, President of Vice
|
334 |
-
|
335 |
-
This General Public License does not permit incorporating your program into
|
336 |
-
proprietary programs. If your program is a subroutine library, you may
|
337 |
-
consider it more useful to permit linking proprietary applications with the
|
338 |
-
library. If this is what you want to do, use the GNU Lesser General
|
339 |
-
Public License instead of this License.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trunk/README.md
DELETED
@@ -1,42 +0,0 @@
|
|
1 |
-
# README Testimonials WordPress Plugin
|
2 |
-
|
3 |
-
[![Codeship status](https://www.codeship.io/projects/b5524630-43f6-0131-3b4d-76a8e32a74d4/status)](https://www.codeship.io/projects/10739)
|
4 |
-
[![ProjectStatus](http://stillmaintained.com/michael-cannon/testimonials-widget.png)](http://stillmaintained.com/michael-cannon/testimonials-widget)
|
5 |
-
|
6 |
-
## Welcome to the Testimonials Github repository
|
7 |
-
|
8 |
-
Testimonials plugin allows you to display random or selected portfolio, quotes, reviews, showcases, or text with images on your WordPress blog.
|
9 |
-
|
10 |
-
While the documentation for the [Testimonials plugin](http://wordpress.org/plugins/testimonials-widget/) can be found at WordPress.org Plugin Directory, here you can browse the source of the project, find and discuss open issues and, even [contribute yourself](https://github.com/michael-cannon/testimonials-widget/blob/master/CONTRIBUTING.md).
|
11 |
-
|
12 |
-
## Installation
|
13 |
-
|
14 |
-
Here's a [guide on how to install Testimonials in your WordPress site](http://wordpress.org/plugins/testimonials-widget/installation/). If you want to run the Git version though, you have two options:
|
15 |
-
|
16 |
-
* You can clone the GitHub repository: https://github.com/michael-cannon/testimonials-widget.git
|
17 |
-
* Download it directly as a ZIP file: https://github.com/michael-cannon/testimonials-widget/archive/master.zip
|
18 |
-
|
19 |
-
This will download the latest development version of Testimonials by Michael Cannon. While this version is usually stable, it is not recommended for use in a production environment.
|
20 |
-
|
21 |
-
## Bugs
|
22 |
-
|
23 |
-
If you find an issue, [let us know here](https://github.com/michael-cannon/testimonials-widget/issues/new)!
|
24 |
-
|
25 |
-
## Support
|
26 |
-
|
27 |
-
This is a developer's portal for Testimonials by Michael Cannon and should not be used for support. Please visit the [Testimonials Knowledge Base](https://aihrus.zendesk.com/categories/20104507-Testimonials-Widget) for frequently asked questions, offering ideas, or getting support.
|
28 |
-
|
29 |
-
## Contributions
|
30 |
-
|
31 |
-
Anyone is welcome to contribute to Testimonials. Please [read the guidelines](https://github.com/michael-cannon/testimonials-widget/blob/master/CONTRIBUTING.md) for contributing to this repository.
|
32 |
-
|
33 |
-
There are various ways you can contribute:
|
34 |
-
|
35 |
-
* [Raise an issue](https://github.com/michael-cannon/testimonials-widget/issues) on GitHub.
|
36 |
-
* Fork Testimonials and send us a Pull Request with your bug fixes and/or new features.
|
37 |
-
* [Translate Testimonials by Michael Cannon into different languages](https://aihrus.zendesk.com/entries/23691557-How-do-I-change-Testimonials-Widget-text-labels-).
|
38 |
-
* Provide feedback and [suggestions on enhancements](https://github.com/michael-cannon/testimonials-widget/issues?direction=desc&labels=Enhancement&page=1&sort=created&state=open).
|
39 |
-
|
40 |
-
## Thank You
|
41 |
-
|
42 |
-
* Thank you [WordPress SEO by Yoast](https://github.com/jdevalk/wordpress-seo/blob/master/README.md) for this README.md and like inspirations.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trunk/assets/css/images/bx_loader.gif
DELETED
Binary file
|
trunk/assets/css/images/controls.png
DELETED
Binary file
|
trunk/assets/css/jquery.bxslider.css
DELETED
@@ -1,204 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
* BxSlider v4.1.2 - Fully loaded, responsive content slider
|
3 |
-
* http://bxslider.com
|
4 |
-
*
|
5 |
-
* Written by: Steven Wanderski, 2014
|
6 |
-
* http://stevenwanderski.com
|
7 |
-
* (while drinking Belgian ales and listening to jazz)
|
8 |
-
*
|
9 |
-
* CEO and founder of bxCreative, LTD
|
10 |
-
* http://bxcreative.com
|
11 |
-
*/
|
12 |
-
|
13 |
-
|
14 |
-
/** RESET AND LAYOUT
|
15 |
-
===================================*/
|
16 |
-
|
17 |
-
.bx-wrapper {
|
18 |
-
position: relative;
|
19 |
-
margin: 0 auto 60px;
|
20 |
-
padding: 0;
|
21 |
-
*zoom: 1;
|
22 |
-
}
|
23 |
-
|
24 |
-
.bx-wrapper img {
|
25 |
-
max-width: 100%;
|
26 |
-
display: block;
|
27 |
-
}
|
28 |
-
|
29 |
-
/** THEME
|
30 |
-
===================================*/
|
31 |
-
|
32 |
-
.bx-wrapper .bx-viewport {
|
33 |
-
-moz-box-shadow: 0 0 5px #ccc;
|
34 |
-
-webkit-box-shadow: 0 0 5px #ccc;
|
35 |
-
box-shadow: 0 0 5px #ccc;
|
36 |
-
border: 5px solid #fff;
|
37 |
-
left: -5px;
|
38 |
-
background: #fff;
|
39 |
-
|
40 |
-
/*fix other elements on the page moving (on Chrome)*/
|
41 |
-
-webkit-transform: translatez(0);
|
42 |
-
-moz-transform: translatez(0);
|
43 |
-
-ms-transform: translatez(0);
|
44 |
-
-o-transform: translatez(0);
|
45 |
-
transform: translatez(0);
|
46 |
-
}
|
47 |
-
|
48 |
-
.bx-wrapper .bx-pager,
|
49 |
-
.bx-wrapper .bx-controls-auto {
|
50 |
-
position: absolute;
|
51 |
-
bottom: -30px;
|
52 |
-
width: 100%;
|
53 |
-
}
|
54 |
-
|
55 |
-
/* LOADER */
|
56 |
-
|
57 |
-
.bx-wrapper .bx-loading {
|
58 |
-
min-height: 50px;
|
59 |
-
background: url(images/bx_loader.gif) center center no-repeat #fff;
|
60 |
-
height: 100%;
|
61 |
-
width: 100%;
|
62 |
-
position: absolute;
|
63 |
-
top: 0;
|
64 |
-
left: 0;
|
65 |
-
z-index: 2000;
|
66 |
-
}
|
67 |
-
|
68 |
-
/* PAGER */
|
69 |
-
|
70 |
-
.bx-wrapper .bx-pager {
|
71 |
-
text-align: center;
|
72 |
-
font-size: .85em;
|
73 |
-
font-family: Arial;
|
74 |
-
font-weight: bold;
|
75 |
-
color: #666;
|
76 |
-
padding-top: 20px;
|
77 |
-
}
|
78 |
-
|
79 |
-
.bx-wrapper .bx-pager .bx-pager-item,
|
80 |
-
.bx-wrapper .bx-controls-auto .bx-controls-auto-item {
|
81 |
-
display: inline-block;
|
82 |
-
*zoom: 1;
|
83 |
-
*display: inline;
|
84 |
-
}
|
85 |
-
|
86 |
-
.bx-wrapper .bx-pager.bx-default-pager a {
|
87 |
-
background: #666;
|
88 |
-
text-indent: -9999px;
|
89 |
-
display: block;
|
90 |
-
width: 10px;
|
91 |
-
height: 10px;
|
92 |
-
margin: 0 5px;
|
93 |
-
outline: 0;
|
94 |
-
-moz-border-radius: 5px;
|
95 |
-
-webkit-border-radius: 5px;
|
96 |
-
border-radius: 5px;
|
97 |
-
}
|
98 |
-
|
99 |
-
.bx-wrapper .bx-pager.bx-default-pager a:hover,
|
100 |
-
.bx-wrapper .bx-pager.bx-default-pager a.active {
|
101 |
-
background: #000;
|
102 |
-
}
|
103 |
-
|
104 |
-
/* DIRECTION CONTROLS (NEXT / PREV) */
|
105 |
-
|
106 |
-
.bx-wrapper .bx-prev {
|
107 |
-
left: 10px;
|
108 |
-
background: url(images/controls.png) no-repeat 0 -32px;
|
109 |
-
}
|
110 |
-
|
111 |
-
.bx-wrapper .bx-next {
|
112 |
-
right: 10px;
|
113 |
-
background: url(images/controls.png) no-repeat -43px -32px;
|
114 |
-
}
|
115 |
-
|
116 |
-
.bx-wrapper .bx-prev:hover {
|
117 |
-
background-position: 0 0;
|
118 |
-
}
|
119 |
-
|
120 |
-
.bx-wrapper .bx-next:hover {
|
121 |
-
background-position: -43px 0;
|
122 |
-
}
|
123 |
-
|
124 |
-
.bx-wrapper .bx-controls-direction a {
|
125 |
-
position: absolute;
|
126 |
-
top: 50%;
|
127 |
-
margin-top: -16px;
|
128 |
-
outline: 0;
|
129 |
-
width: 32px;
|
130 |
-
height: 32px;
|
131 |
-
text-indent: -9999px;
|
132 |
-
z-index: 9999;
|
133 |
-
}
|
134 |
-
|
135 |
-
.bx-wrapper .bx-controls-direction a.disabled {
|
136 |
-
display: none;
|
137 |
-
}
|
138 |
-
|
139 |
-
/* AUTO CONTROLS (START / STOP) */
|
140 |
-
|
141 |
-
.bx-wrapper .bx-controls-auto {
|
142 |
-
text-align: center;
|
143 |
-
}
|
144 |
-
|
145 |
-
.bx-wrapper .bx-controls-auto .bx-start {
|
146 |
-
display: block;
|
147 |
-
text-indent: -9999px;
|
148 |
-
width: 10px;
|
149 |
-
height: 11px;
|
150 |
-
outline: 0;
|
151 |
-
background: url(images/controls.png) -86px -11px no-repeat;
|
152 |
-
margin: 0 3px;
|
153 |
-
}
|
154 |
-
|
155 |
-
.bx-wrapper .bx-controls-auto .bx-start:hover,
|
156 |
-
.bx-wrapper .bx-controls-auto .bx-start.active {
|
157 |
-
background-position: -86px 0;
|
158 |
-
}
|
159 |
-
|
160 |
-
.bx-wrapper .bx-controls-auto .bx-stop {
|
161 |
-
display: block;
|
162 |
-
text-indent: -9999px;
|
163 |
-
width: 9px;
|
164 |
-
height: 11px;
|
165 |
-
outline: 0;
|
166 |
-
background: url(images/controls.png) -86px -44px no-repeat;
|
167 |
-
margin: 0 3px;
|
168 |
-
}
|
169 |
-
|
170 |
-
.bx-wrapper .bx-controls-auto .bx-stop:hover,
|
171 |
-
.bx-wrapper .bx-controls-auto .bx-stop.active {
|
172 |
-
background-position: -86px -33px;
|
173 |
-
}
|
174 |
-
|
175 |
-
/* PAGER WITH AUTO-CONTROLS HYBRID LAYOUT */
|
176 |
-
|
177 |
-
.bx-wrapper .bx-controls.bx-has-controls-auto.bx-has-pager .bx-pager {
|
178 |
-
text-align: left;
|
179 |
-
width: 80%;
|
180 |
-
}
|
181 |
-
|
182 |
-
.bx-wrapper .bx-controls.bx-has-controls-auto.bx-has-pager .bx-controls-auto {
|
183 |
-
right: 0;
|
184 |
-
width: 35px;
|
185 |
-
}
|
186 |
-
|
187 |
-
/* IMAGE CAPTIONS */
|
188 |
-
|
189 |
-
.bx-wrapper .bx-caption {
|
190 |
-
position: absolute;
|
191 |
-
bottom: 0;
|
192 |
-
left: 0;
|
193 |
-
background: #666\9;
|
194 |
-
background: rgba(80, 80, 80, 0.75);
|
195 |
-
width: 100%;
|
196 |
-
}
|
197 |
-
|
198 |
-
.bx-wrapper .bx-caption span {
|
199 |
-
color: #fff;
|
200 |
-
font-family: Arial;
|
201 |
-
display: block;
|
202 |
-
font-size: .85em;
|
203 |
-
padding: 10px;
|
204 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trunk/assets/css/testimonials-widget-2.14.0.css
DELETED
@@ -1,120 +0,0 @@
|
|
1 |
-
.testimonials-widget-testimonials {
|
2 |
-
/* testimonials wrapper */
|
3 |
-
}
|
4 |
-
|
5 |
-
.testimonials-widget-testimonial {
|
6 |
-
clear: left;
|
7 |
-
display: none;
|
8 |
-
margin: 0 0 1.4em;
|
9 |
-
}
|
10 |
-
|
11 |
-
.testimonials-widget-testimonials .active {
|
12 |
-
/* active testimonials */
|
13 |
-
display: block;
|
14 |
-
}
|
15 |
-
|
16 |
-
.testimonials-widget-testimonials .display-none {
|
17 |
-
/* staged testimonials */
|
18 |
-
display: none;
|
19 |
-
}
|
20 |
-
|
21 |
-
.testimonials-widget-testimonials .paging {
|
22 |
-
clear: both;
|
23 |
-
font-weight: 700;
|
24 |
-
height: 1.4em;
|
25 |
-
}
|
26 |
-
|
27 |
-
.testimonials-widget-testimonials .paging.prepend {
|
28 |
-
margin-bottom: 1em;
|
29 |
-
}
|
30 |
-
|
31 |
-
.testimonials-widget-testimonials .paging.append {
|
32 |
-
margin-top: 1em;
|
33 |
-
}
|
34 |
-
|
35 |
-
.testimonials-widget-testimonials .alignleft {
|
36 |
-
float: left;
|
37 |
-
}
|
38 |
-
|
39 |
-
.testimonials-widget-testimonials .alignright {
|
40 |
-
float: right;
|
41 |
-
}
|
42 |
-
|
43 |
-
.testimonials-widget-testimonial.list,
|
44 |
-
.testimonials-widget-testimonial.single {
|
45 |
-
display: block;
|
46 |
-
}
|
47 |
-
|
48 |
-
.testimonials-widget-testimonial .image {
|
49 |
-
float: left;
|
50 |
-
margin-bottom: .4em;
|
51 |
-
margin-right: .2em;
|
52 |
-
}
|
53 |
-
|
54 |
-
.widget .testimonials-widget-testimonial .image {
|
55 |
-
display: block;
|
56 |
-
float: none;
|
57 |
-
}
|
58 |
-
|
59 |
-
.testimonials-widget-testimonial q,
|
60 |
-
.testimonials-widget-testimonial blockquote {
|
61 |
-
/* the testimonial itself */
|
62 |
-
quotes: none;
|
63 |
-
}
|
64 |
-
|
65 |
-
.testimonials-widget-testimonial .open-quote:before {
|
66 |
-
content: '\201C';
|
67 |
-
}
|
68 |
-
|
69 |
-
.testimonials-widget-testimonial .close-quote:after {
|
70 |
-
content: '\201D';
|
71 |
-
}
|
72 |
-
|
73 |
-
.testimonials-widget-testimonial cite,
|
74 |
-
.testimonials-widget-testimonial div.credit {
|
75 |
-
/* outer wrapper for source & company */
|
76 |
-
display: block; /* To display source and company on a new line */
|
77 |
-
margin-top: .2em;
|
78 |
-
text-align: right;
|
79 |
-
}
|
80 |
-
|
81 |
-
.widget .testimonials-widget-testimonial cite,
|
82 |
-
.widget .testimonials-widget-testimonial div.credit {
|
83 |
-
margin-top: .8em;
|
84 |
-
}
|
85 |
-
|
86 |
-
.widget .testimonials-widget-testimonial .whitespace cite,
|
87 |
-
.widget .whitespace cite,
|
88 |
-
.widget .testimonials-widget-testimonial .whitespace div.credit,
|
89 |
-
.widget .whitespace div.credit {
|
90 |
-
margin-top: .2em;
|
91 |
-
}
|
92 |
-
|
93 |
-
.testimonials-widget-testimonial cite:before,
|
94 |
-
.testimonials-widget-testimonial div.credit:before {
|
95 |
-
content: "– "
|
96 |
-
}
|
97 |
-
|
98 |
-
.testimonials-widget-testimonial .join-title:before,
|
99 |
-
.testimonials-widget-testimonial .join-location:before,
|
100 |
-
.testimonials-widget-testimonial .join:before {
|
101 |
-
/* join text */
|
102 |
-
content: ", "
|
103 |
-
}
|
104 |
-
|
105 |
-
.testimonials-widget-testimonial .author,
|
106 |
-
.testimonials-widget-testimonial .email,
|
107 |
-
.testimonials-widget-testimonial .job-title,
|
108 |
-
.testimonials-widget-testimonial .location,
|
109 |
-
.testimonials-widget-testimonial .company,
|
110 |
-
.testimonials-widget-testimonial .url {
|
111 |
-
/* testimonial title, company and url informaiton */
|
112 |
-
}
|
113 |
-
|
114 |
-
.testimonials-widget-testimonial .extra {
|
115 |
-
margin-top: .8em;
|
116 |
-
}
|
117 |
-
|
118 |
-
.testimonials-widget-testimonial .bottom_text {
|
119 |
-
margin-top: 1.4em;
|
120 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trunk/assets/css/testimonials-widget-ie7.css
DELETED
@@ -1,15 +0,0 @@
|
|
1 |
-
/*csslint star-property-hack: false*/
|
2 |
-
.testimonials-widget-testimonial .open-quote {
|
3 |
-
*zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '“' );
|
4 |
-
}
|
5 |
-
|
6 |
-
.testimonials-widget-testimonial .close-quote {
|
7 |
-
*zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '”' );
|
8 |
-
}
|
9 |
-
|
10 |
-
.testimonials-widget-testimonial .join-title,
|
11 |
-
.testimonials-widget-testimonial .join-location,
|
12 |
-
.testimonials-widget-testimonial .join {
|
13 |
-
/* section between source and company information */
|
14 |
-
*zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ', ' );
|
15 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trunk/assets/css/testimonials-widget.css
DELETED
@@ -1,124 +0,0 @@
|
|
1 |
-
.testimonials-widget-testimonials {
|
2 |
-
}
|
3 |
-
|
4 |
-
.testimonials-widget-testimonial {
|
5 |
-
}
|
6 |
-
|
7 |
-
.testimonials-widget-testimonials .active {
|
8 |
-
/* active testimonials */
|
9 |
-
display: block;
|
10 |
-
}
|
11 |
-
|
12 |
-
.testimonials-widget-testimonials .display-none {
|
13 |
-
/* staged testimonials */
|
14 |
-
display: none;
|
15 |
-
}
|
16 |
-
|
17 |
-
.testimonials-widget-testimonials .paging {
|
18 |
-
clear: both;
|
19 |
-
font-weight: 700;
|
20 |
-
height: 1.4em;
|
21 |
-
}
|
22 |
-
|
23 |
-
.testimonials-widget-testimonials .paging.prepend {
|
24 |
-
margin-bottom: 1em;
|
25 |
-
}
|
26 |
-
|
27 |
-
.testimonials-widget-testimonials .paging.append {
|
28 |
-
margin-top: 1em;
|
29 |
-
}
|
30 |
-
|
31 |
-
.testimonials-widget-testimonials .alignleft {
|
32 |
-
float: left;
|
33 |
-
}
|
34 |
-
|
35 |
-
.testimonials-widget-testimonials .alignright {
|
36 |
-
float: right;
|
37 |
-
}
|
38 |
-
|
39 |
-
.testimonials-widget-testimonial.list,
|
40 |
-
.testimonials-widget-testimonial.single {
|
41 |
-
clear: left;
|
42 |
-
}
|
43 |
-
|
44 |
-
.testimonials-widget-testimonial .image {
|
45 |
-
float: left;
|
46 |
-
margin-bottom: .4em;
|
47 |
-
margin-right: .2em;
|
48 |
-
}
|
49 |
-
|
50 |
-
.widget .testimonials-widget-testimonial .image {
|
51 |
-
display: block;
|
52 |
-
float: none;
|
53 |
-
}
|
54 |
-
|
55 |
-
.testimonials-widget-testimonial q,
|
56 |
-
.testimonials-widget-testimonial blockquote {
|
57 |
-
/* the testimonial itself */
|
58 |
-
quotes: none;
|
59 |
-
}
|
60 |
-
|
61 |
-
.testimonials-widget-testimonial .open-quote:before {
|
62 |
-
content: '\201C';
|
63 |
-
}
|
64 |
-
|
65 |
-
.testimonials-widget-testimonial .close-quote:after {
|
66 |
-
content: '\201D';
|
67 |
-
}
|
68 |
-
|
69 |
-
.testimonials-widget-testimonial cite,
|
70 |
-
.testimonials-widget-testimonial div.credit {
|
71 |
-
/* outer wrapper for source & company */
|
72 |
-
display: block; /* To display source and company on a new line */
|
73 |
-
margin-top: .2em;
|
74 |
-
text-align: right;
|
75 |
-
}
|
76 |
-
|
77 |
-
.widget .testimonials-widget-testimonial cite,
|
78 |
-
.widget .testimonials-widget-testimonial div.credit {
|
79 |
-
margin-top: .8em;
|
80 |
-
}
|
81 |
-
|
82 |
-
.widget .testimonials-widget-testimonial .whitespace cite,
|
83 |
-
.widget .whitespace cite,
|
84 |
-
.widget .testimonials-widget-testimonial .whitespace div.credit,
|
85 |
-
.widget .whitespace div.credit {
|
86 |
-
margin-top: .2em;
|
87 |
-
}
|
88 |
-
|
89 |
-
.testimonials-widget-testimonial cite:before,
|
90 |
-
.testimonials-widget-testimonial div.credit:before {
|
91 |
-
content: "– "
|
92 |
-
}
|
93 |
-
|
94 |
-
.testimonials-widget-testimonial .join-title:before,
|
95 |
-
.testimonials-widget-testimonial .join-location:before,
|
96 |
-
.testimonials-widget-testimonial .join:before {
|
97 |
-
/* join text */
|
98 |
-
content: ", "
|
99 |
-
}
|
100 |
-
|
101 |
-
.testimonials-widget-testimonial .author,
|
102 |
-
.testimonials-widget-testimonial .email,
|
103 |
-
.testimonials-widget-testimonial .job-title,
|
104 |
-
.testimonials-widget-testimonial .location,
|
105 |
-
.testimonials-widget-testimonial .company,
|
106 |
-
.testimonials-widget-testimonial .url {
|
107 |
-
/* testimonial title, company and url informaiton */
|
108 |
-
}
|
109 |
-
|
110 |
-
.testimonials-widget-testimonial .extra {
|
111 |
-
margin-top: .8em;
|
112 |
-
}
|
113 |
-
|
114 |
-
.testimonials-widget-testimonial .bottom_text {
|
115 |
-
margin-top: 1.4em;
|
116 |
-
}
|
117 |
-
|
118 |
-
.bx-wrapper .bx-viewport {
|
119 |
-
-moz-box-shadow: none;
|
120 |
-
-webkit-box-shadow: none;
|
121 |
-
box-shadow: none;
|
122 |
-
border: none;
|
123 |
-
background: transparent !important;
|
124 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trunk/assets/images/michael-cannon-red-square-300x2251.jpg
DELETED
Binary file
|
trunk/assets/js/jquery.bxslider.js
DELETED
@@ -1,1343 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
* BxSlider v4.1.2 - Fully loaded, responsive content slider
|
3 |
-
* http://bxslider.com
|
4 |
-
*
|
5 |
-
* Copyright 2014, Steven Wanderski - http://stevenwanderski.com - http://bxcreative.com
|
6 |
-
* Written while drinking Belgian ales and listening to jazz
|
7 |
-
*
|
8 |
-
* Released under the MIT license - http://opensource.org/licenses/MIT
|
9 |
-
*/
|
10 |
-
|
11 |
-
;(function($){
|
12 |
-
|
13 |
-
var plugin = {};
|
14 |
-
|
15 |
-
var defaults = {
|
16 |
-
|
17 |
-
// GENERAL
|
18 |
-
mode: 'horizontal',
|
19 |
-
slideSelector: '',
|
20 |
-
infiniteLoop: true,
|
21 |
-
hideControlOnEnd: false,
|
22 |
-
speed: 500,
|
23 |
-
easing: null,
|
24 |
-
slideMargin: 0,
|
25 |
-
startSlide: 0,
|
26 |
-
randomStart: false,
|
27 |
-
captions: false,
|
28 |
-
ticker: false,
|
29 |
-
tickerHover: false,
|
30 |
-
adaptiveHeight: false,
|
31 |
-
adaptiveHeightSpeed: 500,
|
32 |
-
video: false,
|
33 |
-
useCSS: true,
|
34 |
-
preloadImages: 'visible',
|
35 |
-
responsive: true,
|
36 |
-
slideZIndex: 50,
|
37 |
-
wrapperClass: 'bx-wrapper',
|
38 |
-
|
39 |
-
// TOUCH
|
40 |
-
touchEnabled: true,
|
41 |
-
swipeThreshold: 50,
|
42 |
-
oneToOneTouch: true,
|
43 |
-
preventDefaultSwipeX: true,
|
44 |
-
preventDefaultSwipeY: false,
|
45 |
-
|
46 |
-
// PAGER
|
47 |
-
pager: true,
|
48 |
-
pagerType: 'full',
|
49 |
-
pagerShortSeparator: ' / ',
|
50 |
-
pagerSelector: null,
|
51 |
-
buildPager: null,
|
52 |
-
pagerCustom: null,
|
53 |
-
|
54 |
-
// CONTROLS
|
55 |
-
controls: true,
|
56 |
-
nextText: 'Next',
|
57 |
-
prevText: 'Prev',
|
58 |
-
nextSelector: null,
|
59 |
-
prevSelector: null,
|
60 |
-
autoControls: false,
|
61 |
-
startText: 'Start',
|
62 |
-
stopText: 'Stop',
|
63 |
-
autoControlsCombine: false,
|
64 |
-
autoControlsSelector: null,
|
65 |
-
|
66 |
-
// AUTO
|
67 |
-
auto: false,
|
68 |
-
pause: 4000,
|
69 |
-
autoStart: true,
|
70 |
-
autoDirection: 'next',
|
71 |
-
autoHover: false,
|
72 |
-
autoDelay: 0,
|
73 |
-
autoSlideForOnePage: false,
|
74 |
-
|
75 |
-
// CAROUSEL
|
76 |
-
minSlides: 1,
|
77 |
-
maxSlides: 1,
|
78 |
-
moveSlides: 0,
|
79 |
-
slideWidth: 0,
|
80 |
-
|
81 |
-
// CALLBACKS
|
82 |
-
onSliderLoad: function() {},
|
83 |
-
onSlideBefore: function() {},
|
84 |
-
onSlideAfter: function() {},
|
85 |
-
onSlideNext: function() {},
|
86 |
-
onSlidePrev: function() {},
|
87 |
-
onSliderResize: function() {}
|
88 |
-
}
|
89 |
-
|
90 |
-
$.fn.bxSlider = function(options){
|
91 |
-
|
92 |
-
if(this.length == 0) return this;
|
93 |
-
|
94 |
-
// support mutltiple elements
|
95 |
-
if(this.length > 1){
|
96 |
-
this.each(function(){$(this).bxSlider(options)});
|
97 |
-
return this;
|
98 |
-
}
|
99 |
-
|
100 |
-
// create a namespace to be used throughout the plugin
|
101 |
-
var slider = {};
|
102 |
-
// set a reference to our slider element
|
103 |
-
var el = this;
|
104 |
-
plugin.el = this;
|
105 |
-
|
106 |
-
/**
|
107 |
-
* Makes slideshow responsive
|
108 |
-
*/
|
109 |
-
// first get the original window dimens (thanks alot IE)
|
110 |
-
var windowWidth = $(window).width();
|
111 |
-
var windowHeight = $(window).height();
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
/**
|
116 |
-
* ===================================================================================
|
117 |
-
* = PRIVATE FUNCTIONS
|
118 |
-
* ===================================================================================
|
119 |
-
*/
|
120 |
-
|
121 |
-
/**
|
122 |
-
* Initializes namespace settings to be used throughout plugin
|
123 |
-
*/
|
124 |
-
var init = function(){
|
125 |
-
// merge user-supplied options with the defaults
|
126 |
-
slider.settings = $.extend({}, defaults, options);
|
127 |
-
// parse slideWidth setting
|
128 |
-
slider.settings.slideWidth = parseInt(slider.settings.slideWidth);
|
129 |
-
// store the original children
|
130 |
-
slider.children = el.children(slider.settings.slideSelector);
|
131 |
-
// check if actual number of slides is less than minSlides / maxSlides
|
132 |
-
if(slider.children.length < slider.settings.minSlides) slider.settings.minSlides = slider.children.length;
|
133 |
-
if(slider.children.length < slider.settings.maxSlides) slider.settings.maxSlides = slider.children.length;
|
134 |
-
// if random start, set the startSlide setting to random number
|
135 |
-
if(slider.settings.randomStart) slider.settings.startSlide = Math.floor(Math.random() * slider.children.length);
|
136 |
-
// store active slide information
|
137 |
-
slider.active = { index: slider.settings.startSlide }
|
138 |
-
// store if the slider is in carousel mode (displaying / moving multiple slides)
|
139 |
-
slider.carousel = slider.settings.minSlides > 1 || slider.settings.maxSlides > 1;
|
140 |
-
// if carousel, force preloadImages = 'all'
|
141 |
-
if(slider.carousel) slider.settings.preloadImages = 'all';
|
142 |
-
// calculate the min / max width thresholds based on min / max number of slides
|
143 |
-
// used to setup and update carousel slides dimensions
|
144 |
-
slider.minThreshold = (slider.settings.minSlides * slider.settings.slideWidth) + ((slider.settings.minSlides - 1) * slider.settings.slideMargin);
|
145 |
-
slider.maxThreshold = (slider.settings.maxSlides * slider.settings.slideWidth) + ((slider.settings.maxSlides - 1) * slider.settings.slideMargin);
|
146 |
-
// store the current state of the slider (if currently animating, working is true)
|
147 |
-
slider.working = false;
|
148 |
-
// initialize the controls object
|
149 |
-
slider.controls = {};
|
150 |
-
// initialize an auto interval
|
151 |
-
slider.interval = null;
|
152 |
-
// determine which property to use for transitions
|
153 |
-
slider.animProp = slider.settings.mode == 'vertical' ? 'top' : 'left';
|
154 |
-
// determine if hardware acceleration can be used
|
155 |
-
slider.usingCSS = slider.settings.useCSS && slider.settings.mode != 'fade' && (function(){
|
156 |
-
// create our test div element
|
157 |
-
var div = document.createElement('div');
|
158 |
-
// css transition properties
|
159 |
-
var props = ['WebkitPerspective', 'MozPerspective', 'OPerspective', 'msPerspective'];
|
160 |
-
// test for each property
|
161 |
-
for(var i in props){
|
162 |
-
if(div.style[props[i]] !== undefined){
|
163 |
-
slider.cssPrefix = props[i].replace('Perspective', '').toLowerCase();
|
164 |
-
slider.animProp = '-' + slider.cssPrefix + '-transform';
|
165 |
-
return true;
|
166 |
-
}
|
167 |
-
}
|
168 |
-
return false;
|
169 |
-
}());
|
170 |
-
// if vertical mode always make maxSlides and minSlides equal
|
171 |
-
if(slider.settings.mode == 'vertical') slider.settings.maxSlides = slider.settings.minSlides;
|
172 |
-
// save original style data
|
173 |
-
el.data("origStyle", el.attr("style"));
|
174 |
-
el.children(slider.settings.slideSelector).each(function() {
|
175 |
-
$(this).data("origStyle", $(this).attr("style"));
|
176 |
-
});
|
177 |
-
// perform all DOM / CSS modifications
|
178 |
-
setup();
|
179 |
-
}
|
180 |
-
|
181 |
-
/**
|
182 |
-
* Performs all DOM and CSS modifications
|
183 |
-
*/
|
184 |
-
var setup = function(){
|
185 |
-
// wrap el in a wrapper
|
186 |
-
el.wrap('<div class="' + slider.settings.wrapperClass + '"><div class="bx-viewport"></div></div>');
|
187 |
-
// store a namspace reference to .bx-viewport
|
188 |
-
slider.viewport = el.parent();
|
189 |
-
// add a loading div to display while images are loading
|
190 |
-
slider.loader = $('<div class="bx-loading" />');
|
191 |
-
slider.viewport.prepend(slider.loader);
|
192 |
-
// set el to a massive width, to hold any needed slides
|
193 |
-
// also strip any margin and padding from el
|
194 |
-
el.css({
|
195 |
-
width: slider.settings.mode == 'horizontal' ? (slider.children.length * 100 + 215) + '%' : 'auto',
|
196 |
-
position: 'relative'
|
197 |
-
});
|
198 |
-
// if using CSS, add the easing property
|
199 |
-
if(slider.usingCSS && slider.settings.easing){
|
200 |
-
el.css('-' + slider.cssPrefix + '-transition-timing-function', slider.settings.easing);
|
201 |
-
// if not using CSS and no easing value was supplied, use the default JS animation easing (swing)
|
202 |
-
}else if(!slider.settings.easing){
|
203 |
-
slider.settings.easing = 'swing';
|
204 |
-
}
|
205 |
-
var slidesShowing = getNumberSlidesShowing();
|
206 |
-
// make modifications to the viewport (.bx-viewport)
|
207 |
-
slider.viewport.css({
|
208 |
-
width: '100%',
|
209 |
-
overflow: 'hidden',
|
210 |
-
position: 'relative'
|
211 |
-
});
|
212 |
-
slider.viewport.parent().css({
|
213 |
-
maxWidth: getViewportMaxWidth()
|
214 |
-
});
|
215 |
-
// make modification to the wrapper (.bx-wrapper)
|
216 |
-
if(!slider.settings.pager) {
|
217 |
-
slider.viewport.parent().css({
|
218 |
-
margin: '0 auto 0px'
|
219 |
-
});
|
220 |
-
}
|
221 |
-
// apply css to all slider children
|
222 |
-
slider.children.css({
|
223 |
-
'float': slider.settings.mode == 'horizontal' ? 'left' : 'none',
|
224 |
-
listStyle: 'none',
|
225 |
-
position: 'relative'
|
226 |
-
});
|
227 |
-
// apply the calculated width after the float is applied to prevent scrollbar interference
|
228 |
-
slider.children.css('width', getSlideWidth());
|
229 |
-
// if slideMargin is supplied, add the css
|
230 |
-
if(slider.settings.mode == 'horizontal' && slider.settings.slideMargin > 0) slider.children.css('marginRight', slider.settings.slideMargin);
|
231 |
-
if(slider.settings.mode == 'vertical' && slider.settings.slideMargin > 0) slider.children.css('marginBottom', slider.settings.slideMargin);
|
232 |
-
// if "fade" mode, add positioning and z-index CSS
|
233 |
-
if(slider.settings.mode == 'fade'){
|
234 |
-
slider.children.css({
|
235 |
-
position: 'absolute',
|
236 |
-
zIndex: 0,
|
237 |
-
display: 'none'
|
238 |
-
});
|
239 |
-
// prepare the z-index on the showing element
|
240 |
-
slider.children.eq(slider.settings.startSlide).css({zIndex: slider.settings.slideZIndex, display: 'block'});
|
241 |
-
}
|
242 |
-
// create an element to contain all slider controls (pager, start / stop, etc)
|
243 |
-
slider.controls.el = $('<div class="bx-controls" />');
|
244 |
-
// if captions are requested, add them
|
245 |
-
if(slider.settings.captions) appendCaptions();
|
246 |
-
// check if startSlide is last slide
|
247 |
-
slider.active.last = slider.settings.startSlide == getPagerQty() - 1;
|
248 |
-
// if video is true, set up the fitVids plugin
|
249 |
-
if(slider.settings.video) el.fitVids();
|
250 |
-
// set the default preload selector (visible)
|
251 |
-
var preloadSelector = slider.children.eq(slider.settings.startSlide);
|
252 |
-
if (slider.settings.preloadImages == "all") preloadSelector = slider.children;
|
253 |
-
// only check for control addition if not in "ticker" mode
|
254 |
-
if(!slider.settings.ticker){
|
255 |
-
// if pager is requested, add it
|
256 |
-
if(slider.settings.pager) appendPager();
|
257 |
-
// if controls are requested, add them
|
258 |
-
if(slider.settings.controls) appendControls();
|
259 |
-
// if auto is true, and auto controls are requested, add them
|
260 |
-
if(slider.settings.auto && slider.settings.autoControls) appendControlsAuto();
|
261 |
-
// if any control option is requested, add the controls wrapper
|
262 |
-
if(slider.settings.controls || slider.settings.autoControls || slider.settings.pager) slider.viewport.after(slider.controls.el);
|
263 |
-
// if ticker mode, do not allow a pager
|
264 |
-
}else{
|
265 |
-
slider.settings.pager = false;
|
266 |
-
}
|
267 |
-
// preload all images, then perform final DOM / CSS modifications that depend on images being loaded
|
268 |
-
loadElements(preloadSelector, start);
|
269 |
-
}
|
270 |
-
|
271 |
-
var loadElements = function(selector, callback){
|
272 |
-
var total = selector.find('img, iframe').length;
|
273 |
-
if (total == 0){
|
274 |
-
callback();
|
275 |
-
return;
|
276 |
-
}
|
277 |
-
var count = 0;
|
278 |
-
selector.find('img, iframe').each(function(){
|
279 |
-
$(this).one('load', function() {
|
280 |
-
if(++count == total) callback();
|
281 |
-
}).each(function() {
|
282 |
-
if(this.complete) $(this).load();
|
283 |
-
});
|
284 |
-
});
|
285 |
-
}
|
286 |
-
|
287 |
-
/**
|
288 |
-
* Start the slider
|
289 |
-
*/
|
290 |
-
var start = function(){
|
291 |
-
// if infinite loop, prepare additional slides
|
292 |
-
if(slider.settings.infiniteLoop && slider.settings.mode != 'fade' && !slider.settings.ticker){
|
293 |
-
var slice = slider.settings.mode == 'vertical' ? slider.settings.minSlides : slider.settings.maxSlides;
|
294 |
-
var sliceAppend = slider.children.slice(0, slice).clone().addClass('bx-clone');
|
295 |
-
var slicePrepend = slider.children.slice(-slice).clone().addClass('bx-clone');
|
296 |
-
el.append(sliceAppend).prepend(slicePrepend);
|
297 |
-
}
|
298 |
-
// remove the loading DOM element
|
299 |
-
slider.loader.remove();
|
300 |
-
// set the left / top position of "el"
|
301 |
-
setSlidePosition();
|
302 |
-
// if "vertical" mode, always use adaptiveHeight to prevent odd behavior
|
303 |
-
if (slider.settings.mode == 'vertical') slider.settings.adaptiveHeight = true;
|
304 |
-
// set the viewport height
|
305 |
-
slider.viewport.height(getViewportHeight());
|
306 |
-
// make sure everything is positioned just right (same as a window resize)
|
307 |
-
el.redrawSlider();
|
308 |
-
// onSliderLoad callback
|
309 |
-
slider.settings.onSliderLoad(slider.active.index);
|
310 |
-
// slider has been fully initialized
|
311 |
-
slider.initialized = true;
|
312 |
-
// bind the resize call to the window
|
313 |
-
if (slider.settings.responsive) $(window).bind('resize', resizeWindow);
|
314 |
-
// if auto is true and has more than 1 page, start the show
|
315 |
-
if (slider.settings.auto && slider.settings.autoStart && (getPagerQty() > 1 || slider.settings.autoSlideForOnePage)) initAuto();
|
316 |
-
// if ticker is true, start the ticker
|
317 |
-
if (slider.settings.ticker) initTicker();
|
318 |
-
// if pager is requested, make the appropriate pager link active
|
319 |
-
if (slider.settings.pager) updatePagerActive(slider.settings.startSlide);
|
320 |
-
// check for any updates to the controls (like hideControlOnEnd updates)
|
321 |
-
if (slider.settings.controls) updateDirectionControls();
|
322 |
-
// if touchEnabled is true, setup the touch events
|
323 |
-
if (slider.settings.touchEnabled && !slider.settings.ticker) initTouch();
|
324 |
-
}
|
325 |
-
|
326 |
-
/**
|
327 |
-
* Returns the calculated height of the viewport, used to determine either adaptiveHeight or the maxHeight value
|
328 |
-
*/
|
329 |
-
var getViewportHeight = function(){
|
330 |
-
var height = 0;
|
331 |
-
// first determine which children (slides) should be used in our height calculation
|
332 |
-
var children = $();
|
333 |
-
// if mode is not "vertical" and adaptiveHeight is false, include all children
|
334 |
-
if(slider.settings.mode != 'vertical' && !slider.settings.adaptiveHeight){
|
335 |
-
children = slider.children;
|
336 |
-
}else{
|
337 |
-
// if not carousel, return the single active child
|
338 |
-
if(!slider.carousel){
|
339 |
-
children = slider.children.eq(slider.active.index);
|
340 |
-
// if carousel, return a slice of children
|
341 |
-
}else{
|
342 |
-
// get the individual slide index
|
343 |
-
var currentIndex = slider.settings.moveSlides == 1 ? slider.active.index : slider.active.index * getMoveBy();
|
344 |
-
// add the current slide to the children
|
345 |
-
children = slider.children.eq(currentIndex);
|
346 |
-
// cycle through the remaining "showing" slides
|
347 |
-
for (i = 1; i <= slider.settings.maxSlides - 1; i++){
|
348 |
-
// if looped back to the start
|
349 |
-
if(currentIndex + i >= slider.children.length){
|
350 |
-
children = children.add(slider.children.eq(i - 1));
|
351 |
-
}else{
|
352 |
-
children = children.add(slider.children.eq(currentIndex + i));
|
353 |
-
}
|
354 |
-
}
|
355 |
-
}
|
356 |
-
}
|
357 |
-
// if "vertical" mode, calculate the sum of the heights of the children
|
358 |
-
if(slider.settings.mode == 'vertical'){
|
359 |
-
children.each(function(index) {
|
360 |
-
height += $(this).outerHeight();
|
361 |
-
});
|
362 |
-
// add user-supplied margins
|
363 |
-
if(slider.settings.slideMargin > 0){
|
364 |
-
height += slider.settings.slideMargin * (slider.settings.minSlides - 1);
|
365 |
-
}
|
366 |
-
// if not "vertical" mode, calculate the max height of the children
|
367 |
-
}else{
|
368 |
-
height = Math.max.apply(Math, children.map(function(){
|
369 |
-
return $(this).outerHeight(false);
|
370 |
-
}).get());
|
371 |
-
}
|
372 |
-
|
373 |
-
if(slider.viewport.css('box-sizing') == 'border-box'){
|
374 |
-
height += parseFloat(slider.viewport.css('padding-top')) + parseFloat(slider.viewport.css('padding-bottom')) +
|
375 |
-
parseFloat(slider.viewport.css('border-top-width')) + parseFloat(slider.viewport.css('border-bottom-width'));
|
376 |
-
}else if(slider.viewport.css('box-sizing') == 'padding-box'){
|
377 |
-
height += parseFloat(slider.viewport.css('padding-top')) + parseFloat(slider.viewport.css('padding-bottom'));
|
378 |
-
}
|
379 |
-
|
380 |
-
return height;
|
381 |
-
}
|
382 |
-
|
383 |
-
/**
|
384 |
-
* Returns the calculated width to be used for the outer wrapper / viewport
|
385 |
-
*/
|
386 |
-
var getViewportMaxWidth = function(){
|
387 |
-
var width = '100%';
|
388 |
-
if(slider.settings.slideWidth > 0){
|
389 |
-
if(slider.settings.mode == 'horizontal'){
|
390 |
-
width = (slider.settings.maxSlides * slider.settings.slideWidth) + ((slider.settings.maxSlides - 1) * slider.settings.slideMargin);
|
391 |
-
}else{
|
392 |
-
width = slider.settings.slideWidth;
|
393 |
-
}
|
394 |
-
}
|
395 |
-
return width;
|
396 |
-
}
|
397 |
-
|
398 |
-
/**
|
399 |
-
* Returns the calculated width to be applied to each slide
|
400 |
-
*/
|
401 |
-
var getSlideWidth = function(){
|
402 |
-
// start with any user-supplied slide width
|
403 |
-
var newElWidth = slider.settings.slideWidth;
|
404 |
-
// get the current viewport width
|
405 |
-
var wrapWidth = slider.viewport.width();
|
406 |
-
// if slide width was not supplied, or is larger than the viewport use the viewport width
|
407 |
-
if(slider.settings.slideWidth == 0 ||
|
408 |
-
(slider.settings.slideWidth > wrapWidth && !slider.carousel) ||
|
409 |
-
slider.settings.mode == 'vertical'){
|
410 |
-
newElWidth = wrapWidth;
|
411 |
-
// if carousel, use the thresholds to determine the width
|
412 |
-
}else if(slider.settings.maxSlides > 1 && slider.settings.mode == 'horizontal'){
|
413 |
-
if(wrapWidth > slider.maxThreshold){
|
414 |
-
// newElWidth = (wrapWidth - (slider.settings.slideMargin * (slider.settings.maxSlides - 1))) / slider.settings.maxSlides;
|
415 |
-
}else if(wrapWidth < slider.minThreshold){
|
416 |
-
newElWidth = (wrapWidth - (slider.settings.slideMargin * (slider.settings.minSlides - 1))) / slider.settings.minSlides;
|
417 |
-
}
|
418 |
-
}
|
419 |
-
return newElWidth;
|
420 |
-
}
|
421 |
-
|
422 |
-
/**
|
423 |
-
* Returns the number of slides currently visible in the viewport (includes partially visible slides)
|
424 |
-
*/
|
425 |
-
var getNumberSlidesShowing = function(){
|
426 |
-
var slidesShowing = 1;
|
427 |
-
if(slider.settings.mode == 'horizontal' && slider.settings.slideWidth > 0){
|
428 |
-
// if viewport is smaller than minThreshold, return minSlides
|
429 |
-
if(slider.viewport.width() < slider.minThreshold){
|
430 |
-
slidesShowing = slider.settings.minSlides;
|
431 |
-
// if viewport is larger than minThreshold, return maxSlides
|
432 |
-
}else if(slider.viewport.width() > slider.maxThreshold){
|
433 |
-
slidesShowing = slider.settings.maxSlides;
|
434 |
-
// if viewport is between min / max thresholds, divide viewport width by first child width
|
435 |
-
}else{
|
436 |
-
var childWidth = slider.children.first().width() + slider.settings.slideMargin;
|
437 |
-
slidesShowing = Math.floor((slider.viewport.width() +
|
438 |
-
slider.settings.slideMargin) / childWidth);
|
439 |
-
}
|
440 |
-
// if "vertical" mode, slides showing will always be minSlides
|
441 |
-
}else if(slider.settings.mode == 'vertical'){
|
442 |
-
slidesShowing = slider.settings.minSlides;
|
443 |
-
}
|
444 |
-
return slidesShowing;
|
445 |
-
}
|
446 |
-
|
447 |
-
/**
|
448 |
-
* Returns the number of pages (one full viewport of slides is one "page")
|
449 |
-
*/
|
450 |
-
var getPagerQty = function(){
|
451 |
-
var pagerQty = 0;
|
452 |
-
// if moveSlides is specified by the user
|
453 |
-
if(slider.settings.moveSlides > 0){
|
454 |
-
if(slider.settings.infiniteLoop){
|
455 |
-
pagerQty = Math.ceil(slider.children.length / getMoveBy());
|
456 |
-
}else{
|
457 |
-
// use a while loop to determine pages
|
458 |
-
var breakPoint = 0;
|
459 |
-
var counter = 0
|
460 |
-
// when breakpoint goes above children length, counter is the number of pages
|
461 |
-
while (breakPoint < slider.children.length){
|
462 |
-
++pagerQty;
|
463 |
-
breakPoint = counter + getNumberSlidesShowing();
|
464 |
-
counter += slider.settings.moveSlides <= getNumberSlidesShowing() ? slider.settings.moveSlides : getNumberSlidesShowing();
|
465 |
-
}
|
466 |
-
}
|
467 |
-
// if moveSlides is 0 (auto) divide children length by sides showing, then round up
|
468 |
-
}else{
|
469 |
-
pagerQty = Math.ceil(slider.children.length / getNumberSlidesShowing());
|
470 |
-
}
|
471 |
-
return pagerQty;
|
472 |
-
}
|
473 |
-
|
474 |
-
/**
|
475 |
-
* Returns the number of indivual slides by which to shift the slider
|
476 |
-
*/
|
477 |
-
var getMoveBy = function(){
|
478 |
-
// if moveSlides was set by the user and moveSlides is less than number of slides showing
|
479 |
-
if(slider.settings.moveSlides > 0 && slider.settings.moveSlides <= getNumberSlidesShowing()){
|
480 |
-
return slider.settings.moveSlides;
|
481 |
-
}
|
482 |
-
// if moveSlides is 0 (auto)
|
483 |
-
return getNumberSlidesShowing();
|
484 |
-
}
|
485 |
-
|
486 |
-
/**
|
487 |
-
* Sets the slider's (el) left or top position
|
488 |
-
*/
|
489 |
-
var setSlidePosition = function(){
|
490 |
-
// if last slide, not infinite loop, and number of children is larger than specified maxSlides
|
491 |
-
if(slider.children.length > slider.settings.maxSlides && slider.active.last && !slider.settings.infiniteLoop){
|
492 |
-
if (slider.settings.mode == 'horizontal'){
|
493 |
-
// get the last child's position
|
494 |
-
var lastChild = slider.children.last();
|
495 |
-
var position = lastChild.position();
|
496 |
-
// set the left position
|
497 |
-
setPositionProperty(-(position.left - (slider.viewport.width() - lastChild.outerWidth())), 'reset', 0);
|
498 |
-
}else if(slider.settings.mode == 'vertical'){
|
499 |
-
// get the last showing index's position
|
500 |
-
var lastShowingIndex = slider.children.length - slider.settings.minSlides;
|
501 |
-
var position = slider.children.eq(lastShowingIndex).position();
|
502 |
-
// set the top position
|
503 |
-
setPositionProperty(-position.top, 'reset', 0);
|
504 |
-
}
|
505 |
-
// if not last slide
|
506 |
-
}else{
|
507 |
-
// get the position of the first showing slide
|
508 |
-
var position = slider.children.eq(slider.active.index * getMoveBy()).position();
|
509 |
-
// check for last slide
|
510 |
-
if (slider.active.index == getPagerQty() - 1) slider.active.last = true;
|
511 |
-
// set the repective position
|
512 |
-
if (position != undefined){
|
513 |
-
if (slider.settings.mode == 'horizontal') setPositionProperty(-position.left, 'reset', 0);
|
514 |
-
else if (slider.settings.mode == 'vertical') setPositionProperty(-position.top, 'reset', 0);
|
515 |
-
}
|
516 |
-
}
|
517 |
-
}
|
518 |
-
|
519 |
-
/**
|
520 |
-
* Sets the el's animating property position (which in turn will sometimes animate el).
|
521 |
-
* If using CSS, sets the transform property. If not using CSS, sets the top / left property.
|
522 |
-
*
|
523 |
-
* @param value (int)
|
524 |
-
* - the animating property's value
|
525 |
-
*
|
526 |
-
* @param type (string) 'slider', 'reset', 'ticker'
|
527 |
-
* - the type of instance for which the function is being
|
528 |
-
*
|
529 |
-
* @param duration (int)
|
530 |
-
* - the amount of time (in ms) the transition should occupy
|
531 |
-
*
|
532 |
-
* @param params (array) optional
|
533 |
-
* - an optional parameter containing any variables that need to be passed in
|
534 |
-
*/
|
535 |
-
var setPositionProperty = function(value, type, duration, params){
|
536 |
-
// use CSS transform
|
537 |
-
if(slider.usingCSS){
|
538 |
-
// determine the translate3d value
|
539 |
-
var propValue = slider.settings.mode == 'vertical' ? 'translate3d(0, ' + value + 'px, 0)' : 'translate3d(' + value + 'px, 0, 0)';
|
540 |
-
// add the CSS transition-duration
|
541 |
-
el.css('-' + slider.cssPrefix + '-transition-duration', duration / 1000 + 's');
|
542 |
-
if(type == 'slide'){
|
543 |
-
// set the property value
|
544 |
-
el.css(slider.animProp, propValue);
|
545 |
-
// bind a callback method - executes when CSS transition completes
|
546 |
-
el.bind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function(){
|
547 |
-
// unbind the callback
|
548 |
-
el.unbind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd');
|
549 |
-
updateAfterSlideTransition();
|
550 |
-
});
|
551 |
-
}else if(type == 'reset'){
|
552 |
-
el.css(slider.animProp, propValue);
|
553 |
-
}else if(type == 'ticker'){
|
554 |
-
// make the transition use 'linear'
|
555 |
-
el.css('-' + slider.cssPrefix + '-transition-timing-function', 'linear');
|
556 |
-
el.css(slider.animProp, propValue);
|
557 |
-
// bind a callback method - executes when CSS transition completes
|
558 |
-
el.bind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function(){
|
559 |
-
// unbind the callback
|
560 |
-
el.unbind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd');
|
561 |
-
// reset the position
|
562 |
-
setPositionProperty(params['resetValue'], 'reset', 0);
|
563 |
-
// start the loop again
|
564 |
-
tickerLoop();
|
565 |
-
});
|
566 |
-
}
|
567 |
-
// use JS animate
|
568 |
-
}else{
|
569 |
-
var animateObj = {};
|
570 |
-
animateObj[slider.animProp] = value;
|
571 |
-
if(type == 'slide'){
|
572 |
-
el.animate(animateObj, duration, slider.settings.easing, function(){
|
573 |
-
updateAfterSlideTransition();
|
574 |
-
});
|
575 |
-
}else if(type == 'reset'){
|
576 |
-
el.css(slider.animProp, value)
|
577 |
-
}else if(type == 'ticker'){
|
578 |
-
el.animate(animateObj, speed, 'linear', function(){
|
579 |
-
setPositionProperty(params['resetValue'], 'reset', 0);
|
580 |
-
// run the recursive loop after animation
|
581 |
-
tickerLoop();
|
582 |
-
});
|
583 |
-
}
|
584 |
-
}
|
585 |
-
}
|
586 |
-
|
587 |
-
/**
|
588 |
-
* Populates the pager with proper amount of pages
|
589 |
-
*/
|
590 |
-
var populatePager = function(){
|
591 |
-
var pagerHtml = '';
|
592 |
-
var pagerQty = getPagerQty();
|
593 |
-
// loop through each pager item
|
594 |
-
for(var i=0; i < pagerQty; i++){
|
595 |
-
var linkContent = '';
|
596 |
-
// if a buildPager function is supplied, use it to get pager link value, else use index + 1
|
597 |
-
if(slider.settings.buildPager && $.isFunction(slider.settings.buildPager)){
|
598 |
-
linkContent = slider.settings.buildPager(i);
|
599 |
-
slider.pagerEl.addClass('bx-custom-pager');
|
600 |
-
}else{
|
601 |
-
linkContent = i + 1;
|
602 |
-
slider.pagerEl.addClass('bx-default-pager');
|
603 |
-
}
|
604 |
-
// var linkContent = slider.settings.buildPager && $.isFunction(slider.settings.buildPager) ? slider.settings.buildPager(i) : i + 1;
|
605 |
-
// add the markup to the string
|
606 |
-
pagerHtml += '<div class="bx-pager-item"><a href="" data-slide-index="' + i + '" class="bx-pager-link">' + linkContent + '</a></div>';
|
607 |
-
};
|
608 |
-
// populate the pager element with pager links
|
609 |
-
slider.pagerEl.html(pagerHtml);
|
610 |
-
}
|
611 |
-
|
612 |
-
/**
|
613 |
-
* Appends the pager to the controls element
|
614 |
-
*/
|
615 |
-
var appendPager = function(){
|
616 |
-
if(!slider.settings.pagerCustom){
|
617 |
-
// create the pager DOM element
|
618 |
-
slider.pagerEl = $('<div class="bx-pager" />');
|
619 |
-
// if a pager selector was supplied, populate it with the pager
|
620 |
-
if(slider.settings.pagerSelector){
|
621 |
-
$(slider.settings.pagerSelector).html(slider.pagerEl);
|
622 |
-
// if no pager selector was supplied, add it after the wrapper
|
623 |
-
}else{
|
624 |
-
slider.controls.el.addClass('bx-has-pager').append(slider.pagerEl);
|
625 |
-
}
|
626 |
-
// populate the pager
|
627 |
-
populatePager();
|
628 |
-
}else{
|
629 |
-
slider.pagerEl = $(slider.settings.pagerCustom);
|
630 |
-
}
|
631 |
-
// assign the pager click binding
|
632 |
-
slider.pagerEl.on('click', 'a', clickPagerBind);
|
633 |
-
}
|
634 |
-
|
635 |
-
/**
|
636 |
-
* Appends prev / next controls to the controls element
|
637 |
-
*/
|
638 |
-
var appendControls = function(){
|
639 |
-
slider.controls.next = $('<a class="bx-next" href="">' + slider.settings.nextText + '</a>');
|
640 |
-
slider.controls.prev = $('<a class="bx-prev" href="">' + slider.settings.prevText + '</a>');
|
641 |
-
// bind click actions to the controls
|
642 |
-
slider.controls.next.bind('click', clickNextBind);
|
643 |
-
slider.controls.prev.bind('click', clickPrevBind);
|
644 |
-
// if nextSlector was supplied, populate it
|
645 |
-
if(slider.settings.nextSelector){
|
646 |
-
$(slider.settings.nextSelector).append(slider.controls.next);
|
647 |
-
}
|
648 |
-
// if prevSlector was supplied, populate it
|
649 |
-
if(slider.settings.prevSelector){
|
650 |
-
$(slider.settings.prevSelector).append(slider.controls.prev);
|
651 |
-
}
|
652 |
-
// if no custom selectors were supplied
|
653 |
-
if(!slider.settings.nextSelector && !slider.settings.prevSelector){
|
654 |
-
// add the controls to the DOM
|
655 |
-
slider.controls.directionEl = $('<div class="bx-controls-direction" />');
|
656 |
-
// add the control elements to the directionEl
|
657 |
-
slider.controls.directionEl.append(slider.controls.prev).append(slider.controls.next);
|
658 |
-
// slider.viewport.append(slider.controls.directionEl);
|
659 |
-
slider.controls.el.addClass('bx-has-controls-direction').append(slider.controls.directionEl);
|
660 |
-
}
|
661 |
-
}
|
662 |
-
|
663 |
-
/**
|
664 |
-
* Appends start / stop auto controls to the controls element
|
665 |
-
*/
|
666 |
-
var appendControlsAuto = function(){
|
667 |
-
slider.controls.start = $('<div class="bx-controls-auto-item"><a class="bx-start" href="">' + slider.settings.startText + '</a></div>');
|
668 |
-
slider.controls.stop = $('<div class="bx-controls-auto-item"><a class="bx-stop" href="">' + slider.settings.stopText + '</a></div>');
|
669 |
-
// add the controls to the DOM
|
670 |
-
slider.controls.autoEl = $('<div class="bx-controls-auto" />');
|
671 |
-
// bind click actions to the controls
|
672 |
-
slider.controls.autoEl.on('click', '.bx-start', clickStartBind);
|
673 |
-
slider.controls.autoEl.on('click', '.bx-stop', clickStopBind);
|
674 |
-
// if autoControlsCombine, insert only the "start" control
|
675 |
-
if(slider.settings.autoControlsCombine){
|
676 |
-
slider.controls.autoEl.append(slider.controls.start);
|
677 |
-
// if autoControlsCombine is false, insert both controls
|
678 |
-
}else{
|
679 |
-
slider.controls.autoEl.append(slider.controls.start).append(slider.controls.stop);
|
680 |
-
}
|
681 |
-
// if auto controls selector was supplied, populate it with the controls
|
682 |
-
if(slider.settings.autoControlsSelector){
|
683 |
-
$(slider.settings.autoControlsSelector).html(slider.controls.autoEl);
|
684 |
-
// if auto controls selector was not supplied, add it after the wrapper
|
685 |
-
}else{
|
686 |
-
slider.controls.el.addClass('bx-has-controls-auto').append(slider.controls.autoEl);
|
687 |
-
}
|
688 |
-
// update the auto controls
|
689 |
-
updateAutoControls(slider.settings.autoStart ? 'stop' : 'start');
|
690 |
-
}
|
691 |
-
|
692 |
-
/**
|
693 |
-
* Appends image captions to the DOM
|
694 |
-
*/
|
695 |
-
var appendCaptions = function(){
|
696 |
-
// cycle through each child
|
697 |
-
slider.children.each(function(index){
|
698 |
-
// get the image title attribute
|
699 |
-
var title = $(this).find('img:first').attr('title');
|
700 |
-
// append the caption
|
701 |
-
if (title != undefined && ('' + title).length) {
|
702 |
-
$(this).append('<div class="bx-caption"><span>' + title + '</span></div>');
|
703 |
-
}
|
704 |
-
});
|
705 |
-
}
|
706 |
-
|
707 |
-
/**
|
708 |
-
* Click next binding
|
709 |
-
*
|
710 |
-
* @param e (event)
|
711 |
-
* - DOM event object
|
712 |
-
*/
|
713 |
-
var clickNextBind = function(e){
|
714 |
-
// if auto show is running, stop it
|
715 |
-
if (slider.settings.auto) el.stopAuto();
|
716 |
-
el.goToNextSlide();
|
717 |
-
e.preventDefault();
|
718 |
-
}
|
719 |
-
|
720 |
-
/**
|
721 |
-
* Click prev binding
|
722 |
-
*
|
723 |
-
* @param e (event)
|
724 |
-
* - DOM event object
|
725 |
-
*/
|
726 |
-
var clickPrevBind = function(e){
|
727 |
-
// if auto show is running, stop it
|
728 |
-
if (slider.settings.auto) el.stopAuto();
|
729 |
-
el.goToPrevSlide();
|
730 |
-
e.preventDefault();
|
731 |
-
}
|
732 |
-
|
733 |
-
/**
|
734 |
-
* Click start binding
|
735 |
-
*
|
736 |
-
* @param e (event)
|
737 |
-
* - DOM event object
|
738 |
-
*/
|
739 |
-
var clickStartBind = function(e){
|
740 |
-
el.startAuto();
|
741 |
-
e.preventDefault();
|
742 |
-
}
|
743 |
-
|
744 |
-
/**
|
745 |
-
* Click stop binding
|
746 |
-
*
|
747 |
-
* @param e (event)
|
748 |
-
* - DOM event object
|
749 |
-
*/
|
750 |
-
var clickStopBind = function(e){
|
751 |
-
el.stopAuto();
|
752 |
-
e.preventDefault();
|
753 |
-
}
|
754 |
-
|
755 |
-
/**
|
756 |
-
* Click pager binding
|
757 |
-
*
|
758 |
-
* @param e (event)
|
759 |
-
* - DOM event object
|
760 |
-
*/
|
761 |
-
var clickPagerBind = function(e){
|
762 |
-
// if auto show is running, stop it
|
763 |
-
if (slider.settings.auto) el.stopAuto();
|
764 |
-
var pagerLink = $(e.currentTarget);
|
765 |
-
if(pagerLink.attr('data-slide-index') !== undefined){
|
766 |
-
var pagerIndex = parseInt(pagerLink.attr('data-slide-index'));
|
767 |
-
// if clicked pager link is not active, continue with the goToSlide call
|
768 |
-
if(pagerIndex != slider.active.index) el.goToSlide(pagerIndex);
|
769 |
-
e.preventDefault();
|
770 |
-
}
|
771 |
-
}
|
772 |
-
|
773 |
-
/**
|
774 |
-
* Updates the pager links with an active class
|
775 |
-
*
|
776 |
-
* @param slideIndex (int)
|
777 |
-
* - index of slide to make active
|
778 |
-
*/
|
779 |
-
var updatePagerActive = function(slideIndex){
|
780 |
-
// if "short" pager type
|
781 |
-
var len = slider.children.length; // nb of children
|
782 |
-
if(slider.settings.pagerType == 'short'){
|
783 |
-
if(slider.settings.maxSlides > 1) {
|
784 |
-
len = Math.ceil(slider.children.length/slider.settings.maxSlides);
|
785 |
-
}
|
786 |
-
slider.pagerEl.html( (slideIndex + 1) + slider.settings.pagerShortSeparator + len);
|
787 |
-
return;
|
788 |
-
}
|
789 |
-
// remove all pager active classes
|
790 |
-
slider.pagerEl.find('a').removeClass('active');
|
791 |
-
// apply the active class for all pagers
|
792 |
-
slider.pagerEl.each(function(i, el) { $(el).find('a').eq(slideIndex).addClass('active'); });
|
793 |
-
}
|
794 |
-
|
795 |
-
/**
|
796 |
-
* Performs needed actions after a slide transition
|
797 |
-
*/
|
798 |
-
var updateAfterSlideTransition = function(){
|
799 |
-
// if infinte loop is true
|
800 |
-
if(slider.settings.infiniteLoop){
|
801 |
-
var position = '';
|
802 |
-
// first slide
|
803 |
-
if(slider.active.index == 0){
|
804 |
-
// set the new position
|
805 |
-
position = slider.children.eq(0).position();
|
806 |
-
// carousel, last slide
|
807 |
-
}else if(slider.active.index == getPagerQty() - 1 && slider.carousel){
|
808 |
-
position = slider.children.eq((getPagerQty() - 1) * getMoveBy()).position();
|
809 |
-
// last slide
|
810 |
-
}else if(slider.active.index == slider.children.length - 1){
|
811 |
-
position = slider.children.eq(slider.children.length - 1).position();
|
812 |
-
}
|
813 |
-
if(position){
|
814 |
-
if (slider.settings.mode == 'horizontal') { setPositionProperty(-position.left, 'reset', 0); }
|
815 |
-
else if (slider.settings.mode == 'vertical') { setPositionProperty(-position.top, 'reset', 0); }
|
816 |
-
}
|
817 |
-
}
|
818 |
-
// declare that the transition is complete
|
819 |
-
slider.working = false;
|
820 |
-
// onSlideAfter callback
|
821 |
-
slider.settings.onSlideAfter(slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index);
|
822 |
-
}
|
823 |
-
|
824 |
-
/**
|
825 |
-
* Updates the auto controls state (either active, or combined switch)
|
826 |
-
*
|
827 |
-
* @param state (string) "start", "stop"
|
828 |
-
* - the new state of the auto show
|
829 |
-
*/
|
830 |
-
var updateAutoControls = function(state){
|
831 |
-
// if autoControlsCombine is true, replace the current control with the new state
|
832 |
-
if(slider.settings.autoControlsCombine){
|
833 |
-
slider.controls.autoEl.html(slider.controls[state]);
|
834 |
-
// if autoControlsCombine is false, apply the "active" class to the appropriate control
|
835 |
-
}else{
|
836 |
-
slider.controls.autoEl.find('a').removeClass('active');
|
837 |
-
slider.controls.autoEl.find('a:not(.bx-' + state + ')').addClass('active');
|
838 |
-
}
|
839 |
-
}
|
840 |
-
|
841 |
-
/**
|
842 |
-
* Updates the direction controls (checks if either should be hidden)
|
843 |
-
*/
|
844 |
-
var updateDirectionControls = function(){
|
845 |
-
if(getPagerQty() == 1){
|
846 |
-
slider.controls.prev.addClass('disabled');
|
847 |
-
slider.controls.next.addClass('disabled');
|
848 |
-
}else if(!slider.settings.infiniteLoop && slider.settings.hideControlOnEnd){
|
849 |
-
// if first slide
|
850 |
-
if (slider.active.index == 0){
|
851 |
-
slider.controls.prev.addClass('disabled');
|
852 |
-
slider.controls.next.removeClass('disabled');
|
853 |
-
// if last slide
|
854 |
-
}else if(slider.active.index == getPagerQty() - 1){
|
855 |
-
slider.controls.next.addClass('disabled');
|
856 |
-
slider.controls.prev.removeClass('disabled');
|
857 |
-
// if any slide in the middle
|
858 |
-
}else{
|
859 |
-
slider.controls.prev.removeClass('disabled');
|
860 |
-
slider.controls.next.removeClass('disabled');
|
861 |
-
}
|
862 |
-
}
|
863 |
-
}
|
864 |
-
|
865 |
-
/**
|
866 |
-
* Initialzes the auto process
|
867 |
-
*/
|
868 |
-
var initAuto = function(){
|
869 |
-
// if autoDelay was supplied, launch the auto show using a setTimeout() call
|
870 |
-
if(slider.settings.autoDelay > 0){
|
871 |
-
var timeout = setTimeout(el.startAuto, slider.settings.autoDelay);
|
872 |
-
// if autoDelay was not supplied, start the auto show normally
|
873 |
-
}else{
|
874 |
-
el.startAuto();
|
875 |
-
}
|
876 |
-
// if autoHover is requested
|
877 |
-
if(slider.settings.autoHover){
|
878 |
-
// on el hover
|
879 |
-
el.hover(function(){
|
880 |
-
// if the auto show is currently playing (has an active interval)
|
881 |
-
if(slider.interval){
|
882 |
-
// stop the auto show and pass true agument which will prevent control update
|
883 |
-
el.stopAuto(true);
|
884 |
-
// create a new autoPaused value which will be used by the relative "mouseout" event
|
885 |
-
slider.autoPaused = true;
|
886 |
-
}
|
887 |
-
}, function(){
|
888 |
-
// if the autoPaused value was created be the prior "mouseover" event
|
889 |
-
if(slider.autoPaused){
|
890 |
-
// start the auto show and pass true agument which will prevent control update
|
891 |
-
el.startAuto(true);
|
892 |
-
// reset the autoPaused value
|
893 |
-
slider.autoPaused = null;
|
894 |
-
}
|
895 |
-
});
|
896 |
-
}
|
897 |
-
}
|
898 |
-
|
899 |
-
/**
|
900 |
-
* Initialzes the ticker process
|
901 |
-
*/
|
902 |
-
var initTicker = function(){
|
903 |
-
var startPosition = 0;
|
904 |
-
// if autoDirection is "next", append a clone of the entire slider
|
905 |
-
if(slider.settings.autoDirection == 'next'){
|
906 |
-
el.append(slider.children.clone().addClass('bx-clone'));
|
907 |
-
// if autoDirection is "prev", prepend a clone of the entire slider, and set the left position
|
908 |
-
}else{
|
909 |
-
el.prepend(slider.children.clone().addClass('bx-clone'));
|
910 |
-
var position = slider.children.first().position();
|
911 |
-
startPosition = slider.settings.mode == 'horizontal' ? -position.left : -position.top;
|
912 |
-
}
|
913 |
-
setPositionProperty(startPosition, 'reset', 0);
|
914 |
-
// do not allow controls in ticker mode
|
915 |
-
slider.settings.pager = false;
|
916 |
-
slider.settings.controls = false;
|
917 |
-
slider.settings.autoControls = false;
|
918 |
-
// if autoHover is requested
|
919 |
-
if(slider.settings.tickerHover && !slider.usingCSS){
|
920 |
-
// on el hover
|
921 |
-
slider.viewport.hover(function(){
|
922 |
-
el.stop();
|
923 |
-
}, function(){
|
924 |
-
// calculate the total width of children (used to calculate the speed ratio)
|
925 |
-
var totalDimens = 0;
|
926 |
-
slider.children.each(function(index){
|
927 |
-
totalDimens += slider.settings.mode == 'horizontal' ? $(this).outerWidth(true) : $(this).outerHeight(true);
|
928 |
-
});
|
929 |
-
// calculate the speed ratio (used to determine the new speed to finish the paused animation)
|
930 |
-
var ratio = slider.settings.speed / totalDimens;
|
931 |
-
// determine which property to use
|
932 |
-
var property = slider.settings.mode == 'horizontal' ? 'left' : 'top';
|
933 |
-
// calculate the new speed
|
934 |
-
var newSpeed = ratio * (totalDimens - (Math.abs(parseInt(el.css(property)))));
|
935 |
-
tickerLoop(newSpeed);
|
936 |
-
});
|
937 |
-
}
|
938 |
-
// start the ticker loop
|
939 |
-
tickerLoop();
|
940 |
-
}
|
941 |
-
|
942 |
-
/**
|
943 |
-
* Runs a continuous loop, news ticker-style
|
944 |
-
*/
|
945 |
-
var tickerLoop = function(resumeSpeed){
|
946 |
-
speed = resumeSpeed ? resumeSpeed : slider.settings.speed;
|
947 |
-
var position = {left: 0, top: 0};
|
948 |
-
var reset = {left: 0, top: 0};
|
949 |
-
// if "next" animate left position to last child, then reset left to 0
|
950 |
-
if(slider.settings.autoDirection == 'next'){
|
951 |
-
position = el.find('.bx-clone').first().position();
|
952 |
-
// if "prev" animate left position to 0, then reset left to first non-clone child
|
953 |
-
}else{
|
954 |
-
reset = slider.children.first().position();
|
955 |
-
}
|
956 |
-
var animateProperty = slider.settings.mode == 'horizontal' ? -position.left : -position.top;
|
957 |
-
var resetValue = slider.settings.mode == 'horizontal' ? -reset.left : -reset.top;
|
958 |
-
var params = {resetValue: resetValue};
|
959 |
-
setPositionProperty(animateProperty, 'ticker', speed, params);
|
960 |
-
}
|
961 |
-
|
962 |
-
/**
|
963 |
-
* Initializes touch events
|
964 |
-
*/
|
965 |
-
var initTouch = function(){
|
966 |
-
// initialize object to contain all touch values
|
967 |
-
slider.touch = {
|
968 |
-
start: {x: 0, y: 0},
|
969 |
-
end: {x: 0, y: 0}
|
970 |
-
}
|
971 |
-
slider.viewport.bind('touchstart', onTouchStart);
|
972 |
-
}
|
973 |
-
|
974 |
-
/**
|
975 |
-
* Event handler for "touchstart"
|
976 |
-
*
|
977 |
-
* @param e (event)
|
978 |
-
* - DOM event object
|
979 |
-
*/
|
980 |
-
var onTouchStart = function(e){
|
981 |
-
if(slider.working){
|
982 |
-
e.preventDefault();
|
983 |
-
}else{
|
984 |
-
// record the original position when touch starts
|
985 |
-
slider.touch.originalPos = el.position();
|
986 |
-
var orig = e.originalEvent;
|
987 |
-
// record the starting touch x, y coordinates
|
988 |
-
slider.touch.start.x = orig.changedTouches[0].pageX;
|
989 |
-
slider.touch.start.y = orig.changedTouches[0].pageY;
|
990 |
-
// bind a "touchmove" event to the viewport
|
991 |
-
slider.viewport.bind('touchmove', onTouchMove);
|
992 |
-
// bind a "touchend" event to the viewport
|
993 |
-
slider.viewport.bind('touchend', onTouchEnd);
|
994 |
-
}
|
995 |
-
}
|
996 |
-
|
997 |
-
/**
|
998 |
-
* Event handler for "touchmove"
|
999 |
-
*
|
1000 |
-
* @param e (event)
|
1001 |
-
* - DOM event object
|
1002 |
-
*/
|
1003 |
-
var onTouchMove = function(e){
|
1004 |
-
var orig = e.originalEvent;
|
1005 |
-
// if scrolling on y axis, do not prevent default
|
1006 |
-
var xMovement = Math.abs(orig.changedTouches[0].pageX - slider.touch.start.x);
|
1007 |
-
var yMovement = Math.abs(orig.changedTouches[0].pageY - slider.touch.start.y);
|
1008 |
-
// x axis swipe
|
1009 |
-
if((xMovement * 3) > yMovement && slider.settings.preventDefaultSwipeX){
|
1010 |
-
e.preventDefault();
|
1011 |
-
// y axis swipe
|
1012 |
-
}else if((yMovement * 3) > xMovement && slider.settings.preventDefaultSwipeY){
|
1013 |
-
e.preventDefault();
|
1014 |
-
}
|
1015 |
-
if(slider.settings.mode != 'fade' && slider.settings.oneToOneTouch){
|
1016 |
-
var value = 0;
|
1017 |
-
// if horizontal, drag along x axis
|
1018 |
-
if(slider.settings.mode == 'horizontal'){
|
1019 |
-
var change = orig.changedTouches[0].pageX - slider.touch.start.x;
|
1020 |
-
value = slider.touch.originalPos.left + change;
|
1021 |
-
// if vertical, drag along y axis
|
1022 |
-
}else{
|
1023 |
-
var change = orig.changedTouches[0].pageY - slider.touch.start.y;
|
1024 |
-
value = slider.touch.originalPos.top + change;
|
1025 |
-
}
|
1026 |
-
setPositionProperty(value, 'reset', 0);
|
1027 |
-
}
|
1028 |
-
}
|
1029 |
-
|
1030 |
-
/**
|
1031 |
-
* Event handler for "touchend"
|
1032 |
-
*
|
1033 |
-
* @param e (event)
|
1034 |
-
* - DOM event object
|
1035 |
-
*/
|
1036 |
-
var onTouchEnd = function(e){
|
1037 |
-
slider.viewport.unbind('touchmove', onTouchMove);
|
1038 |
-
var orig = e.originalEvent;
|
1039 |
-
var value = 0;
|
1040 |
-
// record end x, y positions
|
1041 |
-
slider.touch.end.x = orig.changedTouches[0].pageX;
|
1042 |
-
slider.touch.end.y = orig.changedTouches[0].pageY;
|
1043 |
-
// if fade mode, check if absolute x distance clears the threshold
|
1044 |
-
if(slider.settings.mode == 'fade'){
|
1045 |
-
var distance = Math.abs(slider.touch.start.x - slider.touch.end.x);
|
1046 |
-
if(distance >= slider.settings.swipeThreshold){
|
1047 |
-
slider.touch.start.x > slider.touch.end.x ? el.goToNextSlide() : el.goToPrevSlide();
|
1048 |
-
el.stopAuto();
|
1049 |
-
}
|
1050 |
-
// not fade mode
|
1051 |
-
}else{
|
1052 |
-
var distance = 0;
|
1053 |
-
// calculate distance and el's animate property
|
1054 |
-
if(slider.settings.mode == 'horizontal'){
|
1055 |
-
distance = slider.touch.end.x - slider.touch.start.x;
|
1056 |
-
value = slider.touch.originalPos.left;
|
1057 |
-
}else{
|
1058 |
-
distance = slider.touch.end.y - slider.touch.start.y;
|
1059 |
-
value = slider.touch.originalPos.top;
|
1060 |
-
}
|
1061 |
-
// if not infinite loop and first / last slide, do not attempt a slide transition
|
1062 |
-
if(!slider.settings.infiniteLoop && ((slider.active.index == 0 && distance > 0) || (slider.active.last && distance < 0))){
|
1063 |
-
setPositionProperty(value, 'reset', 200);
|
1064 |
-
}else{
|
1065 |
-
// check if distance clears threshold
|
1066 |
-
if(Math.abs(distance) >= slider.settings.swipeThreshold){
|
1067 |
-
distance < 0 ? el.goToNextSlide() : el.goToPrevSlide();
|
1068 |
-
el.stopAuto();
|
1069 |
-
}else{
|
1070 |
-
// el.animate(property, 200);
|
1071 |
-
setPositionProperty(value, 'reset', 200);
|
1072 |
-
}
|
1073 |
-
}
|
1074 |
-
}
|
1075 |
-
slider.viewport.unbind('touchend', onTouchEnd);
|
1076 |
-
}
|
1077 |
-
|
1078 |
-
/**
|
1079 |
-
* Window resize event callback
|
1080 |
-
*/
|
1081 |
-
var resizeWindow = function(e){
|
1082 |
-
// don't do anything if slider isn't initialized.
|
1083 |
-
if(!slider.initialized) return;
|
1084 |
-
// get the new window dimens (again, thank you IE)
|
1085 |
-
var windowWidthNew = $(window).width();
|
1086 |
-
var windowHeightNew = $(window).height();
|
1087 |
-
// make sure that it is a true window resize
|
1088 |
-
// *we must check this because our dinosaur friend IE fires a window resize event when certain DOM elements
|
1089 |
-
// are resized. Can you just die already?*
|
1090 |
-
if(windowWidth != windowWidthNew || windowHeight != windowHeightNew){
|
1091 |
-
// set the new window dimens
|
1092 |
-
windowWidth = windowWidthNew;
|
1093 |
-
windowHeight = windowHeightNew;
|
1094 |
-
// update all dynamic elements
|
1095 |
-
el.redrawSlider();
|
1096 |
-
// Call user resize handler
|
1097 |
-
slider.settings.onSliderResize.call(el, slider.active.index);
|
1098 |
-
}
|
1099 |
-
}
|
1100 |
-
|
1101 |
-
/**
|
1102 |
-
* ===================================================================================
|
1103 |
-
* = PUBLIC FUNCTIONS
|
1104 |
-
* ===================================================================================
|
1105 |
-
*/
|
1106 |
-
|
1107 |
-
/**
|
1108 |
-
* Performs slide transition to the specified slide
|
1109 |
-
*
|
1110 |
-
* @param slideIndex (int)
|
1111 |
-
* - the destination slide's index (zero-based)
|
1112 |
-
*
|
1113 |
-
* @param direction (string)
|
1114 |
-
* - INTERNAL USE ONLY - the direction of travel ("prev" / "next")
|
1115 |
-
*/
|
1116 |
-
el.goToSlide = function(slideIndex, direction){
|
1117 |
-
// if plugin is currently in motion, ignore request
|
1118 |
-
if(slider.working || slider.active.index == slideIndex) return;
|
1119 |
-
// declare that plugin is in motion
|
1120 |
-
slider.working = true;
|
1121 |
-
// store the old index
|
1122 |
-
slider.oldIndex = slider.active.index;
|
1123 |
-
// if slideIndex is less than zero, set active index to last child (this happens during infinite loop)
|
1124 |
-
if(slideIndex < 0){
|
1125 |
-
slider.active.index = getPagerQty() - 1;
|
1126 |
-
// if slideIndex is greater than children length, set active index to 0 (this happens during infinite loop)
|
1127 |
-
}else if(slideIndex >= getPagerQty()){
|
1128 |
-
slider.active.index = 0;
|
1129 |
-
// set active index to requested slide
|
1130 |
-
}else{
|
1131 |
-
slider.active.index = slideIndex;
|
1132 |
-
}
|
1133 |
-
// onSlideBefore, onSlideNext, onSlidePrev callbacks
|
1134 |
-
slider.settings.onSlideBefore(slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index);
|
1135 |
-
if(direction == 'next'){
|
1136 |
-
slider.settings.onSlideNext(slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index);
|
1137 |
-
}else if(direction == 'prev'){
|
1138 |
-
slider.settings.onSlidePrev(slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index);
|
1139 |
-
}
|
1140 |
-
// check if last slide
|
1141 |
-
slider.active.last = slider.active.index >= getPagerQty() - 1;
|
1142 |
-
// update the pager with active class
|
1143 |
-
if(slider.settings.pager) updatePagerActive(slider.active.index);
|
1144 |
-
// // check for direction control update
|
1145 |
-
if(slider.settings.controls) updateDirectionControls();
|
1146 |
-
// if slider is set to mode: "fade"
|
1147 |
-
if(slider.settings.mode == 'fade'){
|
1148 |
-
// if adaptiveHeight is true and next height is different from current height, animate to the new height
|
1149 |
-
if(slider.settings.adaptiveHeight && slider.viewport.height() != getViewportHeight()){
|
1150 |
-
slider.viewport.animate({height: getViewportHeight()}, slider.settings.adaptiveHeightSpeed);
|
1151 |
-
}
|
1152 |
-
// fade out the visible child and reset its z-index value
|
1153 |
-
slider.children.filter(':visible').fadeOut(slider.settings.speed).css({zIndex: 0});
|
1154 |
-
// fade in the newly requested slide
|
1155 |
-
slider.children.eq(slider.active.index).css('zIndex', slider.settings.slideZIndex+1).fadeIn(slider.settings.speed, function(){
|
1156 |
-
$(this).css('zIndex', slider.settings.slideZIndex);
|
1157 |
-
updateAfterSlideTransition();
|
1158 |
-
});
|
1159 |
-
// slider mode is not "fade"
|
1160 |
-
}else{
|
1161 |
-
// if adaptiveHeight is true and next height is different from current height, animate to the new height
|
1162 |
-
if(slider.settings.adaptiveHeight && slider.viewport.height() != getViewportHeight()){
|
1163 |
-
slider.viewport.animate({height: getViewportHeight()}, slider.settings.adaptiveHeightSpeed);
|
1164 |
-
}
|
1165 |
-
var moveBy = 0;
|
1166 |
-
var position = {left: 0, top: 0};
|
1167 |
-
// if carousel and not infinite loop
|
1168 |
-
if(!slider.settings.infiniteLoop && slider.carousel && slider.active.last){
|
1169 |
-
if(slider.settings.mode == 'horizontal'){
|
1170 |
-
// get the last child position
|
1171 |
-
var lastChild = slider.children.eq(slider.children.length - 1);
|
1172 |
-
position = lastChild.position();
|
1173 |
-
// calculate the position of the last slide
|
1174 |
-
moveBy = slider.viewport.width() - lastChild.outerWidth();
|
1175 |
-
}else{
|
1176 |
-
// get last showing index position
|
1177 |
-
var lastShowingIndex = slider.children.length - slider.settings.minSlides;
|
1178 |
-
position = slider.children.eq(lastShowingIndex).position();
|
1179 |
-
}
|
1180 |
-
// horizontal carousel, going previous while on first slide (infiniteLoop mode)
|
1181 |
-
}else if(slider.carousel && slider.active.last && direction == 'prev'){
|
1182 |
-
// get the last child position
|
1183 |
-
var eq = slider.settings.moveSlides == 1 ? slider.settings.maxSlides - getMoveBy() : ((getPagerQty() - 1) * getMoveBy()) - (slider.children.length - slider.settings.maxSlides);
|
1184 |
-
var lastChild = el.children('.bx-clone').eq(eq);
|
1185 |
-
position = lastChild.position();
|
1186 |
-
// if infinite loop and "Next" is clicked on the last slide
|
1187 |
-
}else if(direction == 'next' && slider.active.index == 0){
|
1188 |
-
// get the last clone position
|
1189 |
-
position = el.find('> .bx-clone').eq(slider.settings.maxSlides).position();
|
1190 |
-
slider.active.last = false;
|
1191 |
-
// normal non-zero requests
|
1192 |
-
}else if(slideIndex >= 0){
|
1193 |
-
var requestEl = slideIndex * getMoveBy();
|
1194 |
-
position = slider.children.eq(requestEl).position();
|
1195 |
-
}
|
1196 |
-
|
1197 |
-
/* If the position doesn't exist
|
1198 |
-
* (e.g. if you destroy the slider on a next click),
|
1199 |
-
* it doesn't throw an error.
|
1200 |
-
*/
|
1201 |
-
if ("undefined" !== typeof(position)) {
|
1202 |
-
var value = slider.settings.mode == 'horizontal' ? -(position.left - moveBy) : -position.top;
|
1203 |
-
// plugin values to be animated
|
1204 |
-
setPositionProperty(value, 'slide', slider.settings.speed);
|
1205 |
-
}
|
1206 |
-
}
|
1207 |
-
}
|
1208 |
-
|
1209 |
-
/**
|
1210 |
-
* Transitions to the next slide in the show
|
1211 |
-
*/
|
1212 |
-
el.goToNextSlide = function(){
|
1213 |
-
// if infiniteLoop is false and last page is showing, disregard call
|
1214 |
-
if (!slider.settings.infiniteLoop && slider.active.last) return;
|
1215 |
-
var pagerIndex = parseInt(slider.active.index) + 1;
|
1216 |
-
el.goToSlide(pagerIndex, 'next');
|
1217 |
-
}
|
1218 |
-
|
1219 |
-
/**
|
1220 |
-
* Transitions to the prev slide in the show
|
1221 |
-
*/
|
1222 |
-
el.goToPrevSlide = function(){
|
1223 |
-
// if infiniteLoop is false and last page is showing, disregard call
|
1224 |
-
if (!slider.settings.infiniteLoop && slider.active.index == 0) return;
|
1225 |
-
var pagerIndex = parseInt(slider.active.index) - 1;
|
1226 |
-
el.goToSlide(pagerIndex, 'prev');
|
1227 |
-
}
|
1228 |
-
|
1229 |
-
/**
|
1230 |
-
* Starts the auto show
|
1231 |
-
*
|
1232 |
-
* @param preventControlUpdate (boolean)
|
1233 |
-
* - if true, auto controls state will not be updated
|
1234 |
-
*/
|
1235 |
-
el.startAuto = function(preventControlUpdate){
|
1236 |
-
// if an interval already exists, disregard call
|
1237 |
-
if(slider.interval) return;
|
1238 |
-
// create an interval
|
1239 |
-
slider.interval = setInterval(function(){
|
1240 |
-
slider.settings.autoDirection == 'next' ? el.goToNextSlide() : el.goToPrevSlide();
|
1241 |
-
}, slider.settings.pause);
|
1242 |
-
// if auto controls are displayed and preventControlUpdate is not true
|
1243 |
-
if (slider.settings.autoControls && preventControlUpdate != true) updateAutoControls('stop');
|
1244 |
-
}
|
1245 |
-
|
1246 |
-
/**
|
1247 |
-
* Stops the auto show
|
1248 |
-
*
|
1249 |
-
* @param preventControlUpdate (boolean)
|
1250 |
-
* - if true, auto controls state will not be updated
|
1251 |
-
*/
|
1252 |
-
el.stopAuto = function(preventControlUpdate){
|
1253 |
-
// if no interval exists, disregard call
|
1254 |
-
if(!slider.interval) return;
|
1255 |
-
// clear the interval
|
1256 |
-
clearInterval(slider.interval);
|
1257 |
-
slider.interval = null;
|
1258 |
-
// if auto controls are displayed and preventControlUpdate is not true
|
1259 |
-
if (slider.settings.autoControls && preventControlUpdate != true) updateAutoControls('start');
|
1260 |
-
}
|
1261 |
-
|
1262 |
-
/**
|
1263 |
-
* Returns current slide index (zero-based)
|
1264 |
-
*/
|
1265 |
-
el.getCurrentSlide = function(){
|
1266 |
-
return slider.active.index;
|
1267 |
-
}
|
1268 |
-
|
1269 |
-
/**
|
1270 |
-
* Returns current slide element
|
1271 |
-
*/
|
1272 |
-
el.getCurrentSlideElement = function(){
|
1273 |
-
return slider.children.eq(slider.active.index);
|
1274 |
-
}
|
1275 |
-
|
1276 |
-
/**
|
1277 |
-
* Returns number of slides in show
|
1278 |
-
*/
|
1279 |
-
el.getSlideCount = function(){
|
1280 |
-
return slider.children.length;
|
1281 |
-
}
|
1282 |
-
|
1283 |
-
/**
|
1284 |
-
* Update all dynamic slider elements
|
1285 |
-
*/
|
1286 |
-
el.redrawSlider = function(){
|
1287 |
-
// resize all children in ratio to new screen size
|
1288 |
-
slider.children.add(el.find('.bx-clone')).width(getSlideWidth());
|
1289 |
-
// adjust the height
|
1290 |
-
slider.viewport.css('height', getViewportHeight());
|
1291 |
-
// update the slide position
|
1292 |
-
if(!slider.settings.ticker) setSlidePosition();
|
1293 |
-
// if active.last was true before the screen resize, we want
|
1294 |
-
// to keep it last no matter what screen size we end on
|
1295 |
-
if (slider.active.last) slider.active.index = getPagerQty() - 1;
|
1296 |
-
// if the active index (page) no longer exists due to the resize, simply set the index as last
|
1297 |
-
if (slider.active.index >= getPagerQty()) slider.active.last = true;
|
1298 |
-
// if a pager is being displayed and a custom pager is not being used, update it
|
1299 |
-
if(slider.settings.pager && !slider.settings.pagerCustom){
|
1300 |
-
populatePager();
|
1301 |
-
updatePagerActive(slider.active.index);
|
1302 |
-
}
|
1303 |
-
}
|
1304 |
-
|
1305 |
-
/**
|
1306 |
-
* Destroy the current instance of the slider (revert everything back to original state)
|
1307 |
-
*/
|
1308 |
-
el.destroySlider = function(){
|
1309 |
-
// don't do anything if slider has already been destroyed
|
1310 |
-
if(!slider.initialized) return;
|
1311 |
-
slider.initialized = false;
|
1312 |
-
$('.bx-clone', this).remove();
|
1313 |
-
slider.children.each(function() {
|
1314 |
-
$(this).data("origStyle") != undefined ? $(this).attr("style", $(this).data("origStyle")) : $(this).removeAttr('style');
|
1315 |
-
});
|
1316 |
-
$(this).data("origStyle") != undefined ? this.attr("style", $(this).data("origStyle")) : $(this).removeAttr('style');
|
1317 |
-
$(this).unwrap().unwrap();
|
1318 |
-
if(slider.controls.el) slider.controls.el.remove();
|
1319 |
-
if(slider.controls.next) slider.controls.next.remove();
|
1320 |
-
if(slider.controls.prev) slider.controls.prev.remove();
|
1321 |
-
if(slider.pagerEl && slider.settings.controls) slider.pagerEl.remove();
|
1322 |
-
$('.bx-caption', this).remove();
|
1323 |
-
if(slider.controls.autoEl) slider.controls.autoEl.remove();
|
1324 |
-
clearInterval(slider.interval);
|
1325 |
-
if(slider.settings.responsive) $(window).unbind('resize', resizeWindow);
|
1326 |
-
}
|
1327 |
-
|
1328 |
-
/**
|
1329 |
-
* Reload the slider (revert all DOM changes, and re-initialize)
|
1330 |
-
*/
|
1331 |
-
el.reloadSlider = function(settings){
|
1332 |
-
if (settings != undefined) options = settings;
|
1333 |
-
el.destroySlider();
|
1334 |
-
init();
|
1335 |
-
}
|
1336 |
-
|
1337 |
-
init();
|
1338 |
-
|
1339 |
-
// returns the current jQuery object
|
1340 |
-
return this;
|
1341 |
-
}
|
1342 |
-
|
1343 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trunk/assets/js/jquery.bxslider.min.js
DELETED
@@ -1,10 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
* BxSlider v4.1.2 - Fully loaded, responsive content slider
|
3 |
-
* http://bxslider.com
|
4 |
-
*
|
5 |
-
* Copyright 2014, Steven Wanderski - http://stevenwanderski.com - http://bxcreative.com
|
6 |
-
* Written while drinking Belgian ales and listening to jazz
|
7 |
-
*
|
8 |
-
* Released under the MIT license - http://opensource.org/licenses/MIT
|
9 |
-
*/
|
10 |
-
!function(t){var e={},s={mode:"horizontal",slideSelector:"",infiniteLoop:!0,hideControlOnEnd:!1,speed:500,easing:null,slideMargin:0,startSlide:0,randomStart:!1,captions:!1,ticker:!1,tickerHover:!1,adaptiveHeight:!1,adaptiveHeightSpeed:500,video:!1,useCSS:!0,preloadImages:"visible",responsive:!0,slideZIndex:50,touchEnabled:!0,swipeThreshold:50,oneToOneTouch:!0,preventDefaultSwipeX:!0,preventDefaultSwipeY:!1,pager:!0,pagerType:"full",pagerShortSeparator:" / ",pagerSelector:null,buildPager:null,pagerCustom:null,controls:!0,nextText:"Next",prevText:"Prev",nextSelector:null,prevSelector:null,autoControls:!1,startText:"Start",stopText:"Stop",autoControlsCombine:!1,autoControlsSelector:null,auto:!1,pause:4e3,autoStart:!0,autoDirection:"next",autoHover:!1,autoDelay:0,minSlides:1,maxSlides:1,moveSlides:0,slideWidth:0,onSliderLoad:function(){},onSlideBefore:function(){},onSlideAfter:function(){},onSlideNext:function(){},onSlidePrev:function(){},onSliderResize:function(){}};t.fn.bxSlider=function(n){if(0==this.length)return this;if(this.length>1)return this.each(function(){t(this).bxSlider(n)}),this;var o={},r=this;e.el=this;var a=t(window).width(),l=t(window).height(),d=function(){o.settings=t.extend({},s,n),o.settings.slideWidth=parseInt(o.settings.slideWidth),o.children=r.children(o.settings.slideSelector),o.children.length<o.settings.minSlides&&(o.settings.minSlides=o.children.length),o.children.length<o.settings.maxSlides&&(o.settings.maxSlides=o.children.length),o.settings.randomStart&&(o.settings.startSlide=Math.floor(Math.random()*o.children.length)),o.active={index:o.settings.startSlide},o.carousel=o.settings.minSlides>1||o.settings.maxSlides>1,o.carousel&&(o.settings.preloadImages="all"),o.minThreshold=o.settings.minSlides*o.settings.slideWidth+(o.settings.minSlides-1)*o.settings.slideMargin,o.maxThreshold=o.settings.maxSlides*o.settings.slideWidth+(o.settings.maxSlides-1)*o.settings.slideMargin,o.working=!1,o.controls={},o.interval=null,o.animProp="vertical"==o.settings.mode?"top":"left",o.usingCSS=o.settings.useCSS&&"fade"!=o.settings.mode&&function(){var t=document.createElement("div"),e=["WebkitPerspective","MozPerspective","OPerspective","msPerspective"];for(var i in e)if(void 0!==t.style[e[i]])return o.cssPrefix=e[i].replace("Perspective","").toLowerCase(),o.animProp="-"+o.cssPrefix+"-transform",!0;return!1}(),"vertical"==o.settings.mode&&(o.settings.maxSlides=o.settings.minSlides),r.data("origStyle",r.attr("style")),r.children(o.settings.slideSelector).each(function(){t(this).data("origStyle",t(this).attr("style"))}),c()},c=function(){r.wrap('<div class="bx-wrapper"><div class="bx-viewport"></div></div>'),o.viewport=r.parent(),o.loader=t('<div class="bx-loading" />'),o.viewport.prepend(o.loader),r.css({width:"horizontal"==o.settings.mode?100*o.children.length+215+"%":"auto",position:"relative"}),o.usingCSS&&o.settings.easing?r.css("-"+o.cssPrefix+"-transition-timing-function",o.settings.easing):o.settings.easing||(o.settings.easing="swing"),f(),o.viewport.css({width:"100%",overflow:"hidden",position:"relative"}),o.viewport.parent().css({maxWidth:p()}),o.settings.pager||o.viewport.parent().css({margin:"0 auto 0px"}),o.children.css({"float":"horizontal"==o.settings.mode?"left":"none",listStyle:"none",position:"relative"}),o.children.css("width",u()),"horizontal"==o.settings.mode&&o.settings.slideMargin>0&&o.children.css("marginRight",o.settings.slideMargin),"vertical"==o.settings.mode&&o.settings.slideMargin>0&&o.children.css("marginBottom",o.settings.slideMargin),"fade"==o.settings.mode&&(o.children.css({position:"absolute",zIndex:0,display:"none"}),o.children.eq(o.settings.startSlide).css({zIndex:o.settings.slideZIndex,display:"block"})),o.controls.el=t('<div class="bx-controls" />'),o.settings.captions&&P(),o.active.last=o.settings.startSlide==x()-1,o.settings.video&&r.fitVids();var e=o.children.eq(o.settings.startSlide);"all"==o.settings.preloadImages&&(e=o.children),o.settings.ticker?o.settings.pager=!1:(o.settings.pager&&T(),o.settings.controls&&C(),o.settings.auto&&o.settings.autoControls&&E(),(o.settings.controls||o.settings.autoControls||o.settings.pager)&&o.viewport.after(o.controls.el)),g(e,h)},g=function(e,i){var s=e.find("img, iframe").length;if(0==s)return i(),void 0;var n=0;e.find("img, iframe").each(function(){t(this).one("load",function(){++n==s&&i()}).each(function(){this.complete&&t(this).load()})})},h=function(){if(o.settings.infiniteLoop&&"fade"!=o.settings.mode&&!o.settings.ticker){var e="vertical"==o.settings.mode?o.settings.minSlides:o.settings.maxSlides,i=o.children.slice(0,e).clone().addClass("bx-clone"),s=o.children.slice(-e).clone().addClass("bx-clone");r.append(i).prepend(s)}o.loader.remove(),S(),"vertical"==o.settings.mode&&(o.settings.adaptiveHeight=!0),o.viewport.height(v()),r.redrawSlider(),o.settings.onSliderLoad(o.active.index),o.initialized=!0,o.settings.responsive&&t(window).bind("resize",Z),o.settings.auto&&o.settings.autoStart&&H(),o.settings.ticker&&L(),o.settings.pager&&q(o.settings.startSlide),o.settings.controls&&W(),o.settings.touchEnabled&&!o.settings.ticker&&O()},v=function(){var e=0,s=t();if("vertical"==o.settings.mode||o.settings.adaptiveHeight)if(o.carousel){var n=1==o.settings.moveSlides?o.active.index:o.active.index*m();for(s=o.children.eq(n),i=1;i<=o.settings.maxSlides-1;i++)s=n+i>=o.children.length?s.add(o.children.eq(i-1)):s.add(o.children.eq(n+i))}else s=o.children.eq(o.active.index);else s=o.children;return"vertical"==o.settings.mode?(s.each(function(){e+=t(this).outerHeight()}),o.settings.slideMargin>0&&(e+=o.settings.slideMargin*(o.settings.minSlides-1))):e=Math.max.apply(Math,s.map(function(){return t(this).outerHeight(!1)}).get()),e},p=function(){var t="100%";return o.settings.slideWidth>0&&(t="horizontal"==o.settings.mode?o.settings.maxSlides*o.settings.slideWidth+(o.settings.maxSlides-1)*o.settings.slideMargin:o.settings.slideWidth),t},u=function(){var t=o.settings.slideWidth,e=o.viewport.width();return 0==o.settings.slideWidth||o.settings.slideWidth>e&&!o.carousel||"vertical"==o.settings.mode?t=e:o.settings.maxSlides>1&&"horizontal"==o.settings.mode&&(e>o.maxThreshold||e<o.minThreshold&&(t=(e-o.settings.slideMargin*(o.settings.minSlides-1))/o.settings.minSlides)),t},f=function(){var t=1;if("horizontal"==o.settings.mode&&o.settings.slideWidth>0)if(o.viewport.width()<o.minThreshold)t=o.settings.minSlides;else if(o.viewport.width()>o.maxThreshold)t=o.settings.maxSlides;else{var e=o.children.first().width();t=Math.floor(o.viewport.width()/e)}else"vertical"==o.settings.mode&&(t=o.settings.minSlides);return t},x=function(){var t=0;if(o.settings.moveSlides>0)if(o.settings.infiniteLoop)t=o.children.length/m();else for(var e=0,i=0;e<o.children.length;)++t,e=i+f(),i+=o.settings.moveSlides<=f()?o.settings.moveSlides:f();else t=Math.ceil(o.children.length/f());return t},m=function(){return o.settings.moveSlides>0&&o.settings.moveSlides<=f()?o.settings.moveSlides:f()},S=function(){if(o.children.length>o.settings.maxSlides&&o.active.last&&!o.settings.infiniteLoop){if("horizontal"==o.settings.mode){var t=o.children.last(),e=t.position();b(-(e.left-(o.viewport.width()-t.width())),"reset",0)}else if("vertical"==o.settings.mode){var i=o.children.length-o.settings.minSlides,e=o.children.eq(i).position();b(-e.top,"reset",0)}}else{var e=o.children.eq(o.active.index*m()).position();o.active.index==x()-1&&(o.active.last=!0),void 0!=e&&("horizontal"==o.settings.mode?b(-e.left,"reset",0):"vertical"==o.settings.mode&&b(-e.top,"reset",0))}},b=function(t,e,i,s){if(o.usingCSS){var n="vertical"==o.settings.mode?"translate3d(0, "+t+"px, 0)":"translate3d("+t+"px, 0, 0)";r.css("-"+o.cssPrefix+"-transition-duration",i/1e3+"s"),"slide"==e?(r.css(o.animProp,n),r.bind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",function(){r.unbind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd"),D()})):"reset"==e?r.css(o.animProp,n):"ticker"==e&&(r.css("-"+o.cssPrefix+"-transition-timing-function","linear"),r.css(o.animProp,n),r.bind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",function(){r.unbind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd"),b(s.resetValue,"reset",0),N()}))}else{var a={};a[o.animProp]=t,"slide"==e?r.animate(a,i,o.settings.easing,function(){D()}):"reset"==e?r.css(o.animProp,t):"ticker"==e&&r.animate(a,speed,"linear",function(){b(s.resetValue,"reset",0),N()})}},w=function(){for(var e="",i=x(),s=0;i>s;s++){var n="";o.settings.buildPager&&t.isFunction(o.settings.buildPager)?(n=o.settings.buildPager(s),o.pagerEl.addClass("bx-custom-pager")):(n=s+1,o.pagerEl.addClass("bx-default-pager")),e+='<div class="bx-pager-item"><a href="" data-slide-index="'+s+'" class="bx-pager-link">'+n+"</a></div>"}o.pagerEl.html(e)},T=function(){o.settings.pagerCustom?o.pagerEl=t(o.settings.pagerCustom):(o.pagerEl=t('<div class="bx-pager" />'),o.settings.pagerSelector?t(o.settings.pagerSelector).html(o.pagerEl):o.controls.el.addClass("bx-has-pager").append(o.pagerEl),w()),o.pagerEl.on("click","a",I)},C=function(){o.controls.next=t('<a class="bx-next" href="">'+o.settings.nextText+"</a>"),o.controls.prev=t('<a class="bx-prev" href="">'+o.settings.prevText+"</a>"),o.controls.next.bind("click",y),o.controls.prev.bind("click",z),o.settings.nextSelector&&t(o.settings.nextSelector).append(o.controls.next),o.settings.prevSelector&&t(o.settings.prevSelector).append(o.controls.prev),o.settings.nextSelector||o.settings.prevSelector||(o.controls.directionEl=t('<div class="bx-controls-direction" />'),o.controls.directionEl.append(o.controls.prev).append(o.controls.next),o.controls.el.addClass("bx-has-controls-direction").append(o.controls.directionEl))},E=function(){o.controls.start=t('<div class="bx-controls-auto-item"><a class="bx-start" href="">'+o.settings.startText+"</a></div>"),o.controls.stop=t('<div class="bx-controls-auto-item"><a class="bx-stop" href="">'+o.settings.stopText+"</a></div>"),o.controls.autoEl=t('<div class="bx-controls-auto" />'),o.controls.autoEl.on("click",".bx-start",k),o.controls.autoEl.on("click",".bx-stop",M),o.settings.autoControlsCombine?o.controls.autoEl.append(o.controls.start):o.controls.autoEl.append(o.controls.start).append(o.controls.stop),o.settings.autoControlsSelector?t(o.settings.autoControlsSelector).html(o.controls.autoEl):o.controls.el.addClass("bx-has-controls-auto").append(o.controls.autoEl),A(o.settings.autoStart?"stop":"start")},P=function(){o.children.each(function(){var e=t(this).find("img:first").attr("title");void 0!=e&&(""+e).length&&t(this).append('<div class="bx-caption"><span>'+e+"</span></div>")})},y=function(t){o.settings.auto&&r.stopAuto(),r.goToNextSlide(),t.preventDefault()},z=function(t){o.settings.auto&&r.stopAuto(),r.goToPrevSlide(),t.preventDefault()},k=function(t){r.startAuto(),t.preventDefault()},M=function(t){r.stopAuto(),t.preventDefault()},I=function(e){o.settings.auto&&r.stopAuto();var i=t(e.currentTarget),s=parseInt(i.attr("data-slide-index"));s!=o.active.index&&r.goToSlide(s),e.preventDefault()},q=function(e){var i=o.children.length;return"short"==o.settings.pagerType?(o.settings.maxSlides>1&&(i=Math.ceil(o.children.length/o.settings.maxSlides)),o.pagerEl.html(e+1+o.settings.pagerShortSeparator+i),void 0):(o.pagerEl.find("a").removeClass("active"),o.pagerEl.each(function(i,s){t(s).find("a").eq(e).addClass("active")}),void 0)},D=function(){if(o.settings.infiniteLoop){var t="";0==o.active.index?t=o.children.eq(0).position():o.active.index==x()-1&&o.carousel?t=o.children.eq((x()-1)*m()).position():o.active.index==o.children.length-1&&(t=o.children.eq(o.children.length-1).position()),t&&("horizontal"==o.settings.mode?b(-t.left,"reset",0):"vertical"==o.settings.mode&&b(-t.top,"reset",0))}o.working=!1,o.settings.onSlideAfter(o.children.eq(o.active.index),o.oldIndex,o.active.index)},A=function(t){o.settings.autoControlsCombine?o.controls.autoEl.html(o.controls[t]):(o.controls.autoEl.find("a").removeClass("active"),o.controls.autoEl.find("a:not(.bx-"+t+")").addClass("active"))},W=function(){1==x()?(o.controls.prev.addClass("disabled"),o.controls.next.addClass("disabled")):!o.settings.infiniteLoop&&o.settings.hideControlOnEnd&&(0==o.active.index?(o.controls.prev.addClass("disabled"),o.controls.next.removeClass("disabled")):o.active.index==x()-1?(o.controls.next.addClass("disabled"),o.controls.prev.removeClass("disabled")):(o.controls.prev.removeClass("disabled"),o.controls.next.removeClass("disabled")))},H=function(){o.settings.autoDelay>0?setTimeout(r.startAuto,o.settings.autoDelay):r.startAuto(),o.settings.autoHover&&r.hover(function(){o.interval&&(r.stopAuto(!0),o.autoPaused=!0)},function(){o.autoPaused&&(r.startAuto(!0),o.autoPaused=null)})},L=function(){var e=0;if("next"==o.settings.autoDirection)r.append(o.children.clone().addClass("bx-clone"));else{r.prepend(o.children.clone().addClass("bx-clone"));var i=o.children.first().position();e="horizontal"==o.settings.mode?-i.left:-i.top}b(e,"reset",0),o.settings.pager=!1,o.settings.controls=!1,o.settings.autoControls=!1,o.settings.tickerHover&&!o.usingCSS&&o.viewport.hover(function(){r.stop()},function(){var e=0;o.children.each(function(){e+="horizontal"==o.settings.mode?t(this).outerWidth(!0):t(this).outerHeight(!0)});var i=o.settings.speed/e,s="horizontal"==o.settings.mode?"left":"top",n=i*(e-Math.abs(parseInt(r.css(s))));N(n)}),N()},N=function(t){speed=t?t:o.settings.speed;var e={left:0,top:0},i={left:0,top:0};"next"==o.settings.autoDirection?e=r.find(".bx-clone").first().position():i=o.children.first().position();var s="horizontal"==o.settings.mode?-e.left:-e.top,n="horizontal"==o.settings.mode?-i.left:-i.top,a={resetValue:n};b(s,"ticker",speed,a)},O=function(){o.touch={start:{x:0,y:0},end:{x:0,y:0}},o.viewport.bind("touchstart",X)},X=function(t){if(o.working)t.preventDefault();else{o.touch.originalPos=r.position();var e=t.originalEvent;o.touch.start.x=e.changedTouches[0].pageX,o.touch.start.y=e.changedTouches[0].pageY,o.viewport.bind("touchmove",Y),o.viewport.bind("touchend",V)}},Y=function(t){var e=t.originalEvent,i=Math.abs(e.changedTouches[0].pageX-o.touch.start.x),s=Math.abs(e.changedTouches[0].pageY-o.touch.start.y);if(3*i>s&&o.settings.preventDefaultSwipeX?t.preventDefault():3*s>i&&o.settings.preventDefaultSwipeY&&t.preventDefault(),"fade"!=o.settings.mode&&o.settings.oneToOneTouch){var n=0;if("horizontal"==o.settings.mode){var r=e.changedTouches[0].pageX-o.touch.start.x;n=o.touch.originalPos.left+r}else{var r=e.changedTouches[0].pageY-o.touch.start.y;n=o.touch.originalPos.top+r}b(n,"reset",0)}},V=function(t){o.viewport.unbind("touchmove",Y);var e=t.originalEvent,i=0;if(o.touch.end.x=e.changedTouches[0].pageX,o.touch.end.y=e.changedTouches[0].pageY,"fade"==o.settings.mode){var s=Math.abs(o.touch.start.x-o.touch.end.x);s>=o.settings.swipeThreshold&&(o.touch.start.x>o.touch.end.x?r.goToNextSlide():r.goToPrevSlide(),r.stopAuto())}else{var s=0;"horizontal"==o.settings.mode?(s=o.touch.end.x-o.touch.start.x,i=o.touch.originalPos.left):(s=o.touch.end.y-o.touch.start.y,i=o.touch.originalPos.top),!o.settings.infiniteLoop&&(0==o.active.index&&s>0||o.active.last&&0>s)?b(i,"reset",200):Math.abs(s)>=o.settings.swipeThreshold?(0>s?r.goToNextSlide():r.goToPrevSlide(),r.stopAuto()):b(i,"reset",200)}o.viewport.unbind("touchend",V)},Z=function(){var e=t(window).width(),i=t(window).height();(a!=e||l!=i)&&(a=e,l=i,r.redrawSlider(),o.settings.onSliderResize.call(r,o.active.index))};return r.goToSlide=function(e,i){if(!o.working&&o.active.index!=e)if(o.working=!0,o.oldIndex=o.active.index,o.active.index=0>e?x()-1:e>=x()?0:e,o.settings.onSlideBefore(o.children.eq(o.active.index),o.oldIndex,o.active.index),"next"==i?o.settings.onSlideNext(o.children.eq(o.active.index),o.oldIndex,o.active.index):"prev"==i&&o.settings.onSlidePrev(o.children.eq(o.active.index),o.oldIndex,o.active.index),o.active.last=o.active.index>=x()-1,o.settings.pager&&q(o.active.index),o.settings.controls&&W(),"fade"==o.settings.mode)o.settings.adaptiveHeight&&o.viewport.height()!=v()&&o.viewport.animate({height:v()},o.settings.adaptiveHeightSpeed),o.children.filter(":visible").fadeOut(o.settings.speed).css({zIndex:0}),o.children.eq(o.active.index).css("zIndex",o.settings.slideZIndex+1).fadeIn(o.settings.speed,function(){t(this).css("zIndex",o.settings.slideZIndex),D()});else{o.settings.adaptiveHeight&&o.viewport.height()!=v()&&o.viewport.animate({height:v()},o.settings.adaptiveHeightSpeed);var s=0,n={left:0,top:0};if(!o.settings.infiniteLoop&&o.carousel&&o.active.last)if("horizontal"==o.settings.mode){var a=o.children.eq(o.children.length-1);n=a.position(),s=o.viewport.width()-a.outerWidth()}else{var l=o.children.length-o.settings.minSlides;n=o.children.eq(l).position()}else if(o.carousel&&o.active.last&&"prev"==i){var d=1==o.settings.moveSlides?o.settings.maxSlides-m():(x()-1)*m()-(o.children.length-o.settings.maxSlides),a=r.children(".bx-clone").eq(d);n=a.position()}else if("next"==i&&0==o.active.index)n=r.find("> .bx-clone").eq(o.settings.maxSlides).position(),o.active.last=!1;else if(e>=0){var c=e*m();n=o.children.eq(c).position()}if("undefined"!=typeof n){var g="horizontal"==o.settings.mode?-(n.left-s):-n.top;b(g,"slide",o.settings.speed)}}},r.goToNextSlide=function(){if(o.settings.infiniteLoop||!o.active.last){var t=parseInt(o.active.index)+1;r.goToSlide(t,"next")}},r.goToPrevSlide=function(){if(o.settings.infiniteLoop||0!=o.active.index){var t=parseInt(o.active.index)-1;r.goToSlide(t,"prev")}},r.startAuto=function(t){o.interval||(o.interval=setInterval(function(){"next"==o.settings.autoDirection?r.goToNextSlide():r.goToPrevSlide()},o.settings.pause),o.settings.autoControls&&1!=t&&A("stop"))},r.stopAuto=function(t){o.interval&&(clearInterval(o.interval),o.interval=null,o.settings.autoControls&&1!=t&&A("start"))},r.getCurrentSlide=function(){return o.active.index},r.getCurrentSlideElement=function(){return o.children.eq(o.active.index)},r.getSlideCount=function(){return o.children.length},r.redrawSlider=function(){o.children.add(r.find(".bx-clone")).outerWidth(u()),o.viewport.css("height",v()),o.settings.ticker||S(),o.active.last&&(o.active.index=x()-1),o.active.index>=x()&&(o.active.last=!0),o.settings.pager&&!o.settings.pagerCustom&&(w(),q(o.active.index))},r.destroySlider=function(){o.initialized&&(o.initialized=!1,t(".bx-clone",this).remove(),o.children.each(function(){void 0!=t(this).data("origStyle")?t(this).attr("style",t(this).data("origStyle")):t(this).removeAttr("style")}),void 0!=t(this).data("origStyle")?this.attr("style",t(this).data("origStyle")):t(this).removeAttr("style"),t(this).unwrap().unwrap(),o.controls.el&&o.controls.el.remove(),o.controls.next&&o.controls.next.remove(),o.controls.prev&&o.controls.prev.remove(),o.pagerEl&&o.settings.controls&&o.pagerEl.remove(),t(".bx-caption",this).remove(),o.controls.autoEl&&o.controls.autoEl.remove(),clearInterval(o.interval),o.settings.responsive&&t(window).unbind("resize",Z))},r.reloadSlider=function(t){void 0!=t&&(n=t),r.destroySlider(),d()},d(),this}}(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trunk/assets/js/jquery.easing.1.3.js
DELETED
@@ -1,205 +0,0 @@
|
|
1 |
-
/*
|
2 |
-
* jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
|
3 |
-
*
|
4 |
-
* Uses the built in easing capabilities added In jQuery 1.1
|
5 |
-
* to offer multiple easing options
|
6 |
-
*
|
7 |
-
* TERMS OF USE - jQuery Easing
|
8 |
-
*
|
9 |
-
* Open source under the BSD License.
|
10 |
-
*
|
11 |
-
* Copyright © 2008 George McGinley Smith
|
12 |
-
* All rights reserved.
|
13 |
-
*
|
14 |
-
* Redistribution and use in source and binary forms, with or without modification,
|
15 |
-
* are permitted provided that the following conditions are met:
|
16 |
-
*
|
17 |
-
* Redistributions of source code must retain the above copyright notice, this list of
|
18 |
-
* conditions and the following disclaimer.
|
19 |
-
* Redistributions in binary form must reproduce the above copyright notice, this list
|
20 |
-
* of conditions and the following disclaimer in the documentation and/or other materials
|
21 |
-
* provided with the distribution.
|
22 |
-
*
|
23 |
-
* Neither the name of the author nor the names of contributors may be used to endorse
|
24 |
-
* or promote products derived from this software without specific prior written permission.
|
25 |
-
*
|
26 |
-
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
27 |
-
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
28 |
-
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
29 |
-
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
30 |
-
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
31 |
-
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
32 |
-
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
33 |
-
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
34 |
-
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
35 |
-
*
|
36 |
-
*/
|
37 |
-
|
38 |
-
// t: current time, b: begInnIng value, c: change In value, d: duration
|
39 |
-
jQuery.easing['jswing'] = jQuery.easing['swing'];
|
40 |
-
|
41 |
-
jQuery.extend( jQuery.easing,
|
42 |
-
{
|
43 |
-
def: 'easeOutQuad',
|
44 |
-
swing: function (x, t, b, c, d) {
|
45 |
-
//alert(jQuery.easing.default);
|
46 |
-
return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
|
47 |
-
},
|
48 |
-
easeInQuad: function (x, t, b, c, d) {
|
49 |
-
return c*(t/=d)*t + b;
|
50 |
-
},
|
51 |
-
easeOutQuad: function (x, t, b, c, d) {
|
52 |
-
return -c *(t/=d)*(t-2) + b;
|
53 |
-
},
|
54 |
-
easeInOutQuad: function (x, t, b, c, d) {
|
55 |
-
if ((t/=d/2) < 1) return c/2*t*t + b;
|
56 |
-
return -c/2 * ((--t)*(t-2) - 1) + b;
|
57 |
-
},
|
58 |
-
easeInCubic: function (x, t, b, c, d) {
|
59 |
-
return c*(t/=d)*t*t + b;
|
60 |
-
},
|
61 |
-
easeOutCubic: function (x, t, b, c, d) {
|
62 |
-
return c*((t=t/d-1)*t*t + 1) + b;
|
63 |
-
},
|
64 |
-
easeInOutCubic: function (x, t, b, c, d) {
|
65 |
-
if ((t/=d/2) < 1) return c/2*t*t*t + b;
|
66 |
-
return c/2*((t-=2)*t*t + 2) + b;
|
67 |
-
},
|
68 |
-
easeInQuart: function (x, t, b, c, d) {
|
69 |
-
return c*(t/=d)*t*t*t + b;
|
70 |
-
},
|
71 |
-
easeOutQuart: function (x, t, b, c, d) {
|
72 |
-
return -c * ((t=t/d-1)*t*t*t - 1) + b;
|
73 |
-
},
|
74 |
-
easeInOutQuart: function (x, t, b, c, d) {
|
75 |
-
if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
|
76 |
-
return -c/2 * ((t-=2)*t*t*t - 2) + b;
|
77 |
-
},
|
78 |
-
easeInQuint: function (x, t, b, c, d) {
|
79 |
-
return c*(t/=d)*t*t*t*t + b;
|
80 |
-
},
|
81 |
-
easeOutQuint: function (x, t, b, c, d) {
|
82 |
-
return c*((t=t/d-1)*t*t*t*t + 1) + b;
|
83 |
-
},
|
84 |
-
easeInOutQuint: function (x, t, b, c, d) {
|
85 |
-
if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
|
86 |
-
return c/2*((t-=2)*t*t*t*t + 2) + b;
|
87 |
-
},
|
88 |
-
easeInSine: function (x, t, b, c, d) {
|
89 |
-
return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
|
90 |
-
},
|
91 |
-
easeOutSine: function (x, t, b, c, d) {
|
92 |
-
return c * Math.sin(t/d * (Math.PI/2)) + b;
|
93 |
-
},
|
94 |
-
easeInOutSine: function (x, t, b, c, d) {
|
95 |
-
return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
|
96 |
-
},
|
97 |
-
easeInExpo: function (x, t, b, c, d) {
|
98 |
-
return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
|
99 |
-
},
|
100 |
-
easeOutExpo: function (x, t, b, c, d) {
|
101 |
-
return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
|
102 |
-
},
|
103 |
-
easeInOutExpo: function (x, t, b, c, d) {
|
104 |
-
if (t==0) return b;
|
105 |
-
if (t==d) return b+c;
|
106 |
-
if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
|
107 |
-
return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
|
108 |
-
},
|
109 |
-
easeInCirc: function (x, t, b, c, d) {
|
110 |
-
return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
|
111 |
-
},
|
112 |
-
easeOutCirc: function (x, t, b, c, d) {
|
113 |
-
return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
|
114 |
-
},
|
115 |
-
easeInOutCirc: function (x, t, b, c, d) {
|
116 |
-
if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
|
117 |
-
return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
|
118 |
-
},
|
119 |
-
easeInElastic: function (x, t, b, c, d) {
|
120 |
-
var s=1.70158;var p=0;var a=c;
|
121 |
-
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
|
122 |
-
if (a < Math.abs(c)) { a=c; var s=p/4; }
|
123 |
-
else var s = p/(2*Math.PI) * Math.asin (c/a);
|
124 |
-
return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
|
125 |
-
},
|
126 |
-
easeOutElastic: function (x, t, b, c, d) {
|
127 |
-
var s=1.70158;var p=0;var a=c;
|
128 |
-
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
|
129 |
-
if (a < Math.abs(c)) { a=c; var s=p/4; }
|
130 |
-
else var s = p/(2*Math.PI) * Math.asin (c/a);
|
131 |
-
return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
|
132 |
-
},
|
133 |
-
easeInOutElastic: function (x, t, b, c, d) {
|
134 |
-
var s=1.70158;var p=0;var a=c;
|
135 |
-
if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5);
|
136 |
-
if (a < Math.abs(c)) { a=c; var s=p/4; }
|
137 |
-
else var s = p/(2*Math.PI) * Math.asin (c/a);
|
138 |
-
if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
|
139 |
-
return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
|
140 |
-
},
|
141 |
-
easeInBack: function (x, t, b, c, d, s) {
|
142 |
-
if (s == undefined) s = 1.70158;
|
143 |
-
return c*(t/=d)*t*((s+1)*t - s) + b;
|
144 |
-
},
|
145 |
-
easeOutBack: function (x, t, b, c, d, s) {
|
146 |
-
if (s == undefined) s = 1.70158;
|
147 |
-
return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
|
148 |
-
},
|
149 |
-
easeInOutBack: function (x, t, b, c, d, s) {
|
150 |
-
if (s == undefined) s = 1.70158;
|
151 |
-
if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
|
152 |
-
return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
|
153 |
-
},
|
154 |
-
easeInBounce: function (x, t, b, c, d) {
|
155 |
-
return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
|
156 |
-
},
|
157 |
-
easeOutBounce: function (x, t, b, c, d) {
|
158 |
-
if ((t/=d) < (1/2.75)) {
|
159 |
-
return c*(7.5625*t*t) + b;
|
160 |
-
} else if (t < (2/2.75)) {
|
161 |
-
return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
|
162 |
-
} else if (t < (2.5/2.75)) {
|
163 |
-
return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
|
164 |
-
} else {
|
165 |
-
return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
|
166 |
-
}
|
167 |
-
},
|
168 |
-
easeInOutBounce: function (x, t, b, c, d) {
|
169 |
-
if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
|
170 |
-
return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
|
171 |
-
}
|
172 |
-
});
|
173 |
-
|
174 |
-
/*
|
175 |
-
*
|
176 |
-
* TERMS OF USE - EASING EQUATIONS
|
177 |
-
*
|
178 |
-
* Open source under the BSD License.
|
179 |
-
*
|
180 |
-
* Copyright © 2001 Robert Penner
|
181 |
-
* All rights reserved.
|
182 |
-
*
|
183 |
-
* Redistribution and use in source and binary forms, with or without modification,
|
184 |
-
* are permitted provided that the following conditions are met:
|
185 |
-
*
|
186 |
-
* Redistributions of source code must retain the above copyright notice, this list of
|
187 |
-
* conditions and the following disclaimer.
|
188 |
-
* Redistributions in binary form must reproduce the above copyright notice, this list
|
189 |
-
* of conditions and the following disclaimer in the documentation and/or other materials
|
190 |
-
* provided with the distribution.
|
191 |
-
*
|
192 |
-
* Neither the name of the author nor the names of contributors may be used to endorse
|
193 |
-
* or promote products derived from this software without specific prior written permission.
|
194 |
-
*
|
195 |
-
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
196 |
-
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
197 |
-
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
198 |
-
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
199 |
-
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
200 |
-
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
201 |
-
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
202 |
-
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
203 |
-
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
204 |
-
*
|
205 |
-
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trunk/assets/js/jquery.fitvids.js
DELETED
@@ -1,80 +0,0 @@
|
|
1 |
-
/*global jQuery */
|
2 |
-
/*jshint multistr:true browser:true */
|
3 |
-
/*!
|
4 |
-
* FitVids 1.0
|
5 |
-
*
|
6 |
-
* Copyright 2011, Chris Coyier - http://css-tricks.com + Dave Rupert - http://daverupert.com
|
7 |
-
* Credit to Thierry Koblentz - http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/
|
8 |
-
* Released under the WTFPL license - http://sam.zoy.org/wtfpl/
|
9 |
-
*
|
10 |
-
* Date: Thu Sept 01 18:00:00 2011 -0500
|
11 |
-
*/
|
12 |
-
|
13 |
-
(function( $ ){
|
14 |
-
|
15 |
-
"use strict";
|
16 |
-
|
17 |
-
$.fn.fitVids = function( options ) {
|
18 |
-
var settings = {
|
19 |
-
customSelector: null
|
20 |
-
};
|
21 |
-
|
22 |
-
var div = document.createElement('div'),
|
23 |
-
ref = document.getElementsByTagName('base')[0] || document.getElementsByTagName('script')[0];
|
24 |
-
|
25 |
-
div.className = 'fit-vids-style';
|
26 |
-
div.innerHTML = '­<style> \
|
27 |
-
.fluid-width-video-wrapper { \
|
28 |
-
width: 100%; \
|
29 |
-
position: relative; \
|
30 |
-
padding: 0; \
|
31 |
-
} \
|
32 |
-
\
|
33 |
-
.fluid-width-video-wrapper iframe, \
|
34 |
-
.fluid-width-video-wrapper object, \
|
35 |
-
.fluid-width-video-wrapper embed { \
|
36 |
-
position: absolute; \
|
37 |
-
top: 0; \
|
38 |
-
left: 0; \
|
39 |
-
width: 100%; \
|
40 |
-
height: 100%; \
|
41 |
-
} \
|
42 |
-
</style>';
|
43 |
-
|
44 |
-
ref.parentNode.insertBefore(div,ref);
|
45 |
-
|
46 |
-
if ( options ) {
|
47 |
-
$.extend( settings, options );
|
48 |
-
}
|
49 |
-
|
50 |
-
return this.each(function(){
|
51 |
-
var selectors = [
|
52 |
-
"iframe[src*='player.vimeo.com']",
|
53 |
-
"iframe[src*='www.youtube.com']",
|
54 |
-
"iframe[src*='www.kickstarter.com']",
|
55 |
-
"object",
|
56 |
-
"embed"
|
57 |
-
];
|
58 |
-
|
59 |
-
if (settings.customSelector) {
|
60 |
-
selectors.push(settings.customSelector);
|
61 |
-
}
|
62 |
-
|
63 |
-
var $allVideos = $(this).find(selectors.join(','));
|
64 |
-
|
65 |
-
$allVideos.each(function(){
|
66 |
-
var $this = $(this);
|
67 |
-
if (this.tagName.toLowerCase() === 'embed' && $this.parent('object').length || $this.parent('.fluid-width-video-wrapper').length) { return; }
|
68 |
-
var height = ( this.tagName.toLowerCase() === 'object' || ($this.attr('height') && !isNaN(parseInt($this.attr('height'), 10))) ) ? parseInt($this.attr('height'), 10) : $this.height(),
|
69 |
-
width = !isNaN(parseInt($this.attr('width'), 10)) ? parseInt($this.attr('width'), 10) : $this.width(),
|
70 |
-
aspectRatio = height / width;
|
71 |
-
if(!$this.attr('id')){
|
72 |
-
var videoID = 'fitvid' + Math.floor(Math.random()*999999);
|
73 |
-
$this.attr('id', videoID);
|
74 |
-
}
|
75 |
-
$this.wrap('<div class="fluid-width-video-wrapper"></div>').parent('.fluid-width-video-wrapper').css('padding-top', (aspectRatio * 100)+"%");
|
76 |
-
$this.removeAttr('height').removeAttr('width');
|
77 |
-
});
|
78 |
-
});
|
79 |
-
};
|
80 |
-
})( jQuery );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trunk/includes/class-testimonials-widget-settings.php
DELETED
@@ -1,1074 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
3 |
-
Copyright 2014 Michael Cannon (email: mc@aihr.us)
|
4 |
-
|
5 |
-
This program is free software; you can redistribute it and/or modify
|
6 |
-
it under the terms of the GNU General Public License, version 2, as
|
7 |
-
published by the Free Software Foundation.
|
8 |
-
|
9 |
-
This program is distributed in the hope that it will be useful,
|
10 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12 |
-
GNU General Public License for more details.
|
13 |
-
|
14 |
-
You should have received a copy of the GNU General Public License
|
15 |
-
along with this program; if not, write to the Free Software
|
16 |
-
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
17 |
-
*/
|
18 |
-
|
19 |
-
/**
|
20 |
-
* Testimonials settings class
|
21 |
-
*
|
22 |
-
* Based upon http://alisothegeek.com/2011/01/wordpress-settings-api-tutorial-1/
|
23 |
-
*/
|
24 |
-
|
25 |
-
require_once AIHR_DIR_INC . 'class-aihrus-settings.php';
|
26 |
-
|
27 |
-
if ( class_exists( 'Testimonials_Widget_Settings' ) )
|
28 |
-
return;
|
29 |
-
|
30 |
-
|
31 |
-
class Testimonials_Widget_Settings extends Aihrus_Settings {
|
32 |
-
const ID = 'testimonialswidget_settings';
|
33 |
-
const NAME = 'Testimonials Settings';
|
34 |
-
|
35 |
-
public static $admin_page;
|
36 |
-
public static $class = __CLASS__;
|
37 |
-
public static $defaults = array();
|
38 |
-
public static $plugin_assets;
|
39 |
-
public static $plugin_url = 'http://wordpress.org/plugins/testimonials-widget/';
|
40 |
-
public static $sections = array();
|
41 |
-
public static $settings = array();
|
42 |
-
public static $suggest_id = 0;
|
43 |
-
public static $version;
|
44 |
-
|
45 |
-
public static $default = array(
|
46 |
-
'backwards' => array(
|
47 |
-
'version' => null, // below this version number, use std
|
48 |
-
'std' => null,
|
49 |
-
),
|
50 |
-
'choices' => array(), // key => value
|
51 |
-
'class' => null, // warning, etc.
|
52 |
-
'desc' => null,
|
53 |
-
'id' => null,
|
54 |
-
'section' => 'general',
|
55 |
-
'show_code' => true,
|
56 |
-
'std' => null, // default key or value
|
57 |
-
'suggest' => false, // attempt for auto-suggest on inputs
|
58 |
-
'title' => null,
|
59 |
-
'type' => 'text', // textarea, checkbox, radio, select, hidden, heading, password, expand_begin, expand_end
|
60 |
-
'validate' => null, // required, term, slug, slugs, ids, order, single paramater PHP functions
|
61 |
-
'widget' => 1, // show in widget options, 0 off
|
62 |
-
);
|
63 |
-
|
64 |
-
public function __construct() {
|
65 |
-
add_action( 'admin_init', array( __CLASS__, 'admin_init' ) );
|
66 |
-
add_action( 'admin_menu', array( __CLASS__, 'admin_menu' ) );
|
67 |
-
add_action( 'init', array( __CLASS__, 'init' ) );
|
68 |
-
}
|
69 |
-
|
70 |
-
|
71 |
-
public static function admin_init() {
|
72 |
-
add_filter( 'wp_unique_post_slug_is_bad_hierarchical_slug', array( __CLASS__, 'is_bad_hierarchical_slug' ), 10, 4 );
|
73 |
-
add_filter( 'wp_unique_post_slug_is_bad_flat_slug', array( __CLASS__, 'is_bad_flat_slug' ), 10, 3 );
|
74 |
-
|
75 |
-
$version = tw_get_option( 'version' );
|
76 |
-
self::$version = Testimonials_Widget::VERSION;
|
77 |
-
self::$version = apply_filters( 'testimonials_widget_version', self::$version );
|
78 |
-
|
79 |
-
if ( $version != self::$version )
|
80 |
-
self::initialize_settings();
|
81 |
-
|
82 |
-
if ( ! Testimonials_Widget::do_load() )
|
83 |
-
return;
|
84 |
-
|
85 |
-
self::load_options();
|
86 |
-
self::register_settings();
|
87 |
-
}
|
88 |
-
|
89 |
-
|
90 |
-
public static function admin_menu() {
|
91 |
-
self::$admin_page = add_submenu_page( 'edit.php?post_type=' . Testimonials_Widget::PT, esc_html__( 'Testimonials Settings', 'testimonials-widget' ), esc_html__( 'Settings', 'testimonials-widget' ), 'manage_options', self::ID, array( __CLASS__, 'display_page' ) );
|
92 |
-
|
93 |
-
add_action( 'admin_print_scripts-' . self::$admin_page, array( __CLASS__, 'scripts' ) );
|
94 |
-
add_action( 'admin_print_styles-' . self::$admin_page, array( __CLASS__, 'styles' ) );
|
95 |
-
add_action( 'load-' . self::$admin_page, array( __CLASS__, 'settings_add_help_tabs' ) );
|
96 |
-
}
|
97 |
-
|
98 |
-
|
99 |
-
public static function init() {
|
100 |
-
load_plugin_textdomain( 'testimonials-widget', false, '/testimonials-widget/languages/' );
|
101 |
-
|
102 |
-
self::$plugin_assets = Testimonials_Widget::$plugin_assets;
|
103 |
-
}
|
104 |
-
|
105 |
-
|
106 |
-
public static function sections() {
|
107 |
-
self::$sections['general'] = esc_html__( 'General', 'testimonials-widget' );
|
108 |
-
self::$sections['selection'] = esc_html__( 'Selection', 'testimonials-widget' );
|
109 |
-
self::$sections['ordering'] = esc_html__( 'Ordering', 'testimonials-widget' );
|
110 |
-
self::$sections['widget'] = esc_html__( 'Widget', 'testimonials-widget' );
|
111 |
-
self::$sections['post_type'] = esc_html__( 'Post Type', 'testimonials-widget' );
|
112 |
-
self::$sections['columns'] = esc_html__( 'Columns', 'testimonials-widget' );
|
113 |
-
|
114 |
-
parent::sections();
|
115 |
-
|
116 |
-
self::$sections = apply_filters( 'testimonials_widget_sections', self::$sections );
|
117 |
-
}
|
118 |
-
|
119 |
-
|
120 |
-
/**
|
121 |
-
*
|
122 |
-
*
|
123 |
-
* @SuppressWarnings(PHPMD.Superglobals)
|
124 |
-
*/
|
125 |
-
public static function settings() {
|
126 |
-
// Widget
|
127 |
-
self::$settings['title'] = array(
|
128 |
-
'section' => 'widget',
|
129 |
-
'title' => esc_html__( 'Widget Title', 'testimonials-widget' ),
|
130 |
-
'std' => esc_html__( 'Testimonials', 'testimonials-widget' ),
|
131 |
-
'validate' => 'wp_kses_post',
|
132 |
-
);
|
133 |
-
|
134 |
-
self::$settings['title_link'] = array(
|
135 |
-
'section' => 'widget',
|
136 |
-
'title' => esc_html__( 'Title Link', 'testimonials-widget' ),
|
137 |
-
'desc' => esc_html__( 'URL, path, or post ID to link widget title to. Ex: http://example.com/stuff, /testimonials, 123 or ', 'testimonials-widget' ),
|
138 |
-
'validate' => 'wp_kses_data',
|
139 |
-
);
|
140 |
-
|
141 |
-
self::$settings['char_limit'] = array(
|
142 |
-
'section' => 'widget',
|
143 |
-
'title' => esc_html__( 'Character Limit', 'testimonials-widget' ),
|
144 |
-
'desc' => esc_html__( 'Number of characters to limit non-single testimonial views to', 'testimonials-widget' ),
|
145 |
-
'validate' => 'absint',
|
146 |
-
);
|
147 |
-
|
148 |
-
self::$settings['refresh_interval'] = array(
|
149 |
-
'section' => 'widget',
|
150 |
-
'title' => esc_html__( 'Rotation Speed', 'testimonials-widget' ),
|
151 |
-
'desc' => esc_html__( 'Number of seconds between testimonial rotations or 0 for no rotation at all refresh', 'testimonials-widget' ),
|
152 |
-
'std' => 5,
|
153 |
-
'validate' => 'absint',
|
154 |
-
);
|
155 |
-
|
156 |
-
self::$settings['widget_expand_all'] = array(
|
157 |
-
'section' => 'widget',
|
158 |
-
'type' => 'expand_all',
|
159 |
-
);
|
160 |
-
|
161 |
-
self::$settings['widget_expand_begin'] = array(
|
162 |
-
'section' => 'widget',
|
163 |
-
'desc' => esc_html__( 'Additional Widget Options', 'testimonials-widget' ),
|
164 |
-
'type' => 'expand_begin',
|
165 |
-
);
|
166 |
-
|
167 |
-
self::$settings['transition_mode'] = array(
|
168 |
-
'section' => 'widget',
|
169 |
-
'title' => esc_html__( 'Transition Mode?', 'testimonials-widget' ),
|
170 |
-
'desc' => esc_html__( 'Type of transition between slides', 'testimonials-widget' ),
|
171 |
-
'type' => 'select',
|
172 |
-
'choices' => array(
|
173 |
-
'fade' => esc_html__( 'Fade', 'testimonials-widget' ),
|
174 |
-
'horizontal' => esc_html__( 'Horizontal', 'testimonials-widget' ),
|
175 |
-
'vertical' => esc_html__( 'Vertical', 'testimonials-widget' ),
|
176 |
-
),
|
177 |
-
'std' => 'fade',
|
178 |
-
);
|
179 |
-
|
180 |
-
self::$settings['show_start_stop'] = array(
|
181 |
-
'section' => 'widget',
|
182 |
-
'title' => esc_html__( 'Show Play/Pause?', 'testimonials-widget' ),
|
183 |
-
'desc' => esc_html__( 'Display start and stop buttons underneath the testimonial slider.', 'testimonials-widget' ),
|
184 |
-
'type' => 'checkbox',
|
185 |
-
'validate' => 'is_true',
|
186 |
-
'std' => 1,
|
187 |
-
);
|
188 |
-
|
189 |
-
self::$settings['enable_video'] = array(
|
190 |
-
'section' => 'widget',
|
191 |
-
'title' => esc_html__( 'Enable Video?', 'testimonials-widget' ),
|
192 |
-
'desc' => esc_html__( 'Only enable when displaying video content.', 'testimonials-widget' ),
|
193 |
-
'type' => 'checkbox',
|
194 |
-
'validate' => 'is_true',
|
195 |
-
);
|
196 |
-
|
197 |
-
self::$settings['keep_whitespace'] = array(
|
198 |
-
'section' => 'widget',
|
199 |
-
'title' => esc_html__( 'Keep Whitespace?', 'testimonials-widget' ),
|
200 |
-
'desc' => esc_html__( 'Keeps testimonials looking as entered than sans auto-formatting', 'testimonials-widget' ),
|
201 |
-
'type' => 'checkbox',
|
202 |
-
'validate' => 'is_true',
|
203 |
-
);
|
204 |
-
|
205 |
-
self::$settings['bottom_text'] = array(
|
206 |
-
'section' => 'widget',
|
207 |
-
'title' => esc_html__( 'Testimonial Bottom Text', 'testimonials-widget' ),
|
208 |
-
'desc' => esc_html__( 'Custom text or HTML for bottom of testimonials', 'testimonials-widget' ),
|
209 |
-
'type' => 'textarea',
|
210 |
-
'validate' => 'wp_kses_post',
|
211 |
-
);
|
212 |
-
|
213 |
-
self::$settings['widget_expand_end'] = array(
|
214 |
-
'section' => 'widget',
|
215 |
-
'type' => 'expand_end',
|
216 |
-
);
|
217 |
-
|
218 |
-
// General
|
219 |
-
self::$settings['general_expand_begin'] = array(
|
220 |
-
'desc' => esc_html__( 'General Options', 'testimonials-widget' ),
|
221 |
-
'type' => 'expand_begin',
|
222 |
-
);
|
223 |
-
|
224 |
-
self::$settings['exclude_bxslider_css'] = array(
|
225 |
-
'title' => esc_html__( 'Exclude bxSlider CSS?', 'testimonials-widget' ),
|
226 |
-
'desc' => esc_html__( 'For a bare-bones, unthemed slider.', 'testimonials-widget' ),
|
227 |
-
'type' => 'checkbox',
|
228 |
-
'validate' => 'is_true',
|
229 |
-
'widget' => 0,
|
230 |
-
);
|
231 |
-
|
232 |
-
self::$settings['include_ie7_css'] = array(
|
233 |
-
'title' => esc_html__( 'Include IE7 CSS?', 'testimonials-widget' ),
|
234 |
-
'type' => 'checkbox',
|
235 |
-
'validate' => 'is_true',
|
236 |
-
'widget' => 0,
|
237 |
-
);
|
238 |
-
|
239 |
-
self::$settings['disable_quotes'] = array(
|
240 |
-
'title' => esc_html__( 'Hide built-in quotes?', 'testimonials-widget' ),
|
241 |
-
'desc' => esc_html__( 'Remove open and close quote span tags surrounding testimonial content', 'testimonials-widget' ),
|
242 |
-
'type' => 'checkbox',
|
243 |
-
'validate' => 'is_true',
|
244 |
-
);
|
245 |
-
|
246 |
-
self::$settings['remove_hentry'] = array(
|
247 |
-
'title' => esc_html__( 'Remove `.hentry` CSS?', 'testimonials-widget' ),
|
248 |
-
'desc' => esc_html__( 'Some themes use class `.hentry` in a manner that breaks Testimonials\' CSS', 'testimonials-widget' ),
|
249 |
-
'type' => 'checkbox',
|
250 |
-
'validate' => 'is_true',
|
251 |
-
'std' => 1,
|
252 |
-
);
|
253 |
-
|
254 |
-
self::$settings['use_quote_tag'] = array(
|
255 |
-
'title' => esc_html__( 'Use `<q>` tag?', 'testimonials-widget' ),
|
256 |
-
'desc' => esc_html__( 'Not HTML5 compliant', 'testimonials-widget' ),
|
257 |
-
'type' => 'checkbox',
|
258 |
-
'validate' => 'is_true',
|
259 |
-
);
|
260 |
-
|
261 |
-
self::$settings['general_heading_fields'] = array(
|
262 |
-
'desc' => esc_html__( 'Fields to Show', 'testimonials-widget' ),
|
263 |
-
'type' => 'heading',
|
264 |
-
);
|
265 |
-
|
266 |
-
self::$settings['hide_gravatar'] = array(
|
267 |
-
'title' => esc_html__( 'Hide Gravatar Image?', 'testimonials-widget' ),
|
268 |
-
'type' => 'checkbox',
|
269 |
-
'validate' => 'is_true',
|
270 |
-
);
|
271 |
-
|
272 |
-
self::$settings['hide_image'] = array(
|
273 |
-
'title' => esc_html__( 'Hide Image?', 'testimonials-widget' ),
|
274 |
-
'type' => 'checkbox',
|
275 |
-
'validate' => 'is_true',
|
276 |
-
);
|
277 |
-
|
278 |
-
self::$settings['hide_image_single'] = array(
|
279 |
-
'title' => esc_html__( 'Hide Image in Single View?', 'testimonials-widget' ),
|
280 |
-
'type' => 'checkbox',
|
281 |
-
'validate' => 'is_true',
|
282 |
-
'widget' => 0,
|
283 |
-
);
|
284 |
-
|
285 |
-
self::$settings['hide_content'] = array(
|
286 |
-
'title' => esc_html__( 'Hide Testimonial Content?', 'testimonials-widget' ),
|
287 |
-
'type' => 'checkbox',
|
288 |
-
'validate' => 'is_true',
|
289 |
-
);
|
290 |
-
|
291 |
-
self::$settings['hide_source'] = array(
|
292 |
-
'title' => esc_html__( 'Hide Author/Source?', 'testimonials-widget' ),
|
293 |
-
'type' => 'checkbox',
|
294 |
-
'validate' => 'is_true',
|
295 |
-
'desc' => esc_html__( 'Don\'t display "Post Title" in cite', 'testimonials-widget' ),
|
296 |
-
);
|
297 |
-
|
298 |
-
self::$settings['hide_email'] = array(
|
299 |
-
'title' => esc_html__( 'Hide Email?', 'testimonials-widget' ),
|
300 |
-
'type' => 'checkbox',
|
301 |
-
'validate' => 'is_true',
|
302 |
-
'std' => 1,
|
303 |
-
);
|
304 |
-
|
305 |
-
self::$settings['hide_title'] = array(
|
306 |
-
'title' => esc_html__( 'Hide Job Title?', 'testimonials-widget' ),
|
307 |
-
'type' => 'checkbox',
|
308 |
-
'validate' => 'is_true',
|
309 |
-
);
|
310 |
-
|
311 |
-
self::$settings['hide_location'] = array(
|
312 |
-
'title' => esc_html__( 'Hide Location?', 'testimonials-widget' ),
|
313 |
-
'type' => 'checkbox',
|
314 |
-
'validate' => 'is_true',
|
315 |
-
);
|
316 |
-
|
317 |
-
self::$settings['hide_company'] = array(
|
318 |
-
'title' => esc_html__( 'Hide Company?', 'testimonials-widget' ),
|
319 |
-
'type' => 'checkbox',
|
320 |
-
'validate' => 'is_true',
|
321 |
-
);
|
322 |
-
|
323 |
-
self::$settings['hide_url'] = array(
|
324 |
-
'title' => esc_html__( 'Hide URL?', 'testimonials-widget' ),
|
325 |
-
'type' => 'checkbox',
|
326 |
-
'validate' => 'is_true',
|
327 |
-
);
|
328 |
-
|
329 |
-
self::$settings['general_heading_misc'] = array(
|
330 |
-
'desc' => esc_html__( 'Miscellanious', 'testimonials-widget' ),
|
331 |
-
'type' => 'heading',
|
332 |
-
);
|
333 |
-
|
334 |
-
self::$settings['item_reviewed'] = array(
|
335 |
-
'title' => esc_html__( 'Default Reviewed Item?', 'testimonials-widget' ),
|
336 |
-
'desc' => esc_html__( 'Name of thing being referenced in testimonials', 'testimonials-widget' ),
|
337 |
-
'std' => get_option( 'blogname' ),
|
338 |
-
'widget' => 0,
|
339 |
-
);
|
340 |
-
|
341 |
-
self::$settings['item_reviewed_url'] = array(
|
342 |
-
'title' => esc_html__( 'Default Reviewed Item URL?', 'testimonials-widget' ),
|
343 |
-
'desc' => esc_html__( 'URL of thing being referenced in testimonials', 'testimonials-widget' ),
|
344 |
-
'std' => network_site_url(),
|
345 |
-
'validate' => 'url',
|
346 |
-
'widget' => 0,
|
347 |
-
);
|
348 |
-
|
349 |
-
self::$settings['paging'] = array(
|
350 |
-
'title' => esc_html__( 'Enable Paging?', 'testimonials-widget' ),
|
351 |
-
'desc' => esc_html__( 'For `[testimonials]`', 'testimonials-widget' ),
|
352 |
-
'type' => 'select',
|
353 |
-
'choices' => array(
|
354 |
-
'' => esc_html__( 'Disable', 'testimonials-widget' ),
|
355 |
-
1 => esc_html__( 'Enable', 'testimonials-widget' ),
|
356 |
-
'before' => esc_html__( 'Before testimonials', 'testimonials-widget' ),
|
357 |
-
'after' => esc_html__( 'After testimonials', 'testimonials-widget' ),
|
358 |
-
),
|
359 |
-
'std' => 1,
|
360 |
-
'widget' => 0,
|
361 |
-
);
|
362 |
-
|
363 |
-
$desc = __( 'Adds HTML tag markup per the <a href="%s">Review schema</a> to testimonials. Search engines including Bing, Google, Yahoo! and Yandex rely on this markup to improve the display of search results.', 'testimonials-widget' );
|
364 |
-
|
365 |
-
self::$settings['enable_schema'] = array(
|
366 |
-
'title' => esc_html__( 'Enable Review Schema?', 'testimonials-widget' ),
|
367 |
-
'desc' => sprintf( $desc, 'http://schema.org/Review' ),
|
368 |
-
'type' => 'checkbox',
|
369 |
-
'validate' => 'is_true',
|
370 |
-
'std' => 1,
|
371 |
-
);
|
372 |
-
|
373 |
-
self::$settings['do_shortcode'] = array(
|
374 |
-
'title' => esc_html__( 'Enable [shortcodes]?', 'testimonials-widget' ),
|
375 |
-
'desc' => esc_html__( 'If unchecked, shortcodes are stripped.', 'testimonials-widget' ),
|
376 |
-
'type' => 'checkbox',
|
377 |
-
'validate' => 'is_true',
|
378 |
-
'std' => 1,
|
379 |
-
);
|
380 |
-
|
381 |
-
self::$settings['hide_not_found'] = array(
|
382 |
-
'title' => esc_html__( 'Hide "Testimonials Not Found"?', 'testimonials-widget' ),
|
383 |
-
'type' => 'checkbox',
|
384 |
-
'validate' => 'is_true',
|
385 |
-
);
|
386 |
-
|
387 |
-
self::$settings['target'] = array(
|
388 |
-
'title' => esc_html__( 'URL Target', 'testimonials-widget' ),
|
389 |
-
'desc' => esc_html__( 'Add target to all URLs; leave blank if none', 'testimonials-widget' ),
|
390 |
-
'validate' => 'term',
|
391 |
-
);
|
392 |
-
|
393 |
-
self::$settings['general_expand_end'] = array(
|
394 |
-
'type' => 'expand_end',
|
395 |
-
);
|
396 |
-
|
397 |
-
// Selection
|
398 |
-
self::$settings['selection_expand_begin'] = array(
|
399 |
-
'section' => 'selection',
|
400 |
-
'desc' => esc_html__( 'Selection Options', 'testimonials-widget' ),
|
401 |
-
'type' => 'expand_begin',
|
402 |
-
);
|
403 |
-
|
404 |
-
self::$settings['category'] = array(
|
405 |
-
'section' => 'selection',
|
406 |
-
'title' => esc_html__( 'Category Filter', 'testimonials-widget' ),
|
407 |
-
'desc' => esc_html__( 'Comma separated category names. Ex: Category A, Another category', 'testimonials-widget' ),
|
408 |
-
'validate' => 'terms',
|
409 |
-
'suggest' => true,
|
410 |
-
);
|
411 |
-
|
412 |
-
self::$settings['tags'] = array(
|
413 |
-
'section' => 'selection',
|
414 |
-
'title' => esc_html__( 'Tags Filter', 'testimonials-widget' ),
|
415 |
-
'desc' => esc_html__( 'Comma separated tag names. Ex: Tag A, Another tag', 'testimonials-widget' ),
|
416 |
-
'validate' => 'terms',
|
417 |
-
'suggest' => true,
|
418 |
-
);
|
419 |
-
|
420 |
-
self::$settings['tags_all'] = array(
|
421 |
-
'section' => 'selection',
|
422 |
-
'title' => esc_html__( 'Require All Tags?', 'testimonials-widget' ),
|
423 |
-
'desc' => esc_html__( 'Select only testimonials with all of the given tags', 'testimonials-widget' ),
|
424 |
-
'type' => 'checkbox',
|
425 |
-
'validate' => 'is_true',
|
426 |
-
);
|
427 |
-
|
428 |
-
self::$settings['ids'] = array(
|
429 |
-
'section' => 'selection',
|
430 |
-
'title' => esc_html__( 'Include IDs Filter', 'testimonials-widget' ),
|
431 |
-
'desc' => esc_html__( 'Comma separated testimonial IDs. Ex: 3,1,2', 'testimonials-widget' ),
|
432 |
-
'validate' => 'ids',
|
433 |
-
);
|
434 |
-
|
435 |
-
self::$settings['exclude'] = array(
|
436 |
-
'section' => 'selection',
|
437 |
-
'title' => esc_html__( 'Exclude IDs Filter', 'testimonials-widget' ),
|
438 |
-
'desc' => esc_html__( 'Comma separated testimonial IDs. Ex: 3,1,2', 'testimonials-widget' ),
|
439 |
-
'validate' => 'ids',
|
440 |
-
);
|
441 |
-
|
442 |
-
self::$settings['limit'] = array(
|
443 |
-
'section' => 'selection',
|
444 |
-
'title' => esc_html__( 'Limit', 'testimonials-widget' ),
|
445 |
-
'desc' => esc_html__( 'Number of testimonials to select per instance', 'testimonials-widget' ),
|
446 |
-
'std' => 10,
|
447 |
-
'validate' => 'nozero',
|
448 |
-
);
|
449 |
-
|
450 |
-
self::$settings['selection_expand_end'] = array(
|
451 |
-
'section' => 'selection',
|
452 |
-
'type' => 'expand_end',
|
453 |
-
);
|
454 |
-
|
455 |
-
// Ordering
|
456 |
-
self::$settings['ordering_expand_begin'] = array(
|
457 |
-
'section' => 'ordering',
|
458 |
-
'desc' => esc_html__( 'Ordering Options', 'testimonials-widget' ),
|
459 |
-
'type' => 'expand_begin',
|
460 |
-
);
|
461 |
-
|
462 |
-
self::$settings['random'] = array(
|
463 |
-
'section' => 'ordering',
|
464 |
-
'title' => esc_html__( 'Random Order?', 'testimonials-widget' ),
|
465 |
-
'desc' => esc_html__( 'If checked, ignores ORDER BY, ORDER BY meta_key, and ORDER BY Order. Widgets are random by default automatically', 'testimonials-widget' ),
|
466 |
-
'type' => 'checkbox',
|
467 |
-
'validate' => 'is_true',
|
468 |
-
);
|
469 |
-
|
470 |
-
self::$settings['orderby'] = array(
|
471 |
-
'section' => 'ordering',
|
472 |
-
'title' => esc_html__( 'ORDER BY', 'testimonials-widget' ),
|
473 |
-
'desc' => esc_html__( 'Used when "Random Order" is disabled', 'testimonials-widget' ),
|
474 |
-
'type' => 'select',
|
475 |
-
'choices' => array(
|
476 |
-
'ID' => esc_html__( 'Testimonial ID', 'testimonials-widget' ),
|
477 |
-
'author' => esc_html__( 'Author', 'testimonials-widget' ),
|
478 |
-
'date' => esc_html__( 'Date', 'testimonials-widget' ),
|
479 |
-
'menu_order' => esc_html__( 'Menu Order', 'testimonials-widget' ),
|
480 |
-
'title' => esc_html__( 'Source', 'testimonials-widget' ),
|
481 |
-
'none' => esc_html__( 'No order', 'testimonials-widget' ),
|
482 |
-
),
|
483 |
-
'std' => 'ID',
|
484 |
-
'validate' => 'term',
|
485 |
-
);
|
486 |
-
|
487 |
-
self::$settings['meta_key'] = array(
|
488 |
-
'section' => 'ordering',
|
489 |
-
'title' => esc_html__( 'ORDER BY meta_key', 'testimonials-widget' ),
|
490 |
-
'desc' => esc_html__( 'Used when "Random Order" is disabled and sorting by a testimonials meta key is needed. Overrides ORDER BY', 'testimonials-widget' ),
|
491 |
-
'type' => 'select',
|
492 |
-
'choices' => array(
|
493 |
-
'' => esc_html__( 'None', 'testimonials-widget' ),
|
494 |
-
'testimonials-widget-title' => esc_html__( 'Job Title', 'testimonials-widget' ),
|
495 |
-
'testimonials-widget-email' => esc_html__( 'Email', 'testimonials-widget' ),
|
496 |
-
'testimonials-widget-location' => esc_html__( 'Location', 'testimonials-widget' ),
|
497 |
-
'testimonials-widget-company' => esc_html__( 'Company', 'testimonials-widget' ),
|
498 |
-
'testimonials-widget-url' => esc_html__( 'URL', 'testimonials-widget' ),
|
499 |
-
),
|
500 |
-
'validate' => 'slug',
|
501 |
-
);
|
502 |
-
|
503 |
-
self::$settings['order'] = array(
|
504 |
-
'section' => 'ordering',
|
505 |
-
'title' => esc_html__( 'ORDER BY Order', 'testimonials-widget' ),
|
506 |
-
'type' => 'select',
|
507 |
-
'choices' => array(
|
508 |
-
'DESC' => esc_html__( 'Descending', 'testimonials-widget' ),
|
509 |
-
'ASC' => esc_html__( 'Ascending', 'testimonials-widget' ),
|
510 |
-
),
|
511 |
-
'std' => 'DESC',
|
512 |
-
'validate' => 'order',
|
513 |
-
);
|
514 |
-
|
515 |
-
self::$settings['ordering_expand_end'] = array(
|
516 |
-
'section' => 'ordering',
|
517 |
-
'type' => 'expand_end',
|
518 |
-
);
|
519 |
-
|
520 |
-
// Post Type
|
521 |
-
self::$settings['allow_comments'] = array(
|
522 |
-
'section' => 'post_type',
|
523 |
-
'title' => esc_html__( 'Allow Comments?', 'testimonials-widget' ),
|
524 |
-
'desc' => esc_html__( 'Only affects the Testimonials post edit page. Your theme controls the front-end view.', 'testimonials-widget' ),
|
525 |
-
'type' => 'checkbox',
|
526 |
-
'validate' => 'is_true',
|
527 |
-
'widget' => 0,
|
528 |
-
);
|
529 |
-
|
530 |
-
$desc = __( 'URL slug-name for <a href="%1s">testimonials archive</a> page.', 'testimonials-widget' );
|
531 |
-
$has_archive = tw_get_option( 'has_archive', '' );
|
532 |
-
$site_url = network_site_url( '/' . $has_archive . '/' );
|
533 |
-
|
534 |
-
self::$settings['has_archive'] = array(
|
535 |
-
'section' => 'post_type',
|
536 |
-
'title' => esc_html__( 'Archive Page URL', 'testimonials-widget' ),
|
537 |
-
'desc' => sprintf( $desc, $site_url ),
|
538 |
-
'std' => 'testimonials-archive',
|
539 |
-
'validate' => 'slash_sanitize_title',
|
540 |
-
'widget' => 0,
|
541 |
-
);
|
542 |
-
|
543 |
-
$desc = esc_html__( 'URL slug-name for testimonial view pages. Shouldn\'t be the same as the Archive Page URL nor should it match a page URL slug.', 'testimonials-widget' );
|
544 |
-
|
545 |
-
self::$settings['rewrite_slug'] = array(
|
546 |
-
'section' => 'post_type',
|
547 |
-
'title' => esc_html__( 'Testimonial Page URL', 'testimonials-widget' ),
|
548 |
-
'desc' => $desc,
|
549 |
-
'std' => 'testimonial',
|
550 |
-
'validate' => 'slash_sanitize_title',
|
551 |
-
'widget' => 0,
|
552 |
-
);
|
553 |
-
|
554 |
-
// Columns
|
555 |
-
self::$settings['columns_id'] = array(
|
556 |
-
'section' => 'columns',
|
557 |
-
'title' => esc_html__( 'Hide ID?', 'testimonials-widget' ),
|
558 |
-
'type' => 'checkbox',
|
559 |
-
'validate' => 'is_true',
|
560 |
-
'std' => 1,
|
561 |
-
'widget' => 0,
|
562 |
-
);
|
563 |
-
|
564 |
-
self::$settings['columns_thumbnail'] = array(
|
565 |
-
'section' => 'columns',
|
566 |
-
'title' => esc_html__( 'Hide Image?', 'testimonials-widget' ),
|
567 |
-
'type' => 'checkbox',
|
568 |
-
'validate' => 'is_true',
|
569 |
-
'widget' => 0,
|
570 |
-
);
|
571 |
-
|
572 |
-
self::$settings['columns_shortcode'] = array(
|
573 |
-
'section' => 'columns',
|
574 |
-
'title' => esc_html__( 'Hide Shortcode?', 'testimonials-widget' ),
|
575 |
-
'type' => 'checkbox',
|
576 |
-
'validate' => 'is_true',
|
577 |
-
'widget' => 0,
|
578 |
-
);
|
579 |
-
|
580 |
-
self::$settings['columns_job_title'] = array(
|
581 |
-
'section' => 'columns',
|
582 |
-
'title' => esc_html__( 'Hide Job Title?', 'testimonials-widget' ),
|
583 |
-
'type' => 'checkbox',
|
584 |
-
'validate' => 'is_true',
|
585 |
-
'std' => 1,
|
586 |
-
'widget' => 0,
|
587 |
-
);
|
588 |
-
|
589 |
-
self::$settings['columns_location'] = array(
|
590 |
-
'section' => 'columns',
|
591 |
-
'title' => esc_html__( 'Hide Location?', 'testimonials-widget' ),
|
592 |
-
'type' => 'checkbox',
|
593 |
-
'validate' => 'is_true',
|
594 |
-
'std' => 1,
|
595 |
-
'widget' => 0,
|
596 |
-
);
|
597 |
-
|
598 |
-
self::$settings['columns_email'] = array(
|
599 |
-
'section' => 'columns',
|
600 |
-
'title' => esc_html__( 'Hide Email?', 'testimonials-widget' ),
|
601 |
-
'type' => 'checkbox',
|
602 |
-
'validate' => 'is_true',
|
603 |
-
'std' => 1,
|
604 |
-
'widget' => 0,
|
605 |
-
);
|
606 |
-
|
607 |
-
self::$settings['columns_company'] = array(
|
608 |
-
'section' => 'columns',
|
609 |
-
'title' => esc_html__( 'Hide Company?', 'testimonials-widget' ),
|
610 |
-
'type' => 'checkbox',
|
611 |
-
'validate' => 'is_true',
|
612 |
-
'std' => 1,
|
613 |
-
'widget' => 0,
|
614 |
-
);
|
615 |
-
|
616 |
-
self::$settings['columns_url'] = array(
|
617 |
-
'section' => 'columns',
|
618 |
-
'title' => esc_html__( 'Hide URL?', 'testimonials-widget' ),
|
619 |
-
'type' => 'checkbox',
|
620 |
-
'validate' => 'is_true',
|
621 |
-
'std' => 1,
|
622 |
-
'widget' => 0,
|
623 |
-
);
|
624 |
-
|
625 |
-
// Reset
|
626 |
-
self::$settings['reset_expand_begin'] = array(
|
627 |
-
'section' => 'reset',
|
628 |
-
'desc' => esc_html__( 'Reset & Compatiblity Options', 'testimonials-widget' ),
|
629 |
-
'type' => 'expand_begin',
|
630 |
-
);
|
631 |
-
|
632 |
-
self::$settings['use_cpt_taxonomy'] = array(
|
633 |
-
'section' => 'reset',
|
634 |
-
'title' => esc_html__( 'Don\'t Use Default Taxonomies?', 'testimonials-widget' ),
|
635 |
-
'type' => 'checkbox',
|
636 |
-
'validate' => 'is_true',
|
637 |
-
'desc' => esc_html__( 'If checked, use Testimonials\' own category and tag taxonomies instead', 'testimonials-widget' ),
|
638 |
-
'widget' => 0,
|
639 |
-
);
|
640 |
-
|
641 |
-
parent::settings();
|
642 |
-
|
643 |
-
self::$settings['version_options_heading'] = array(
|
644 |
-
'section' => 'reset',
|
645 |
-
'desc' => esc_html__( 'Version Based Options', 'testimonials-widget' ),
|
646 |
-
'type' => 'heading',
|
647 |
-
);
|
648 |
-
|
649 |
-
self::$settings['use_bxslider'] = array(
|
650 |
-
'section' => 'reset',
|
651 |
-
'title' => esc_html__( 'Use bxSlider?', 'testimonials-widget' ),
|
652 |
-
'desc' => esc_html__( 'Pre 2.15.0, Testimonials\' used custom JavaScript for transitions.', 'testimonials-widget' ),
|
653 |
-
'type' => 'checkbox',
|
654 |
-
'validate' => 'is_true',
|
655 |
-
'backwards' => array(
|
656 |
-
'version' => '2.15.0',
|
657 |
-
'std' => 0,
|
658 |
-
),
|
659 |
-
'std' => 1,
|
660 |
-
'widget' => 0,
|
661 |
-
);
|
662 |
-
|
663 |
-
self::$settings['disable_animation'] = array(
|
664 |
-
'section' => 'reset',
|
665 |
-
'title' => esc_html__( 'Disable Animation?', 'testimonials-widget' ),
|
666 |
-
'desc' => esc_html__( 'Pre 2.15.0, Disable animation between testimonial transitions. Useful when stacking widgets.', 'testimonials-widget' ),
|
667 |
-
'type' => 'checkbox',
|
668 |
-
'validate' => 'is_true',
|
669 |
-
'std' => 1,
|
670 |
-
);
|
671 |
-
|
672 |
-
self::$settings['fade_out_speed'] = array(
|
673 |
-
'section' => 'reset',
|
674 |
-
'title' => esc_html__( 'Fade Out Speed', 'testimonials-widget' ),
|
675 |
-
'desc' => esc_html__( 'Pre 2.15.0, Transition duration in milliseconds; higher values indicate slower animations, not faster ones.', 'testimonials-widget' ),
|
676 |
-
'std' => 1250,
|
677 |
-
'validate' => 'absint',
|
678 |
-
);
|
679 |
-
|
680 |
-
self::$settings['fade_in_speed'] = array(
|
681 |
-
'section' => 'reset',
|
682 |
-
'title' => esc_html__( 'Fade In Speed', 'testimonials-widget' ),
|
683 |
-
'desc' => esc_html__( 'Pre 2.15.0, Transition duration in milliseconds; higher values indicate slower animations, not faster ones.', 'testimonials-widget' ),
|
684 |
-
'std' => 500,
|
685 |
-
'validate' => 'absint',
|
686 |
-
);
|
687 |
-
|
688 |
-
self::$settings['height'] = array(
|
689 |
-
'section' => 'reset',
|
690 |
-
'title' => esc_html__( 'Height', 'testimonials-widget' ),
|
691 |
-
'desc' => esc_html__( 'Pre 2.15.0, Testimonials height, in pixels. Overrides minimum and maximum height', 'testimonials-widget' ),
|
692 |
-
'validate' => 'min1',
|
693 |
-
);
|
694 |
-
|
695 |
-
self::$settings['min_height'] = array(
|
696 |
-
'section' => 'reset',
|
697 |
-
'title' => esc_html__( 'Minimum Height', 'testimonials-widget' ),
|
698 |
-
'desc' => esc_html__( 'Pre 2.15.0, Set for minimum display height, in pixels', 'testimonials-widget' ),
|
699 |
-
'validate' => 'min1',
|
700 |
-
);
|
701 |
-
|
702 |
-
self::$settings['max_height'] = array(
|
703 |
-
'section' => 'reset',
|
704 |
-
'title' => esc_html__( 'Maximum Height', 'testimonials-widget' ),
|
705 |
-
'desc' => esc_html__( 'Pre 2.15.0, Set for maximum display height, in pixels', 'testimonials-widget' ),
|
706 |
-
'validate' => 'min1',
|
707 |
-
);
|
708 |
-
|
709 |
-
self::$settings['reset_expand_end'] = array(
|
710 |
-
'section' => 'reset',
|
711 |
-
'type' => 'expand_end',
|
712 |
-
);
|
713 |
-
|
714 |
-
self::$settings = apply_filters( 'testimonials_widget_settings', self::$settings );
|
715 |
-
|
716 |
-
foreach ( self::$settings as $id => $parts )
|
717 |
-
self::$settings[ $id ] = wp_parse_args( $parts, self::$default );
|
718 |
-
}
|
719 |
-
|
720 |
-
|
721 |
-
public static function get_defaults( $mode = null, $old_version = null ) {
|
722 |
-
$old_version = tw_get_option( 'version' );
|
723 |
-
|
724 |
-
$defaults = parent::get_defaults( $mode, $old_version );
|
725 |
-
$defaults = apply_filters( 'testimonials_widget_settings_defaults', $defaults );
|
726 |
-
|
727 |
-
return $defaults;
|
728 |
-
}
|
729 |
-
|
730 |
-
|
731 |
-
public static function display_page( $disable_donate = false ) {
|
732 |
-
$disable_donate = tw_get_option( 'disable_donate' );
|
733 |
-
|
734 |
-
parent::display_page( $disable_donate );
|
735 |
-
}
|
736 |
-
|
737 |
-
|
738 |
-
/**
|
739 |
-
*
|
740 |
-
*
|
741 |
-
* @SuppressWarnings(PHPMD.UnusedLocalVariable)
|
742 |
-
*/
|
743 |
-
public static function display_setting( $args = array(), $do_echo = true, $input = null ) {
|
744 |
-
$content = '';
|
745 |
-
switch ( $args['type'] ) {
|
746 |
-
case 'text':
|
747 |
-
extract( $args );
|
748 |
-
|
749 |
-
if ( is_null( $input ) )
|
750 |
-
$options = get_option( self::ID );
|
751 |
-
else {
|
752 |
-
$options = array();
|
753 |
-
$options[$id] = $input;
|
754 |
-
}
|
755 |
-
|
756 |
-
if ( ! isset( $options[$id] ) )
|
757 |
-
$options[$id] = $std;
|
758 |
-
|
759 |
-
$field_class = '';
|
760 |
-
if ( ! empty( $class ) )
|
761 |
-
$field_class = ' ' . $class;
|
762 |
-
|
763 |
-
$field_class = esc_attr( $field_class );
|
764 |
-
|
765 |
-
$suggest_id = 'suggest_' . self::$suggest_id++;
|
766 |
-
|
767 |
-
$content .= '<input class="regular-text' . $field_class . ' ' . $suggest_id . '" type="text" id="' . $id . '" name="' . self::ID . '[' . $id . ']" placeholder="' . $std . '" value="' . $options[$id] . '" />';
|
768 |
-
|
769 |
-
if ( ! empty( $suggest ) )
|
770 |
-
$content .= self::get_suggest( $id, $suggest_id );
|
771 |
-
|
772 |
-
if ( ! empty( $desc ) )
|
773 |
-
$content .= '<br /><span class="description">' . $desc . '</span>';
|
774 |
-
|
775 |
-
if ( $show_code )
|
776 |
-
$content .= '<br /><code>' . $id . '</code>';
|
777 |
-
break;
|
778 |
-
|
779 |
-
default:
|
780 |
-
$content = apply_filters( 'testimonials_widget_display_setting', $content, $args, $input );
|
781 |
-
break;
|
782 |
-
}
|
783 |
-
|
784 |
-
if ( empty( $content ) )
|
785 |
-
$content = parent::display_setting( $args, false, $input );
|
786 |
-
|
787 |
-
if ( ! $do_echo )
|
788 |
-
return $content;
|
789 |
-
|
790 |
-
echo $content;
|
791 |
-
}
|
792 |
-
|
793 |
-
|
794 |
-
public static function initialize_settings( $version = null ) {
|
795 |
-
$version = tw_get_option( 'version', self::$version );
|
796 |
-
|
797 |
-
parent::initialize_settings( $version );
|
798 |
-
}
|
799 |
-
|
800 |
-
|
801 |
-
/**
|
802 |
-
*
|
803 |
-
*
|
804 |
-
* @SuppressWarnings(PHPMD.Superglobals)
|
805 |
-
*/
|
806 |
-
public static function validate_settings( $input, $options = null, $do_errors = false ) {
|
807 |
-
$validated = parent::validate_settings( $input, $options, $do_errors );
|
808 |
-
|
809 |
-
if ( empty( $do_errors ) ) {
|
810 |
-
$input = $validated;
|
811 |
-
$errors = array();
|
812 |
-
} else {
|
813 |
-
$input = $validated['input'];
|
814 |
-
$errors = $validated['errors'];
|
815 |
-
}
|
816 |
-
|
817 |
-
$defaults = self::get_defaults();
|
818 |
-
|
819 |
-
if ( ! empty( $input['has_archive'] ) )
|
820 |
-
$input['has_archive'] = self::prevent_slug_conflict( $input['has_archive'] );
|
821 |
-
else
|
822 |
-
$input['has_archive'] = $defaults['has_archive'];
|
823 |
-
|
824 |
-
if ( ! empty( $input['rewrite_slug'] ) )
|
825 |
-
$input['rewrite_slug'] = self::prevent_slug_conflict( $input['rewrite_slug'] );
|
826 |
-
else
|
827 |
-
$input['rewrite_slug'] = $defaults['rewrite_slug'];
|
828 |
-
|
829 |
-
$flush_rewrite_rules = false;
|
830 |
-
// same has_archive and rewrite_slug causes problems
|
831 |
-
if ( $input['has_archive'] == $input['rewrite_slug'] ) {
|
832 |
-
$input['has_archive'] = $defaults['has_archive'];
|
833 |
-
$input['rewrite_slug'] = $defaults['rewrite_slug'];
|
834 |
-
|
835 |
-
$flush_rewrite_rules = true;
|
836 |
-
}
|
837 |
-
|
838 |
-
// did URL slugs change?
|
839 |
-
$has_archive = tw_get_option( 'has_archive' );
|
840 |
-
$rewrite_slug = tw_get_option( 'rewrite_slug' );
|
841 |
-
if ( $has_archive != $input['has_archive'] || $rewrite_slug != $input['rewrite_slug'] )
|
842 |
-
$flush_rewrite_rules = true;
|
843 |
-
|
844 |
-
if ( $flush_rewrite_rules )
|
845 |
-
flush_rewrite_rules();
|
846 |
-
|
847 |
-
$input['version'] = self::$version;
|
848 |
-
$input['donate_version'] = Testimonials_Widget::VERSION;
|
849 |
-
|
850 |
-
$input = apply_filters( 'testimonials_widget_validate_settings', $input, $errors );
|
851 |
-
if ( empty( $do_errors ) )
|
852 |
-
$validated = $input;
|
853 |
-
else {
|
854 |
-
$validated = array(
|
855 |
-
'input' => $input,
|
856 |
-
'errors' => $errors,
|
857 |
-
);
|
858 |
-
}
|
859 |
-
|
860 |
-
return $validated;
|
861 |
-
}
|
862 |
-
|
863 |
-
|
864 |
-
public static function prevent_slug_conflict( $slug ) {
|
865 |
-
global $wpdb;
|
866 |
-
|
867 |
-
// slugs must be unique within their own trees
|
868 |
-
$check_sql = "SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND post_parent = 0 LIMIT 1";
|
869 |
-
$slug_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $slug ) );
|
870 |
-
|
871 |
-
if ( $slug_check ) {
|
872 |
-
$suffix = 2;
|
873 |
-
do {
|
874 |
-
$alt_slug = _truncate_post_slug( $slug, 200 - ( strlen( $suffix ) + 1 ) ) . "-$suffix";
|
875 |
-
$slug_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $alt_slug ) );
|
876 |
-
$suffix++;
|
877 |
-
} while ( $slug_check );
|
878 |
-
|
879 |
-
$slug = $alt_slug;
|
880 |
-
}
|
881 |
-
|
882 |
-
return $slug;
|
883 |
-
}
|
884 |
-
|
885 |
-
|
886 |
-
/**
|
887 |
-
*
|
888 |
-
*
|
889 |
-
* @SuppressWarnings(PHPMD.LongVariable)
|
890 |
-
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
891 |
-
*/
|
892 |
-
public static function is_bad_hierarchical_slug( $is_bad_hierarchical_slug, $slug, $post_type, $post_parent ) {
|
893 |
-
// This post has no parent and is a "base" post
|
894 |
-
if ( ! $post_parent && self::is_cpt_slug( $slug ) )
|
895 |
-
return true;
|
896 |
-
|
897 |
-
return $is_bad_hierarchical_slug;
|
898 |
-
}
|
899 |
-
|
900 |
-
|
901 |
-
/**
|
902 |
-
*
|
903 |
-
*
|
904 |
-
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
905 |
-
*/
|
906 |
-
public static function is_bad_flat_slug( $is_bad_flat_slug, $slug, $post_type ) {
|
907 |
-
if ( self::is_cpt_slug( $slug ) )
|
908 |
-
return true;
|
909 |
-
|
910 |
-
return $is_bad_flat_slug;
|
911 |
-
}
|
912 |
-
|
913 |
-
|
914 |
-
public static function is_cpt_slug( $slug ) {
|
915 |
-
$has_archive = tw_get_option( 'has_archive' );
|
916 |
-
$rewrite_slug = tw_get_option( 'rewrite_slug' );
|
917 |
-
|
918 |
-
return in_array( $slug, array( $has_archive, $rewrite_slug ) );
|
919 |
-
}
|
920 |
-
|
921 |
-
|
922 |
-
public static function settings_add_help_tabs() {
|
923 |
-
$screen = get_current_screen();
|
924 |
-
if ( self::$admin_page != $screen->id )
|
925 |
-
return;
|
926 |
-
|
927 |
-
$screen->set_help_sidebar(
|
928 |
-
'<p>' .
|
929 |
-
esc_html__( 'These Testimonials Settings establish the default option values for shortcodes, theme functions, and widget instances. Widgets, once created no longer inherit these global settings. Therefore, you\'ll need to update each widget with the new settings. It might be easier to delete the widget and then recreate it.', 'testimonials-widget' ) .
|
930 |
-
'</p><p>' .
|
931 |
-
esc_html__( 'Shortcode option names are listed below each entry.', 'testimonials-widget' ) .
|
932 |
-
'</p><p>' .
|
933 |
-
sprintf(
|
934 |
-
__( 'View the <a href="%s">Testimonials documentation</a>.', 'testimonials-widget' ),
|
935 |
-
esc_url( 'http://wordpress.org/plugins/testimonials-widget/' )
|
936 |
-
) .
|
937 |
-
'</p>'
|
938 |
-
);
|
939 |
-
|
940 |
-
$screen->add_help_tab(
|
941 |
-
array(
|
942 |
-
'id' => 'tw-general',
|
943 |
-
'title' => esc_html__( 'General', 'testimonials-widget' ),
|
944 |
-
'content' => '<p>' . esc_html__( 'Show or hide optional fields.', 'testimonials-widget' ) . '</p>'
|
945 |
-
)
|
946 |
-
);
|
947 |
-
|
948 |
-
$screen->add_help_tab(
|
949 |
-
array(
|
950 |
-
'id' => 'tw-selection',
|
951 |
-
'title' => esc_html__( 'Selection', 'testimonials-widget' ),
|
952 |
-
'content' => '<p>' . esc_html__( 'Options used to select testimonials.', 'testimonials-widget' ) . '</p>'
|
953 |
-
)
|
954 |
-
);
|
955 |
-
|
956 |
-
$screen->add_help_tab(
|
957 |
-
array(
|
958 |
-
'id' => 'tw-ordering',
|
959 |
-
'title' => esc_html__( 'Ordering', 'testimonials-widget' ),
|
960 |
-
'content' => '<p>' . esc_html__( 'Options used to determine displayed testimonials ordering.', 'testimonials-widget' ) . '</p>'
|
961 |
-
)
|
962 |
-
);
|
963 |
-
|
964 |
-
$screen->add_help_tab(
|
965 |
-
array(
|
966 |
-
'id' => 'tw-widget',
|
967 |
-
'title' => esc_html__( 'Widget', 'testimonials-widget' ),
|
968 |
-
'content' => '<p>' . esc_html__( 'Options related to showing testimonials in widgets.', 'testimonials-widget' ) . '</p>'
|
969 |
-
)
|
970 |
-
);
|
971 |
-
|
972 |
-
$screen->add_help_tab(
|
973 |
-
array(
|
974 |
-
'id' => 'tw-post_type',
|
975 |
-
'title' => esc_html__( 'Post Type', 'testimonials-widget' ),
|
976 |
-
'content' => '<p>' . esc_html__( 'Archive and singular page URL related testimonials options.', 'testimonials-widget' ) . '</p>'
|
977 |
-
)
|
978 |
-
);
|
979 |
-
|
980 |
-
$screen->add_help_tab(
|
981 |
-
array(
|
982 |
-
'id' => 'tw-columns',
|
983 |
-
'title' => esc_html__( 'Columns', 'testimonials-widget' ),
|
984 |
-
'content' => '<p>' . esc_html__( 'Allowed columns to display on edit page.', 'testimonials-widget' ) . '</p>'
|
985 |
-
)
|
986 |
-
);
|
987 |
-
|
988 |
-
$screen->add_help_tab(
|
989 |
-
array(
|
990 |
-
'id' => 'tw-reset',
|
991 |
-
'title' => esc_html__( 'Compatibility & Reset', 'testimonials-widget' ),
|
992 |
-
'content' => '<p>' . esc_html__( 'Backwards compatibility, import/export options, and reset options.', 'testimonials-widget' ) . '</p>'
|
993 |
-
)
|
994 |
-
);
|
995 |
-
|
996 |
-
do_action( 'testimonials_widget_settings_add_help_tabs', $screen );
|
997 |
-
}
|
998 |
-
|
999 |
-
|
1000 |
-
public static function get_suggest( $id, $suggest_id ) {
|
1001 |
-
wp_enqueue_script( 'suggest' );
|
1002 |
-
|
1003 |
-
$use_cpt_taxonomy = tw_get_option( 'use_cpt_taxonomy', false );
|
1004 |
-
|
1005 |
-
switch ( $id ) {
|
1006 |
-
case 'category':
|
1007 |
-
if ( ! $use_cpt_taxonomy )
|
1008 |
-
$taxonomy = 'category';
|
1009 |
-
else
|
1010 |
-
$taxonomy = Testimonials_Widget::$cpt_category;
|
1011 |
-
|
1012 |
-
break;
|
1013 |
-
|
1014 |
-
case 'tags':
|
1015 |
-
if ( ! $use_cpt_taxonomy )
|
1016 |
-
$taxonomy = 'post_tag';
|
1017 |
-
else
|
1018 |
-
$taxonomy = Testimonials_Widget::$cpt_tags;
|
1019 |
-
|
1020 |
-
break;
|
1021 |
-
}
|
1022 |
-
|
1023 |
-
$ajax_url = site_url() . '/wp-admin/admin-ajax.php';
|
1024 |
-
$suggest_js = "suggest( '{$ajax_url}?action=ajax-tag-search&tax={$taxonomy}', { delay: 500, minchars: 2, multiple: true, multipleSep: ', ' } )";
|
1025 |
-
|
1026 |
-
$scripts = <<<EOD
|
1027 |
-
<script type="text/javascript">
|
1028 |
-
jQuery(document).ready( function() {
|
1029 |
-
jQuery( '.{$suggest_id}' ).{$suggest_js};
|
1030 |
-
});
|
1031 |
-
</script>
|
1032 |
-
EOD;
|
1033 |
-
|
1034 |
-
return $scripts;
|
1035 |
-
}
|
1036 |
-
|
1037 |
-
|
1038 |
-
}
|
1039 |
-
|
1040 |
-
|
1041 |
-
function tw_get_options() {
|
1042 |
-
$options = get_option( Testimonials_Widget_Settings::ID );
|
1043 |
-
|
1044 |
-
if ( false === $options ) {
|
1045 |
-
$options = Testimonials_Widget_Settings::get_defaults();
|
1046 |
-
update_option( Testimonials_Widget_Settings::ID, $options );
|
1047 |
-
}
|
1048 |
-
|
1049 |
-
return $options;
|
1050 |
-
}
|
1051 |
-
|
1052 |
-
|
1053 |
-
function tw_get_option( $option, $default = null ) {
|
1054 |
-
$options = get_option( Testimonials_Widget_Settings::ID, null );
|
1055 |
-
|
1056 |
-
if ( isset( $options[$option] ) )
|
1057 |
-
return $options[$option];
|
1058 |
-
else
|
1059 |
-
return $default;
|
1060 |
-
}
|
1061 |
-
|
1062 |
-
|
1063 |
-
function tw_set_option( $option, $value = null ) {
|
1064 |
-
$options = get_option( Testimonials_Widget_Settings::ID );
|
1065 |
-
|
1066 |
-
if ( ! is_array( $options ) )
|
1067 |
-
$options = array();
|
1068 |
-
|
1069 |
-
$options[$option] = $value;
|
1070 |
-
update_option( Testimonials_Widget_Settings::ID, $options );
|
1071 |
-
}
|
1072 |
-
|
1073 |
-
|
1074 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trunk/includes/class-testimonials-widget-widget.php
DELETED
@@ -1,117 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
3 |
-
Copyright 2014 Michael Cannon (email: mc@aihr.us)
|
4 |
-
|
5 |
-
This program is free software; you can redistribute it and/or modify
|
6 |
-
it under the terms of the GNU General Public License, version 2, as
|
7 |
-
published by the Free Software Foundation.
|
8 |
-
|
9 |
-
This program is distributed in the hope that it will be useful,
|
10 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12 |
-
GNU General Public License for more details.
|
13 |
-
|
14 |
-
You should have received a copy of the GNU General Public License
|
15 |
-
along with this program; if not, write to the Free Software
|
16 |
-
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
17 |
-
*/
|
18 |
-
|
19 |
-
require_once AIHR_DIR_INC . 'class-aihrus-widget.php';
|
20 |
-
|
21 |
-
if ( class_exists( 'Testimonials_Widget_Widget' ) )
|
22 |
-
return;
|
23 |
-
|
24 |
-
|
25 |
-
class Testimonials_Widget_Widget extends Aihrus_Widget {
|
26 |
-
const ID = 'testimonials_widget';
|
27 |
-
|
28 |
-
public function __construct( $classname = null, $description = null, $id_base = null, $title = null ) {
|
29 |
-
$classname = 'Testimonials_Widget_Widget';
|
30 |
-
$description = esc_html__( 'Display testimonials with multiple selection and display options', 'testimonials-widget' );
|
31 |
-
$id_base = self::ID;
|
32 |
-
$title = esc_html__( 'Testimonials', 'testimonials-widget' );
|
33 |
-
|
34 |
-
parent::__construct( $classname, $description, $id_base, $title );
|
35 |
-
}
|
36 |
-
|
37 |
-
|
38 |
-
public static function get_testimonials_css() {
|
39 |
-
Testimonials_Widget::get_testimonials_css();
|
40 |
-
}
|
41 |
-
|
42 |
-
|
43 |
-
public static function get_testimonials_scripts() {
|
44 |
-
Testimonials_Widget::get_testimonials_scripts();
|
45 |
-
}
|
46 |
-
|
47 |
-
|
48 |
-
public static function get_defaults() {
|
49 |
-
return Testimonials_Widget::get_defaults();
|
50 |
-
}
|
51 |
-
|
52 |
-
|
53 |
-
public static function get_content( $instance, $widget_number ) {
|
54 |
-
return Testimonials_Widget::testimonials_slider( $instance, $widget_number );
|
55 |
-
}
|
56 |
-
|
57 |
-
|
58 |
-
public static function validate_settings( $instance ) {
|
59 |
-
return Testimonials_Widget_Settings::validate_settings( $instance );
|
60 |
-
}
|
61 |
-
|
62 |
-
|
63 |
-
public static function form_instance( $instance ) {
|
64 |
-
$do_number = true;
|
65 |
-
if ( empty( $instance ) ) {
|
66 |
-
$do_number = false;
|
67 |
-
|
68 |
-
$instance['char_limit'] = 500;
|
69 |
-
$instance['random'] = 1;
|
70 |
-
$instance['enable_schema'] = 0;
|
71 |
-
} elseif ( ! empty( $instance['resetted'] ) ) {
|
72 |
-
if ( empty( $instance['char_limit'] ) )
|
73 |
-
$instance['char_limit'] = 500;
|
74 |
-
|
75 |
-
if ( empty( $instance['random'] ) )
|
76 |
-
$instance['random'] = 1;
|
77 |
-
|
78 |
-
$instance['enable_schema'] = 0;
|
79 |
-
}
|
80 |
-
|
81 |
-
$instance['do_number'] = $do_number;
|
82 |
-
|
83 |
-
return $instance;
|
84 |
-
}
|
85 |
-
|
86 |
-
|
87 |
-
public static function form_parts( $instance, $number ) {
|
88 |
-
$form_parts = Testimonials_Widget_Settings::get_settings();
|
89 |
-
|
90 |
-
if ( ! empty( $instance['do_number'] ) ) {
|
91 |
-
$std = ' .' . Testimonials_Widget::ID . $number;
|
92 |
-
|
93 |
-
$form_parts['css_class'] = array(
|
94 |
-
'section' => 'widget',
|
95 |
-
'type' => 'readonly',
|
96 |
-
'title' => esc_html__( 'CSS Class', 'testimonials-widget' ),
|
97 |
-
'desc' => esc_html__( 'This widget\'s unique CSS class for styling', 'testimonials-widget' ),
|
98 |
-
'std' => $std,
|
99 |
-
'widget' => 1,
|
100 |
-
);
|
101 |
-
}
|
102 |
-
|
103 |
-
$form_parts = apply_filters( 'testimonials_widget_widget_options', $form_parts );
|
104 |
-
|
105 |
-
return $form_parts;
|
106 |
-
}
|
107 |
-
|
108 |
-
|
109 |
-
public static function get_suggest( $id, $suggest_id ) {
|
110 |
-
return Testimonials_Widget_Settings::get_suggest( $id, $suggest_id );
|
111 |
-
}
|
112 |
-
|
113 |
-
|
114 |
-
}
|
115 |
-
|
116 |
-
|
117 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trunk/includes/class-testimonials-widget.php
DELETED
@@ -1,2167 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Copyright 2014 Michael Cannon (email: mc@aihr.us)
|
4 |
-
* This program is free software; you can redistribute it and/or modify
|
5 |
-
* it under the terms of the GNU General Public License, version 2, as
|
6 |
-
* published by the Free Software Foundation.
|
7 |
-
* This program is distributed in the hope that it will be useful,
|
8 |
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
9 |
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
10 |
-
* GNU General Public License for more details.
|
11 |
-
* You should have received a copy of the GNU General Public License
|
12 |
-
* along with this program; if not, write to the Free Software
|
13 |
-
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
14 |
-
*/
|
15 |
-
|
16 |
-
require_once AIHR_DIR_INC . 'class-aihrus-common.php';
|
17 |
-
require_once AIHR_DIR_LIB . 'class-redrokk-metabox-class.php';
|
18 |
-
require_once TW_DIR_INC . 'class-testimonials-widget-settings.php';
|
19 |
-
require_once TW_DIR_INC . 'class-testimonials-widget-widget.php';
|
20 |
-
|
21 |
-
if ( class_exists( 'Testimonials_Widget' ) )
|
22 |
-
return;
|
23 |
-
|
24 |
-
|
25 |
-
class Testimonials_Widget extends Aihrus_Common {
|
26 |
-
const BASE = TW_BASE;
|
27 |
-
const ID = 'testimonials-widget-testimonials';
|
28 |
-
const SLUG = 'tw_';
|
29 |
-
const VERSION = TW_VERSION;
|
30 |
-
|
31 |
-
const OLD_NAME = 'testimonialswidget';
|
32 |
-
const PT = 'testimonials-widget';
|
33 |
-
|
34 |
-
private static $found_posts = 0;
|
35 |
-
private static $max_num_pages = 0;
|
36 |
-
private static $post_count = 0;
|
37 |
-
private static $wp_query;
|
38 |
-
|
39 |
-
public static $class = __CLASS__;
|
40 |
-
public static $cpt_category = '';
|
41 |
-
public static $cpt_tags = '';
|
42 |
-
public static $css = array();
|
43 |
-
public static $css_called = false;
|
44 |
-
public static $instance_number = 0;
|
45 |
-
public static $instance_widget = 0;
|
46 |
-
public static $menu_shortcodes;
|
47 |
-
public static $not_found = false;
|
48 |
-
public static $notice_key;
|
49 |
-
public static $plugin_assets;
|
50 |
-
public static $scripts = array();
|
51 |
-
public static $scripts_called = false;
|
52 |
-
public static $settings_link = '';
|
53 |
-
public static $tag_close_quote = '<span class="close-quote"></span>';
|
54 |
-
public static $tag_open_quote = '<span class="open-quote"></span>';
|
55 |
-
public static $use_instance = false;
|
56 |
-
public static $widget_number = 100000;
|
57 |
-
|
58 |
-
public static $agg_count = 'reviewCount';
|
59 |
-
public static $agg_schema = 'http://schema.org/AggregateRating';
|
60 |
-
|
61 |
-
public static $cw_author = 'author';
|
62 |
-
public static $cw_date = 'datePublished';
|
63 |
-
public static $cw_date_mod = 'dateModified';
|
64 |
-
public static $cw_aggregate = 'aggregateRating';
|
65 |
-
public static $cw_review = 'review';
|
66 |
-
public static $cw_source_org = 'sourceOrganization';
|
67 |
-
|
68 |
-
public static $org_location = 'location';
|
69 |
-
public static $org_schema = 'http://schema.org/Organization';
|
70 |
-
|
71 |
-
public static $person_email = 'email';
|
72 |
-
public static $person_home = 'homeLocation';
|
73 |
-
public static $person_job_title = 'jobTitle';
|
74 |
-
public static $person_schema = 'http://schema.org/Person';
|
75 |
-
public static $person_member = 'memberOf';
|
76 |
-
|
77 |
-
public static $place_schema = 'http://schema.org/Place';
|
78 |
-
|
79 |
-
public static $review_body = 'reviewBody';
|
80 |
-
public static $review_item = 'itemReviewed';
|
81 |
-
public static $review_schema = 'http://schema.org/Review';
|
82 |
-
|
83 |
-
public static $schema_div_open = '<div itemscope itemtype="%1$s">';
|
84 |
-
public static $schema_div_prop = '<div itemprop="%1$s" itemscope itemtype="%2$s">%3$s</div>';
|
85 |
-
public static $schema_item_prop = 'itemprop="%1$s"';
|
86 |
-
public static $schema_meta = '<meta itemprop="%1$s" content="%2$s" />';
|
87 |
-
public static $schema_span = '<span itemprop="%1$s">%2$s</span>';
|
88 |
-
|
89 |
-
public static $thing_image = 'image';
|
90 |
-
public static $thing_name = 'name';
|
91 |
-
public static $thing_schema = 'http://schema.org/Thing';
|
92 |
-
public static $thing_url = 'url';
|
93 |
-
|
94 |
-
|
95 |
-
public function __construct() {
|
96 |
-
parent::__construct();
|
97 |
-
|
98 |
-
self::$plugin_assets = plugins_url( '/assets/', dirname( __FILE__ ) );
|
99 |
-
self::$plugin_assets = self::strip_protocol( self::$plugin_assets );
|
100 |
-
|
101 |
-
add_action( 'admin_init', array( __CLASS__, 'admin_init' ) );
|
102 |
-
add_action( 'admin_menu', array( __CLASS__, 'admin_menu' ) );
|
103 |
-
add_action( 'init', array( __CLASS__, 'init' ) );
|
104 |
-
add_action( 'widgets_init', array( __CLASS__, 'widgets_init' ) );
|
105 |
-
add_shortcode( 'testimonials', array( __CLASS__, 'testimonials' ) );
|
106 |
-
add_shortcode( 'testimonialswidget_list', array( __CLASS__, 'testimonialswidget_list' ) );
|
107 |
-
add_shortcode( 'testimonialswidget_widget', array( __CLASS__, 'testimonialswidget_widget' ) );
|
108 |
-
add_shortcode( 'testimonials_slider', array( __CLASS__, 'testimonials_slider' ) );
|
109 |
-
}
|
110 |
-
|
111 |
-
|
112 |
-
public static function admin_init() {
|
113 |
-
self::support_thumbnails();
|
114 |
-
|
115 |
-
self::$settings_link = '<a href="' . get_admin_url() . 'edit.php?post_type=' . Testimonials_Widget::PT . '&page=' . Testimonials_Widget_Settings::ID . '">' . esc_html__( 'Settings', 'testimonials-widget' ) . '</a>';
|
116 |
-
|
117 |
-
self::add_meta_box_testimonials_widget();
|
118 |
-
self::update();
|
119 |
-
|
120 |
-
add_action( 'gettext', array( __CLASS__, 'gettext_testimonials' ) );
|
121 |
-
add_action( 'manage_' . self::PT . '_posts_custom_column', array( __CLASS__, 'manage_posts_custom_column' ), 10, 2 );
|
122 |
-
add_action( 'right_now_content_table_end', array( __CLASS__, 'right_now_content_table_end' ) );
|
123 |
-
add_filter( 'manage_' . self::PT . '_posts_columns', array( __CLASS__, 'manage_posts_columns' ) );
|
124 |
-
add_filter( 'plugin_action_links', array( __CLASS__, 'plugin_action_links' ), 10, 2 );
|
125 |
-
add_filter( 'plugin_row_meta', array( __CLASS__, 'plugin_row_meta' ), 10, 2 );
|
126 |
-
add_filter( 'post_updated_messages', array( __CLASS__, 'post_updated_messages' ) );
|
127 |
-
add_filter( 'pre_get_posts', array( __CLASS__, 'pre_get_posts_author' ) );
|
128 |
-
|
129 |
-
if ( self::do_load() ) {
|
130 |
-
add_filter( 'manage_category_custom_column', array( __CLASS__, 'category_column' ), 10, 3 );
|
131 |
-
add_filter( 'manage_edit-category_columns', array( __CLASS__, 'category_columns' ) );
|
132 |
-
add_filter( 'manage_edit-post_tag_columns', array( __CLASS__, 'category_columns' ) );
|
133 |
-
add_filter( 'manage_edit-testimonials-widget-category_columns', array( __CLASS__, 'category_columns' ) );
|
134 |
-
add_filter( 'manage_edit-testimonials-widget-post_tag_columns', array( __CLASS__, 'category_columns' ) );
|
135 |
-
add_filter( 'manage_post_tag_custom_column', array( __CLASS__, 'post_tag_column' ), 10, 3 );
|
136 |
-
add_filter( 'manage_testimonials-widget-category_custom_column', array( __CLASS__, 'category_column' ), 10, 3 );
|
137 |
-
add_filter( 'manage_testimonials-widget-post_tag_custom_column', array( __CLASS__, 'post_tag_column' ), 10, 3 );
|
138 |
-
}
|
139 |
-
}
|
140 |
-
|
141 |
-
|
142 |
-
public static function admin_menu() {
|
143 |
-
self::$menu_shortcodes = add_submenu_page( 'edit.php?post_type=' . self::PT, esc_html__( 'Testimonials Shortcode Examples', 'testimonials-widget' ), esc_html__( 'E.g. Shortcodes', 'testimonials-widget' ), 'manage_options', 'shortcodes', array( __CLASS__, 'show_shortcodes' ) );
|
144 |
-
}
|
145 |
-
|
146 |
-
|
147 |
-
public static function init() {
|
148 |
-
add_filter( 'the_content', array( __CLASS__, 'get_single' ), -1 );
|
149 |
-
|
150 |
-
load_plugin_textdomain( self::PT, false, 'testimonials-widget/languages' );
|
151 |
-
|
152 |
-
self::$cpt_category = self::PT . '-category';
|
153 |
-
self::$cpt_tags = self::PT . '-post_tag';
|
154 |
-
|
155 |
-
self::init_post_type();
|
156 |
-
self::styles();
|
157 |
-
}
|
158 |
-
|
159 |
-
|
160 |
-
public static function plugin_action_links( $links, $file ) {
|
161 |
-
if ( self::BASE == $file )
|
162 |
-
array_unshift( $links, self::$settings_link );
|
163 |
-
|
164 |
-
return $links;
|
165 |
-
}
|
166 |
-
|
167 |
-
|
168 |
-
public static function add_instance() {
|
169 |
-
self::$use_instance = false;
|
170 |
-
self::$instance_number++;
|
171 |
-
|
172 |
-
return self::$instance_number;
|
173 |
-
}
|
174 |
-
|
175 |
-
|
176 |
-
public static function get_instance() {
|
177 |
-
return self::$use_instance ? self::$instance_number : self::$instance_widget;
|
178 |
-
}
|
179 |
-
|
180 |
-
|
181 |
-
public static function set_instance( $widget_number ) {
|
182 |
-
self::$use_instance = true;
|
183 |
-
self::$instance_widget = $widget_number;
|
184 |
-
}
|
185 |
-
|
186 |
-
|
187 |
-
public static function support_thumbnails() {
|
188 |
-
$feature = 'post-thumbnails';
|
189 |
-
$feature_level = get_theme_support( $feature );
|
190 |
-
|
191 |
-
if ( true === $feature_level ) {
|
192 |
-
// already enabled for all post types
|
193 |
-
return;
|
194 |
-
} elseif ( false === $feature_level ) {
|
195 |
-
// none allowed, only enable for our own
|
196 |
-
add_theme_support( $feature, array( self::PT ) );
|
197 |
-
} else {
|
198 |
-
// add our own to list of supported
|
199 |
-
$feature_level[0][] = self::PT;
|
200 |
-
add_theme_support( $feature, $feature_level[0] );
|
201 |
-
}
|
202 |
-
}
|
203 |
-
|
204 |
-
|
205 |
-
public static function get_single( $content ) {
|
206 |
-
global $post;
|
207 |
-
|
208 |
-
if ( ! is_single() || self::PT != $post->post_type )
|
209 |
-
return $content;
|
210 |
-
|
211 |
-
$atts = self::get_defaults( true );
|
212 |
-
$atts['hide_content'] = 1;
|
213 |
-
$atts['ids'] = $post->ID;
|
214 |
-
$atts['type'] = 'get_single';
|
215 |
-
|
216 |
-
$instance = self::add_instance();
|
217 |
-
$atts['widget_number'] = $instance;
|
218 |
-
|
219 |
-
$testimonials = array();
|
220 |
-
|
221 |
-
$text = apply_filters( 'testimonials_widget_cache_get', false, $atts );
|
222 |
-
if ( false === $text ) {
|
223 |
-
$testimonials = self::get_testimonials( $atts );
|
224 |
-
$testimonial = $testimonials[0];
|
225 |
-
|
226 |
-
$details = self::get_testimonial_html( $testimonial, $atts );
|
227 |
-
$details = apply_filters( 'testimonials_widget_testimonial_html_single', $details, $testimonial, $atts );
|
228 |
-
|
229 |
-
$content = apply_filters( 'testimonials_widget_testimonial_html_single_content', $content, $testimonial, $atts );
|
230 |
-
|
231 |
-
$text = $content . $details;
|
232 |
-
$text = apply_filters( 'testimonials_widget_cache_set', $text, $atts );
|
233 |
-
}
|
234 |
-
|
235 |
-
self::call_scripts_styles( $testimonials, $atts, $instance );
|
236 |
-
|
237 |
-
return $text;
|
238 |
-
}
|
239 |
-
|
240 |
-
|
241 |
-
public static function activation() {
|
242 |
-
if ( ! current_user_can( 'activate_plugins' ) )
|
243 |
-
return;
|
244 |
-
|
245 |
-
self::init();
|
246 |
-
flush_rewrite_rules();
|
247 |
-
}
|
248 |
-
|
249 |
-
|
250 |
-
public static function deactivation() {
|
251 |
-
if ( ! current_user_can( 'activate_plugins' ) )
|
252 |
-
return;
|
253 |
-
|
254 |
-
flush_rewrite_rules();
|
255 |
-
}
|
256 |
-
|
257 |
-
|
258 |
-
public static function uninstall() {
|
259 |
-
if ( ! current_user_can( 'activate_plugins' ) )
|
260 |
-
return;
|
261 |
-
|
262 |
-
global $wpdb;
|
263 |
-
|
264 |
-
require_once TW_DIR_INC . 'class-testimonials-widget-settings.php';
|
265 |
-
|
266 |
-
$delete_data = tw_get_option( 'delete_data', false );
|
267 |
-
if ( $delete_data ) {
|
268 |
-
delete_option( self::OLD_NAME );
|
269 |
-
delete_option( Testimonials_Widget_Settings::ID );
|
270 |
-
$wpdb->query( 'OPTIMIZE TABLE `' . $wpdb->options . '`' );
|
271 |
-
|
272 |
-
Testimonials_Widget::delete_testimonials();
|
273 |
-
}
|
274 |
-
}
|
275 |
-
|
276 |
-
|
277 |
-
public static function delete_testimonials() {
|
278 |
-
global $wpdb;
|
279 |
-
|
280 |
-
$query = "SELECT ID FROM {$wpdb->posts} WHERE post_type = '" . self::PT . "'";
|
281 |
-
$posts = $wpdb->get_results( $query );
|
282 |
-
|
283 |
-
foreach ( $posts as $post ) {
|
284 |
-
$post_id = $post->ID;
|
285 |
-
Testimonials_Widget::delete_attachments( $post_id );
|
286 |
-
|
287 |
-
// dels post, meta & comments
|
288 |
-
// true is force delete
|
289 |
-
wp_delete_post( $post_id, true );
|
290 |
-
}
|
291 |
-
|
292 |
-
$wpdb->query( 'OPTIMIZE TABLE `' . $wpdb->postmeta . '`' );
|
293 |
-
$wpdb->query( 'OPTIMIZE TABLE `' . $wpdb->posts . '`' );
|
294 |
-
}
|
295 |
-
|
296 |
-
|
297 |
-
public static function delete_attachments( $post_id = false ) {
|
298 |
-
global $wpdb;
|
299 |
-
|
300 |
-
$post_id = $post_id ? $post_id : 0;
|
301 |
-
$query = "SELECT ID FROM {$wpdb->posts} WHERE post_type = 'attachment' AND post_parent = {$post_id}";
|
302 |
-
$attachments = $wpdb->get_results( $query );
|
303 |
-
|
304 |
-
foreach ( $attachments as $attachment ) {
|
305 |
-
// true is force delete
|
306 |
-
wp_delete_attachment( $attachment->ID, true );
|
307 |
-
}
|
308 |
-
}
|
309 |
-
|
310 |
-
|
311 |
-
public static function plugin_row_meta( $input, $file ) {
|
312 |
-
if ( self::BASE != $file )
|
313 |
-
return $input;
|
314 |
-
|
315 |
-
$disable_donate = tw_get_option( 'disable_donate' );
|
316 |
-
if ( $disable_donate )
|
317 |
-
return $input;
|
318 |
-
|
319 |
-
$links = array(
|
320 |
-
self::$donate_link,
|
321 |
-
);
|
322 |
-
|
323 |
-
global $TW_Premium;
|
324 |
-
if ( ! isset( $TW_Premium ) )
|
325 |
-
$links[] = TW_PREMIUM_LINK;
|
326 |
-
|
327 |
-
$input = array_merge( $input, $links );
|
328 |
-
|
329 |
-
return $input;
|
330 |
-
}
|
331 |
-
|
332 |
-
|
333 |
-
public static function notice_2_12_0() {
|
334 |
-
$text = sprintf( __( 'If your Testimonials display has gone to funky town, please <a href="%s">read the FAQ</a> about possible CSS fixes.', 'testimonials-widget' ), esc_url( 'https://aihrus.zendesk.com/entries/23722573-Major-Changes-Since-2-10-0' ) );
|
335 |
-
|
336 |
-
aihr_notice_updated( $text );
|
337 |
-
}
|
338 |
-
|
339 |
-
|
340 |
-
public static function notice_donate( $disable_donate = null, $item_name = null ) {
|
341 |
-
$disable_donate = tw_get_option( 'disable_donate' );
|
342 |
-
|
343 |
-
parent::notice_donate( $disable_donate, TW_NAME );
|
344 |
-
}
|
345 |
-
|
346 |
-
|
347 |
-
public static function update() {
|
348 |
-
$prior_version = tw_get_option( 'admin_notices' );
|
349 |
-
if ( $prior_version ) {
|
350 |
-
if ( $prior_version < '2.12.0' )
|
351 |
-
self::set_notice( 'notice_2_12_0' );
|
352 |
-
|
353 |
-
if ( $prior_version < '2.15.0' )
|
354 |
-
self::set_notice( 'notice_2_15_0' );
|
355 |
-
|
356 |
-
if ( $prior_version < self::VERSION ) {
|
357 |
-
tw_requirements_check( true );
|
358 |
-
do_action( 'testimonials_widget_update' );
|
359 |
-
}
|
360 |
-
|
361 |
-
tw_set_option( 'admin_notices' );
|
362 |
-
}
|
363 |
-
|
364 |
-
// display donate on major/minor version release
|
365 |
-
$donate_version = tw_get_option( 'donate_version', false );
|
366 |
-
if ( ! $donate_version || ( $donate_version != self::VERSION && preg_match( '#\.0$#', self::VERSION ) ) ) {
|
367 |
-
self::set_notice( 'notice_donate' );
|
368 |
-
tw_set_option( 'donate_version', self::VERSION );
|
369 |
-
}
|
370 |
-
|
371 |
-
$options = get_option( self::OLD_NAME );
|
372 |
-
if ( true !== $options['migrated'] )
|
373 |
-
self::migrate();
|
374 |
-
}
|
375 |
-
|
376 |
-
|
377 |
-
public static function migrate() {
|
378 |
-
global $wpdb;
|
379 |
-
|
380 |
-
$table_name = $wpdb->prefix . self::OLD_NAME;
|
381 |
-
$meta_key = '_' . self::PT . ':testimonial_id';
|
382 |
-
$has_table_query = "SELECT table_name FROM information_schema.tables WHERE table_schema='{$wpdb->dbname}' AND table_name='{$table_name}'";
|
383 |
-
$has_table_result = $wpdb->get_col( $has_table_query );
|
384 |
-
|
385 |
-
if ( ! empty( $has_table_result ) ) {
|
386 |
-
// check that db table exists and has entries
|
387 |
-
$query = 'SELECT `testimonial_id`, `testimonial`, `author`, `source`, `tags`, `public`, `time_added`, `time_updated` FROM `' . $table_name . '`';
|
388 |
-
|
389 |
-
// ignore already imported
|
390 |
-
$done_import_query = 'SELECT meta_value FROM ' . $wpdb->postmeta . ' WHERE meta_key = "' . $meta_key . '"';
|
391 |
-
$done_import = $wpdb->get_col( $done_import_query );
|
392 |
-
|
393 |
-
if ( ! empty( $done_import ) ) {
|
394 |
-
$done_import = array_unique( $done_import );
|
395 |
-
$query .= ' WHERE testimonial_id NOT IN ( ' . implode( ',', $done_import ) . ' )';
|
396 |
-
}
|
397 |
-
|
398 |
-
$results = $wpdb->get_results( $query );
|
399 |
-
if ( ! empty( $results ) ) {
|
400 |
-
foreach ( $results as $result ) {
|
401 |
-
// author can contain title and company details
|
402 |
-
$author = $result->author;
|
403 |
-
$company = false;
|
404 |
-
|
405 |
-
// ex: First Last of Company!
|
406 |
-
$author = str_replace( ' of ', ', ', $author );
|
407 |
-
// now ex: First Last, Company!
|
408 |
-
|
409 |
-
// ex: First Last, Company
|
410 |
-
// ex: First Last, Web Development Manager, Topcon Positioning Systems, Inc.
|
411 |
-
// ex: First Last, Owner, Company, LLC
|
412 |
-
$author = str_replace( ' of ', ', ', $author );
|
413 |
-
$temp_comma = '^^^';
|
414 |
-
$author = str_replace( ', LLC', $temp_comma . ' LLC', $author );
|
415 |
-
|
416 |
-
// now ex: First Last, Owner, Company^^^ LLC
|
417 |
-
$author = str_replace( ', Inc', $temp_comma . ' Inc', $author );
|
418 |
-
|
419 |
-
// ex: First Last, Web Development Manager, Company^^^ Inc.
|
420 |
-
// it's possible to have "Michael Cannon, Senior Developer" and "Senior Developer" become the company. Okay for now
|
421 |
-
$author = explode( ', ', $author );
|
422 |
-
|
423 |
-
if ( 1 < count( $author ) ) {
|
424 |
-
$company = array_pop( $author );
|
425 |
-
$company = str_replace( $temp_comma, ',', $company );
|
426 |
-
}
|
427 |
-
|
428 |
-
$author = implode( ', ', $author );
|
429 |
-
$author = str_replace( $temp_comma, ',', $author );
|
430 |
-
|
431 |
-
$post_data = array(
|
432 |
-
'post_type' => self::PT,
|
433 |
-
'post_status' => ( 'yes' == $result->public ) ? 'publish' : 'private',
|
434 |
-
'post_date' => $result->time_added,
|
435 |
-
'post_modified' => $result->time_updated,
|
436 |
-
'post_title' => $author,
|
437 |
-
'post_content' => $result->testimonial,
|
438 |
-
'tags_input' => $result->tags,
|
439 |
-
);
|
440 |
-
|
441 |
-
$post_id = wp_insert_post( $post_data, true );
|
442 |
-
|
443 |
-
// track/link testimonial import to new post
|
444 |
-
add_post_meta( $post_id, $meta_key, $result->testimonial_id );
|
445 |
-
|
446 |
-
if ( ! empty( $company ) )
|
447 |
-
add_post_meta( $post_id, 'testimonials-widget-company', $company );
|
448 |
-
|
449 |
-
$source = $result->source;
|
450 |
-
if ( ! empty( $source ) ) {
|
451 |
-
if ( is_email( $source ) ) {
|
452 |
-
add_post_meta( $post_id, 'testimonials-widget-email', $source );
|
453 |
-
} else {
|
454 |
-
add_post_meta( $post_id, 'testimonials-widget-url', $source );
|
455 |
-
}
|
456 |
-
}
|
457 |
-
}
|
458 |
-
}
|
459 |
-
}
|
460 |
-
|
461 |
-
$options['migrated'] = true;
|
462 |
-
delete_option( self::OLD_NAME );
|
463 |
-
add_option( self::OLD_NAME, $options, '', 'no' );
|
464 |
-
}
|
465 |
-
|
466 |
-
|
467 |
-
public static function pre_get_posts_author( $query ) {
|
468 |
-
global $user_ID;
|
469 |
-
|
470 |
-
// author's and below
|
471 |
-
if ( $query->is_admin && ! empty( $query->is_main_query ) && $query->is_post_type_archive( Testimonials_Widget::PT ) && ! current_user_can( 'edit_others_posts' ) )
|
472 |
-
$query->set( 'post_author', $user_ID );
|
473 |
-
|
474 |
-
return $query;
|
475 |
-
}
|
476 |
-
|
477 |
-
|
478 |
-
public static function manage_posts_custom_column( $column, $post_id ) {
|
479 |
-
$result = false;
|
480 |
-
|
481 |
-
switch ( $column ) {
|
482 |
-
case 'id':
|
483 |
-
$result = $post_id;
|
484 |
-
break;
|
485 |
-
|
486 |
-
case 'shortcode':
|
487 |
-
$result = '[testimonials ids="';
|
488 |
-
$result .= $post_id;
|
489 |
-
$result .= '"]';
|
490 |
-
$result .= '<br />';
|
491 |
-
$result .= '[testimonials_slider ids="';
|
492 |
-
$result .= $post_id;
|
493 |
-
$result .= '"]';
|
494 |
-
break;
|
495 |
-
|
496 |
-
case 'testimonials-widget-company':
|
497 |
-
case 'testimonials-widget-location':
|
498 |
-
case 'testimonials-widget-title':
|
499 |
-
$result = get_post_meta( $post_id, $column, true );
|
500 |
-
break;
|
501 |
-
|
502 |
-
case 'testimonials-widget-email':
|
503 |
-
case 'testimonials-widget-url':
|
504 |
-
$url = get_post_meta( $post_id, $column, true );
|
505 |
-
if ( ! empty( $url ) && ! is_email( $url ) && 0 === preg_match( '#https?://#', $url ) )
|
506 |
-
$url = 'http://' . $url;
|
507 |
-
|
508 |
-
$result = make_clickable( $url );
|
509 |
-
break;
|
510 |
-
|
511 |
-
case 'thumbnail':
|
512 |
-
$email = get_post_meta( $post_id, 'testimonials-widget-email', true );
|
513 |
-
|
514 |
-
if ( has_post_thumbnail( $post_id ) )
|
515 |
-
$result = get_the_post_thumbnail( $post_id, 'thumbnail' );
|
516 |
-
elseif ( is_email( $email ) )
|
517 |
-
$result = get_avatar( $email );
|
518 |
-
else
|
519 |
-
$result = false;
|
520 |
-
break;
|
521 |
-
|
522 |
-
case self::$cpt_category:
|
523 |
-
case self::$cpt_tags:
|
524 |
-
$terms = get_the_terms( $post_id, $column );
|
525 |
-
$result = '';
|
526 |
-
if ( ! empty( $terms ) ) {
|
527 |
-
$out = array();
|
528 |
-
foreach ( $terms as $term )
|
529 |
-
$out[] = '<a href="' . admin_url( 'edit-tags.php?action=edit&taxonomy=' . $column . '&tag_ID=' . $term->term_id . '&post_type=' . self::PT ) . '">' . $term->name . '</a>';
|
530 |
-
|
531 |
-
$result = join( ', ', $out );
|
532 |
-
}
|
533 |
-
break;
|
534 |
-
}
|
535 |
-
|
536 |
-
$result = apply_filters( 'testimonials_widget_posts_custom_column', $result, $column, $post_id );
|
537 |
-
|
538 |
-
if ( $result )
|
539 |
-
echo $result;
|
540 |
-
}
|
541 |
-
|
542 |
-
|
543 |
-
public static function manage_posts_columns( $columns ) {
|
544 |
-
// order of keys matches column ordering
|
545 |
-
$columns = array(
|
546 |
-
'cb' => '<input type="checkbox" />',
|
547 |
-
'title' => esc_html__( 'Source', 'testimonials-widget' ),
|
548 |
-
'author' => esc_html__( 'Published by', 'testimonials-widget' ),
|
549 |
-
'date' => esc_html__( 'Date', 'testimonials-widget' ),
|
550 |
-
);
|
551 |
-
|
552 |
-
$use_cpt_taxonomy = tw_get_option( 'use_cpt_taxonomy', false );
|
553 |
-
if ( ! $use_cpt_taxonomy ) {
|
554 |
-
$columns[ 'categories' ] = esc_html__( 'Category', 'testimonials-widget' );
|
555 |
-
$columns[ 'tags' ] = esc_html__( 'Tags', 'testimonials-widget' );
|
556 |
-
} else {
|
557 |
-
$columns[ self::$cpt_category ] = esc_html__( 'Category', 'testimonials-widget' );
|
558 |
-
$columns[ self::$cpt_tags ] = esc_html__( 'Tags', 'testimonials-widget' );
|
559 |
-
}
|
560 |
-
|
561 |
-
$show_id = tw_get_option( 'columns_id' );
|
562 |
-
if ( empty( $show_id ) ) {
|
563 |
-
$columns[ 'id' ] = esc_html__( 'ID', 'testimonials-widget' );
|
564 |
-
}
|
565 |
-
|
566 |
-
$show_thumbnail = tw_get_option( 'columns_thumbnail' );
|
567 |
-
if ( empty( $show_thumbnail ) ) {
|
568 |
-
$columns[ 'thumbnail' ] = esc_html__( 'Image', 'testimonials-widget' );
|
569 |
-
}
|
570 |
-
|
571 |
-
$show_shortcode = tw_get_option( 'columns_shortcode' );
|
572 |
-
if ( empty( $show_shortcode ) ) {
|
573 |
-
$columns[ 'shortcode' ] = esc_html__( 'Shortcodes', 'testimonials-widget' );
|
574 |
-
}
|
575 |
-
|
576 |
-
$show_job_title = tw_get_option( 'columns_job_title' );
|
577 |
-
if ( empty( $show_job_title ) ) {
|
578 |
-
$columns[ 'testimonials-widget-title' ] = esc_html__( 'Job Title', 'testimonials-widget' );
|
579 |
-
}
|
580 |
-
|
581 |
-
$show_location = tw_get_option( 'columns_location' );
|
582 |
-
if ( empty( $show_location ) ) {
|
583 |
-
$columns[ 'testimonials-widget-location' ] = esc_html__( 'Location', 'testimonials-widget' );
|
584 |
-
}
|
585 |
-
|
586 |
-
$show_email = tw_get_option( 'columns_email' );
|
587 |
-
if ( empty( $show_email ) ) {
|
588 |
-
$columns[ 'testimonials-widget-email' ] = esc_html__( 'Email', 'testimonials-widget' );
|
589 |
-
}
|
590 |
-
|
591 |
-
$show_company = tw_get_option( 'columns_company' );
|
592 |
-
if ( empty( $show_company ) ) {
|
593 |
-
$columns[ 'testimonials-widget-company' ] = esc_html__( 'Company', 'testimonials-widget' );
|
594 |
-
}
|
595 |
-
|
596 |
-
$show_url = tw_get_option( 'columns_url' );
|
597 |
-
if ( empty( $show_url ) ) {
|
598 |
-
$columns[ 'testimonials-widget-url' ] = esc_html__( 'URL', 'testimonials-widget' );
|
599 |
-
}
|
600 |
-
|
601 |
-
$columns = apply_filters( 'testimonials_widget_columns', $columns );
|
602 |
-
|
603 |
-
return $columns;
|
604 |
-
}
|
605 |
-
|
606 |
-
|
607 |
-
public static function init_post_type() {
|
608 |
-
$labels = array(
|
609 |
-
'add_new' => esc_html__( 'Add New', 'testimonials-widget' ),
|
610 |
-
'add_new_item' => esc_html__( 'Add New Testimonial', 'testimonials-widget' ),
|
611 |
-
'edit_item' => esc_html__( 'Edit Testimonial', 'testimonials-widget' ),
|
612 |
-
'name' => esc_html__( 'Testimonials', 'testimonials-widget' ),
|
613 |
-
'new_item' => esc_html__( 'Add New Testimonial', 'testimonials-widget' ),
|
614 |
-
'not_found' => esc_html__( 'No testimonials found', 'testimonials-widget' ),
|
615 |
-
'not_found_in_trash' => esc_html__( 'No testimonials found in Trash', 'testimonials-widget' ),
|
616 |
-
'parent_item_colon' => null,
|
617 |
-
'search_items' => esc_html__( 'Search Testimonials', 'testimonials-widget' ),
|
618 |
-
'singular_name' => esc_html__( 'Testimonial', 'testimonials-widget' ),
|
619 |
-
'view_item' => esc_html__( 'View Testimonial', 'testimonials-widget' ),
|
620 |
-
);
|
621 |
-
|
622 |
-
$supports = array(
|
623 |
-
'title',
|
624 |
-
'editor',
|
625 |
-
'thumbnail',
|
626 |
-
'publicize',
|
627 |
-
);
|
628 |
-
|
629 |
-
$allow_comments = tw_get_option( 'allow_comments', false );
|
630 |
-
if ( $allow_comments )
|
631 |
-
$supports[] = 'comments';
|
632 |
-
|
633 |
-
$has_archive = tw_get_option( 'has_archive', true );
|
634 |
-
$rewrite_slug = tw_get_option( 'rewrite_slug', 'testimonial' );
|
635 |
-
$use_cpt_taxonomy = tw_get_option( 'use_cpt_taxonomy', false );
|
636 |
-
|
637 |
-
// editor's and up
|
638 |
-
if ( current_user_can( 'edit_others_posts' ) )
|
639 |
-
$supports[] = 'author';
|
640 |
-
|
641 |
-
if ( ! $use_cpt_taxonomy ) {
|
642 |
-
$do_register_taxonomy = false;
|
643 |
-
$taxonomies = array(
|
644 |
-
'category',
|
645 |
-
'post_tag',
|
646 |
-
);
|
647 |
-
} else {
|
648 |
-
$do_register_taxonomy = true;
|
649 |
-
$taxonomies = array(
|
650 |
-
self::$cpt_category,
|
651 |
-
self::$cpt_tags,
|
652 |
-
);
|
653 |
-
|
654 |
-
self::register_taxonomies();
|
655 |
-
}
|
656 |
-
|
657 |
-
$args = array(
|
658 |
-
'label' => esc_html__( 'Testimonials', 'testimonials-widget' ),
|
659 |
-
'capability_type' => 'post',
|
660 |
-
'has_archive' => $has_archive,
|
661 |
-
'hierarchical' => false,
|
662 |
-
'labels' => $labels,
|
663 |
-
'public' => true,
|
664 |
-
'publicly_queryable' => true,
|
665 |
-
'query_var' => true,
|
666 |
-
'rewrite' => array(
|
667 |
-
'slug' => $rewrite_slug,
|
668 |
-
'with_front' => false,
|
669 |
-
),
|
670 |
-
'supports' => $supports,
|
671 |
-
'taxonomies' => $taxonomies,
|
672 |
-
);
|
673 |
-
|
674 |
-
register_post_type( self::PT, $args );
|
675 |
-
|
676 |
-
if ( $do_register_taxonomy ) {
|
677 |
-
register_taxonomy_for_object_type( self::$cpt_category, self::PT );
|
678 |
-
register_taxonomy_for_object_type( self::$cpt_tags, self::PT );
|
679 |
-
}
|
680 |
-
}
|
681 |
-
|
682 |
-
|
683 |
-
public static function register_taxonomies() {
|
684 |
-
$args = array(
|
685 |
-
'hierarchical' => true,
|
686 |
-
'show_admin_column' => true,
|
687 |
-
);
|
688 |
-
register_taxonomy( self::$cpt_category, self::PT, $args );
|
689 |
-
|
690 |
-
$args = array(
|
691 |
-
'show_admin_column' => true,
|
692 |
-
'update_count_callback' => '_update_post_term_count',
|
693 |
-
);
|
694 |
-
register_taxonomy( self::$cpt_tags, self::PT, $args );
|
695 |
-
}
|
696 |
-
|
697 |
-
|
698 |
-
public static function get_defaults( $single_view = false ) {
|
699 |
-
if ( empty( $single_view ) )
|
700 |
-
return apply_filters( 'testimonials_widget_defaults', tw_get_options() );
|
701 |
-
else
|
702 |
-
return apply_filters( 'testimonials_widget_defaults_single', tw_get_options() );
|
703 |
-
}
|
704 |
-
|
705 |
-
|
706 |
-
public static function testimonialswidget_list( $atts ) {
|
707 |
-
_deprecated_function( __FUNCTION__, '2.19.0', 'testimonials()' );
|
708 |
-
|
709 |
-
return self::testimonials( $atts );
|
710 |
-
}
|
711 |
-
|
712 |
-
|
713 |
-
public static function testimonials( $atts ) {
|
714 |
-
$atts = wp_parse_args( $atts, self::get_defaults() );
|
715 |
-
$atts = Testimonials_Widget_Settings::validate_settings( $atts );
|
716 |
-
|
717 |
-
if ( get_query_var( 'paged' ) ) {
|
718 |
-
$atts['paged'] = get_query_var( 'paged' );
|
719 |
-
} elseif ( get_query_var( 'page' ) ) {
|
720 |
-
$atts['paged'] = get_query_var( 'page' );
|
721 |
-
} else {
|
722 |
-
$atts['paged'] = 1;
|
723 |
-
}
|
724 |
-
|
725 |
-
$atts['type'] = 'testimonials';
|
726 |
-
|
727 |
-
$instance = self::add_instance();
|
728 |
-
$atts['widget_number'] = $instance;
|
729 |
-
|
730 |
-
$testimonials = array();
|
731 |
-
|
732 |
-
$content = apply_filters( 'testimonials_widget_cache_get', false, $atts );
|
733 |
-
if ( false === $content ) {
|
734 |
-
$testimonials = self::get_testimonials( $atts );
|
735 |
-
$content = self::get_testimonials_html( $testimonials, $atts );
|
736 |
-
$content = apply_filters( 'testimonials_widget_cache_set', $content, $atts );
|
737 |
-
}
|
738 |
-
|
739 |
-
self::call_scripts_styles( $testimonials, $atts, $instance );
|
740 |
-
|
741 |
-
return $content;
|
742 |
-
}
|
743 |
-
|
744 |
-
|
745 |
-
public static function testimonialswidget_widget( $atts, $widget_number = null ) {
|
746 |
-
_deprecated_function( __FUNCTION__, '2.19.0', 'testimonials_slider()' );
|
747 |
-
|
748 |
-
return self::testimonials_slider( $atts, $widget_number );
|
749 |
-
}
|
750 |
-
|
751 |
-
|
752 |
-
public static function testimonials_slider( $atts, $widget_number = null ) {
|
753 |
-
if ( empty( $widget_number ) ) {
|
754 |
-
$widget_number = self::$widget_number++;
|
755 |
-
|
756 |
-
if ( ! isset( $atts['random'] ) )
|
757 |
-
$atts['random'] = 1;
|
758 |
-
|
759 |
-
if ( ! isset( $atts['enable_schema'] ) )
|
760 |
-
$atts['enable_schema'] = 0;
|
761 |
-
}
|
762 |
-
|
763 |
-
$atts = wp_parse_args( $atts, self::get_defaults() );
|
764 |
-
$atts = Testimonials_Widget_Settings::validate_settings( $atts );
|
765 |
-
|
766 |
-
$atts['paging'] = false;
|
767 |
-
$atts['type'] = 'testimonials_slider';
|
768 |
-
|
769 |
-
self::set_instance( $widget_number );
|
770 |
-
$atts['widget_number'] = $widget_number;
|
771 |
-
|
772 |
-
$testimonials = array();
|
773 |
-
|
774 |
-
$content = apply_filters( 'testimonials_widget_cache_get', false, $atts );
|
775 |
-
if ( false === $content ) {
|
776 |
-
$testimonials = self::get_testimonials( $atts );
|
777 |
-
$content = self::get_testimonials_html( $testimonials, $atts, false, $widget_number );
|
778 |
-
$content = apply_filters( 'testimonials_widget_cache_set', $content, $atts );
|
779 |
-
}
|
780 |
-
|
781 |
-
self::call_scripts_styles( $testimonials, $atts, $widget_number );
|
782 |
-
|
783 |
-
return $content;
|
784 |
-
}
|
785 |
-
|
786 |
-
|
787 |
-
public static function scripts( $atts ) {
|
788 |
-
if ( is_admin() )
|
789 |
-
return;
|
790 |
-
|
791 |
-
wp_enqueue_script( 'jquery' );
|
792 |
-
|
793 |
-
$use_bxslider = $atts['use_bxslider'];
|
794 |
-
if ( $use_bxslider ) {
|
795 |
-
$enable_video = $atts['enable_video'];
|
796 |
-
if ( $enable_video ) {
|
797 |
-
wp_register_script( 'jquery.fitvids', self::$plugin_assets . 'js/jquery.fitvids.js', array( 'jquery' ), '1.0', true );
|
798 |
-
wp_enqueue_script( 'jquery.fitvids' );
|
799 |
-
}
|
800 |
-
|
801 |
-
wp_register_script( 'jquery.bxslider', self::$plugin_assets . 'js/jquery.bxslider.js', array( 'jquery' ), '4.1.1', true );
|
802 |
-
wp_enqueue_script( 'jquery.bxslider' );
|
803 |
-
}
|
804 |
-
|
805 |
-
do_action( 'testimonials_widget_scripts', $atts );
|
806 |
-
}
|
807 |
-
|
808 |
-
|
809 |
-
public static function styles() {
|
810 |
-
if ( is_admin() )
|
811 |
-
return;
|
812 |
-
|
813 |
-
$use_bxslider = tw_get_option( 'use_bxslider' );
|
814 |
-
if ( $use_bxslider ) {
|
815 |
-
$exclude_bxslider_css = tw_get_option( 'exclude_bxslider_css' );
|
816 |
-
if ( empty( $exclude_bxslider_css ) ) {
|
817 |
-
wp_register_style( 'jquery.bxslider', self::$plugin_assets . 'css/jquery.bxslider.css' );
|
818 |
-
wp_enqueue_style( 'jquery.bxslider' );
|
819 |
-
}
|
820 |
-
|
821 |
-
wp_register_style( __CLASS__, self::$plugin_assets . 'css/testimonials-widget.css' );
|
822 |
-
} else {
|
823 |
-
wp_register_style( __CLASS__, self::$plugin_assets . 'css/testimonials-widget-2.14.0.css' );
|
824 |
-
|
825 |
-
$include_ie7_css = tw_get_option( 'include_ie7_css' );
|
826 |
-
if ( $include_ie7_css ) {
|
827 |
-
wp_register_style( __CLASS__ . '-ie7', self::$plugin_assets . 'css/testimonials-widget-ie7.css' );
|
828 |
-
wp_enqueue_style( __CLASS__ . '-ie7' );
|
829 |
-
}
|
830 |
-
}
|
831 |
-
|
832 |
-
wp_enqueue_style( __CLASS__ );
|
833 |
-
|
834 |
-
do_action( 'testimonials_widget_styles' );
|
835 |
-
}
|
836 |
-
|
837 |
-
|
838 |
-
public static function get_testimonials_html_css( $atts, $widget_number = null ) {
|
839 |
-
$css = array();
|
840 |
-
$id_base = self::ID . $widget_number;
|
841 |
-
|
842 |
-
switch ( $atts['type'] ) {
|
843 |
-
case 'testimonials_slider':
|
844 |
-
$use_bxslider = $atts['use_bxslider'];
|
845 |
-
if ( ! $use_bxslider ) {
|
846 |
-
$height = $atts['height'];
|
847 |
-
$max_height = $atts['max_height'];
|
848 |
-
$min_height = $atts['min_height'];
|
849 |
-
|
850 |
-
if ( $height ) {
|
851 |
-
$max_height = $height;
|
852 |
-
$min_height = $height;
|
853 |
-
}
|
854 |
-
|
855 |
-
if ( $min_height ) {
|
856 |
-
$css[] = <<<EOF
|
857 |
-
<style>
|
858 |
-
.$id_base {
|
859 |
-
min-height: {$min_height}px;
|
860 |
-
}
|
861 |
-
</style>
|
862 |
-
EOF;
|
863 |
-
}
|
864 |
-
|
865 |
-
if ( $max_height ) {
|
866 |
-
$css[] = <<<EOF
|
867 |
-
<style>
|
868 |
-
.$id_base {
|
869 |
-
max-height: {$max_height}px;
|
870 |
-
}
|
871 |
-
</style>
|
872 |
-
EOF;
|
873 |
-
}
|
874 |
-
}
|
875 |
-
break;
|
876 |
-
}
|
877 |
-
|
878 |
-
$css = apply_filters( 'testimonials_widget_testimonials_css', $css, $atts, $widget_number );
|
879 |
-
|
880 |
-
return $css;
|
881 |
-
}
|
882 |
-
|
883 |
-
|
884 |
-
public static function get_testimonials_html_js( $testimonials, $atts, $widget_number = null ) {
|
885 |
-
$not_found = self::get_not_found();
|
886 |
-
if ( $not_found )
|
887 |
-
return;
|
888 |
-
|
889 |
-
$scripts = array();
|
890 |
-
$scripts_internal = array();
|
891 |
-
|
892 |
-
$id = self::ID;
|
893 |
-
$id_base = $id . $widget_number;
|
894 |
-
|
895 |
-
switch ( $atts['type'] ) {
|
896 |
-
case 'testimonials_slider':
|
897 |
-
$javascript = '';
|
898 |
-
if ( 1 < count( $testimonials ) ) {
|
899 |
-
$refresh_interval = $atts['refresh_interval'];
|
900 |
-
|
901 |
-
$javascript .= '<script type="text/javascript">' . "\n";
|
902 |
-
|
903 |
-
$use_bxslider = $atts['use_bxslider'];
|
904 |
-
if ( $use_bxslider ) {
|
905 |
-
$enable_video = $atts['enable_video'];
|
906 |
-
$show_start_stop = $atts['show_start_stop'];
|
907 |
-
$transition_mode = $atts['transition_mode'];
|
908 |
-
|
909 |
-
$auto = $refresh_interval ? 'true' : 'false';
|
910 |
-
$pager = ! $refresh_interval ? 'pager: true' : 'pager: false';
|
911 |
-
$pause = $refresh_interval * 1000;
|
912 |
-
$video = $enable_video ? "video: true,\nuseCSS: false" : 'video: false';
|
913 |
-
|
914 |
-
$autoControls = $show_start_stop ? 'autoControls: true,' : '';
|
915 |
-
|
916 |
-
$slider_var = self::SLUG . $widget_number;
|
917 |
-
$javascript .= <<<EOF
|
918 |
-
var {$slider_var} = null;
|
919 |
-
|
920 |
-
jQuery(document).ready(function() {
|
921 |
-
{$slider_var} = jQuery('.{$id_base}').bxSlider({
|
922 |
-
auto: {$auto},
|
923 |
-
{$autoControls}
|
924 |
-
autoHover: true,
|
925 |
-
controls: false,
|
926 |
-
mode: '{$transition_mode}',
|
927 |
-
{$pager},
|
928 |
-
pause: {$pause},
|
929 |
-
{$video},
|
930 |
-
slideMargin: 2
|
931 |
-
});
|
932 |
-
});
|
933 |
-
|
934 |
-
EOF;
|
935 |
-
} else {
|
936 |
-
$tw_padding = 'tw_padding' . $widget_number;
|
937 |
-
$tw_wrapper = 'tw_wrapper' . $widget_number;
|
938 |
-
|
939 |
-
$disable_animation = $atts['disable_animation'];
|
940 |
-
$fade_in_speed = $atts['fade_in_speed'];
|
941 |
-
$fade_out_speed = $atts['fade_out_speed'];
|
942 |
-
$height = $atts['height'];
|
943 |
-
$max_height = $atts['max_height'];
|
944 |
-
$min_height = $atts['min_height'];
|
945 |
-
|
946 |
-
$enable_animation = 1;
|
947 |
-
if ( $disable_animation || $height || $max_height || $min_height )
|
948 |
-
$enable_animation = 0;
|
949 |
-
|
950 |
-
if ( $refresh_interval ) {
|
951 |
-
$javascript .= <<<EOF
|
952 |
-
function nextTestimonial{$widget_number}() {
|
953 |
-
if ( ! jQuery('.{$id_base}').first().hasClass('hovered') ) {
|
954 |
-
var active = jQuery('.{$id_base} .active');
|
955 |
-
var next = (jQuery('.{$id_base} .active').next().length > 0) ? jQuery('.{$id_base} .active').next() : jQuery('.{$id_base} .testimonials-widget-testimonial:first-child');
|
956 |
-
|
957 |
-
active.fadeOut({$fade_out_speed}, function() {
|
958 |
-
active.removeClass('active');
|
959 |
-
next.fadeIn({$fade_in_speed});
|
960 |
-
next.removeClass('display-none');
|
961 |
-
next.addClass('active');
|
962 |
-
|
963 |
-
{INTERNAL_SCRIPTS}
|
964 |
-
|
965 |
-
// added padding
|
966 |
-
if ( {$enable_animation} )
|
967 |
-
{$tw_wrapper}.animate({ height: next.height() + {$tw_padding} });
|
968 |
-
});
|
969 |
-
}
|
970 |
-
}
|
971 |
-
|
972 |
-
jQuery(document).ready(function() {
|
973 |
-
jQuery('.{$id_base}').hover(function() {
|
974 |
-
jQuery(this).addClass('hovered')
|
975 |
-
}, function() {
|
976 |
-
jQuery(this).removeClass('hovered')
|
977 |
-
});
|
978 |
-
|
979 |
-
nextTestimonial{$widget_number}interval = setInterval('nextTestimonial{$widget_number}()', {$refresh_interval} * 1000);
|
980 |
-
});
|
981 |
-
|
982 |
-
EOF;
|
983 |
-
}
|
984 |
-
|
985 |
-
$javascript .= <<<EOF
|
986 |
-
if ( {$enable_animation} ) {
|
987 |
-
var {$tw_wrapper} = jQuery('.{$id_base}');
|
988 |
-
var {$tw_padding} = 0;
|
989 |
-
|
990 |
-
jQuery(document).ready(function() {
|
991 |
-
// tw_padding is the difference in height to take into account all styling options
|
992 |
-
{$tw_padding} = {$tw_wrapper}.height() - jQuery('.{$id_base} .testimonials-widget-testimonial').height();
|
993 |
-
|
994 |
-
// fixes first animation by defining height to adjust to
|
995 |
-
{$tw_wrapper}.height( {$tw_wrapper}.height() );
|
996 |
-
});
|
997 |
-
}
|
998 |
-
EOF;
|
999 |
-
}
|
1000 |
-
|
1001 |
-
$javascript .= "\n" . '</script>';
|
1002 |
-
$scripts[ $id_base ] = $javascript;
|
1003 |
-
}
|
1004 |
-
break;
|
1005 |
-
}
|
1006 |
-
|
1007 |
-
$scripts = apply_filters( 'testimonials_widget_testimonials_js', $scripts, $testimonials, $atts, $widget_number );
|
1008 |
-
$scripts_internal = apply_filters( 'testimonials_widget_testimonials_js_internal', $scripts_internal, $testimonials, $atts, $widget_number );
|
1009 |
-
$internal_scripts = implode( "\n", $scripts_internal );
|
1010 |
-
$scripts = str_replace( '{INTERNAL_SCRIPTS}', $internal_scripts, $scripts );
|
1011 |
-
|
1012 |
-
return $scripts;
|
1013 |
-
}
|
1014 |
-
|
1015 |
-
|
1016 |
-
public static function get_testimonials_html( $testimonials, $atts, $is_list = true, $widget_number = null ) {
|
1017 |
-
$hide_not_found = $atts['hide_not_found'];
|
1018 |
-
$paging = Testimonials_Widget_Settings::is_true( $atts['paging'] );
|
1019 |
-
$paging_before = ( 'before' === strtolower( $atts['paging'] ) );
|
1020 |
-
$paging_after = ( 'after' === strtolower( $atts['paging'] ) );
|
1021 |
-
$target = $atts['target'];
|
1022 |
-
|
1023 |
-
$id = self::ID;
|
1024 |
-
|
1025 |
-
if ( is_null( $widget_number ) ) {
|
1026 |
-
$div_open = '<div class="' . $id;
|
1027 |
-
|
1028 |
-
if ( $is_list )
|
1029 |
-
$div_open .= ' listing';
|
1030 |
-
|
1031 |
-
$div_open .= '">';
|
1032 |
-
} else {
|
1033 |
-
$id_base = $id . $widget_number;
|
1034 |
-
$div_open = '<div class="' . $id . ' ' . $id_base . '">';
|
1035 |
-
}
|
1036 |
-
|
1037 |
-
$div_open .= "\n";
|
1038 |
-
if ( empty( $testimonials ) && ! $hide_not_found ) {
|
1039 |
-
$testimonials = array(
|
1040 |
-
array( 'testimonial_content' => esc_html__( 'No testimonials found', 'testimonials-widget' ) ),
|
1041 |
-
);
|
1042 |
-
|
1043 |
-
self::set_not_found( true );
|
1044 |
-
} else
|
1045 |
-
self::set_not_found();
|
1046 |
-
|
1047 |
-
$pre_paging = '';
|
1048 |
-
if ( $paging || $paging_before )
|
1049 |
-
$pre_paging = self::get_testimonials_paging( $atts );
|
1050 |
-
|
1051 |
-
$is_first = true;
|
1052 |
-
|
1053 |
-
$testimonial_content = '';
|
1054 |
-
foreach ( $testimonials as $testimonial ) {
|
1055 |
-
$content = self::get_testimonial_html( $testimonial, $atts, $is_list, $is_first, $widget_number );
|
1056 |
-
if ( $target )
|
1057 |
-
$content = links_add_target( $content, $target );
|
1058 |
-
$content = apply_filters( 'testimonials_widget_testimonial_html', $content, $testimonial, $atts, $is_list, $is_first, $widget_number );
|
1059 |
-
$is_first = false;
|
1060 |
-
|
1061 |
-
$testimonial_content .= $content;
|
1062 |
-
}
|
1063 |
-
|
1064 |
-
$post_paging = '';
|
1065 |
-
if ( $paging || $paging_after )
|
1066 |
-
$post_paging = self::get_testimonials_paging( $atts, false );
|
1067 |
-
|
1068 |
-
$div_close = '</div>';
|
1069 |
-
$div_close .= "\n";
|
1070 |
-
|
1071 |
-
$html = $div_open
|
1072 |
-
. $pre_paging
|
1073 |
-
. $testimonial_content
|
1074 |
-
. $post_paging
|
1075 |
-
. $div_close;
|
1076 |
-
|
1077 |
-
$html = apply_filters( 'testimonials_widget_get_testimonials_html', $html, $testimonials, $atts, $is_list, $widget_number, $div_open, $pre_paging, $testimonial_content, $post_paging, $div_close );
|
1078 |
-
|
1079 |
-
return $html;
|
1080 |
-
}
|
1081 |
-
|
1082 |
-
|
1083 |
-
public static function get_testimonial_html( $testimonial, $atts, $is_list = true, $is_first = false, $widget_number = null ) {
|
1084 |
-
$disable_quotes = $atts['disable_quotes'];
|
1085 |
-
$do_image = ! $atts['hide_image'] && ! empty( $testimonial['testimonial_image'] );
|
1086 |
-
$do_image_single = ! $atts['hide_image_single'];
|
1087 |
-
$do_schema = $atts['enable_schema'];
|
1088 |
-
$keep_whitespace = $atts['keep_whitespace'];
|
1089 |
-
$remove_hentry = $atts['remove_hentry'];
|
1090 |
-
$transition_mode = $atts['transition_mode'];
|
1091 |
-
$use_bxslider = $atts['use_bxslider'];
|
1092 |
-
|
1093 |
-
$class = 'testimonials-widget-testimonial';
|
1094 |
-
if ( is_single() && empty( $widget_number ) ) {
|
1095 |
-
$class .= ' single';
|
1096 |
-
} elseif ( $is_list ) {
|
1097 |
-
$class .= ' list';
|
1098 |
-
} else {
|
1099 |
-
// widget display
|
1100 |
-
if ( $use_bxslider ) {
|
1101 |
-
$refresh_interval = $atts['refresh_interval'];
|
1102 |
-
if ( ! $is_first && ! empty( $refresh_interval ) && ! in_array( $transition_mode, array( 'horizontal', 'vertical' ) ) ) {
|
1103 |
-
$class .= ' display-none';
|
1104 |
-
}
|
1105 |
-
} else {
|
1106 |
-
if ( $is_first ) {
|
1107 |
-
$class .= ' active';
|
1108 |
-
} else {
|
1109 |
-
$class .= ' display-none';
|
1110 |
-
}
|
1111 |
-
}
|
1112 |
-
}
|
1113 |
-
|
1114 |
-
if ( $keep_whitespace )
|
1115 |
-
$class .= ' whitespace';
|
1116 |
-
|
1117 |
-
$post_id = $testimonial['post_id'];
|
1118 |
-
if ( ! empty( $post_id ) )
|
1119 |
-
$class = join( ' ', get_post_class( $class, $post_id ) );
|
1120 |
-
else
|
1121 |
-
$class = 'testimonials-widget type-testimonials-widget status-publish hentry ' . $class;
|
1122 |
-
|
1123 |
-
$class = apply_filters( 'testimonials_widget_get_testimonial_html_class', $class, $testimonial, $atts, $is_list, $is_first, $widget_number );
|
1124 |
-
$div_open = '<div class="' . $class . '">';
|
1125 |
-
$div_open .= '<!-- ' . self::ID . ":{$post_id}: -->";
|
1126 |
-
|
1127 |
-
if ( $do_schema ) {
|
1128 |
-
$div_open .= "\n";
|
1129 |
-
$div_open .= sprintf( self::$schema_div_open, self::$review_schema );
|
1130 |
-
}
|
1131 |
-
|
1132 |
-
if ( $remove_hentry )
|
1133 |
-
$div_open = str_replace( ' hentry', '', $div_open );
|
1134 |
-
|
1135 |
-
$image = '';
|
1136 |
-
if ( $do_image ) {
|
1137 |
-
$pic = $testimonial['testimonial_image'];
|
1138 |
-
|
1139 |
-
$image .= '<span class="image">';
|
1140 |
-
$image .= $pic;
|
1141 |
-
$image .= '</span>';
|
1142 |
-
}
|
1143 |
-
|
1144 |
-
if ( ! $do_image_single && 'get_single' == $atts['type'] )
|
1145 |
-
$image = '';
|
1146 |
-
|
1147 |
-
$quote = self::get_quote( $testimonial, $atts, $widget_number );
|
1148 |
-
|
1149 |
-
$cite = '';
|
1150 |
-
if ( 1 < count( $testimonial ) ) {
|
1151 |
-
$cite = self::get_cite( $testimonial, $atts );
|
1152 |
-
|
1153 |
-
if ( $do_schema ) {
|
1154 |
-
$schema = self::get_schema( $testimonial, $atts );
|
1155 |
-
$cite .= $schema;
|
1156 |
-
}
|
1157 |
-
}
|
1158 |
-
|
1159 |
-
$extra = '';
|
1160 |
-
if ( ! empty( $testimonial['testimonial_extra'] ) ) {
|
1161 |
-
$extra .= '<div class="extra">';
|
1162 |
-
$extra .= $testimonial['testimonial_extra'];
|
1163 |
-
$extra .= '</div>';
|
1164 |
-
$extra .= "\n";
|
1165 |
-
}
|
1166 |
-
|
1167 |
-
$bottom_text = '';
|
1168 |
-
if ( ! empty( $atts['bottom_text'] ) ) {
|
1169 |
-
$bottom_text = '<div class="bottom_text">';
|
1170 |
-
$bottom_text .= $atts['bottom_text'];
|
1171 |
-
$bottom_text .= '</div>';
|
1172 |
-
$bottom_text .= "\n";
|
1173 |
-
}
|
1174 |
-
|
1175 |
-
$div_close = '';
|
1176 |
-
if ( $do_schema ) {
|
1177 |
-
$div_close .= '</div>';
|
1178 |
-
$div_close .= "\n";
|
1179 |
-
}
|
1180 |
-
|
1181 |
-
$div_close .= '</div>';
|
1182 |
-
$div_close .= "\n";
|
1183 |
-
|
1184 |
-
$html = $div_open
|
1185 |
-
. $image
|
1186 |
-
. $quote
|
1187 |
-
. $cite
|
1188 |
-
. $extra
|
1189 |
-
. $bottom_text
|
1190 |
-
. $div_close;
|
1191 |
-
|
1192 |
-
$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 );
|
1193 |
-
|
1194 |
-
// not done sooner as tag_close_quote is used for Premium
|
1195 |
-
if ( $disable_quotes ) {
|
1196 |
-
$html = str_replace( self::$tag_open_quote, '', $html );
|
1197 |
-
$html = str_replace( self::$tag_close_quote, '', $html );
|
1198 |
-
}
|
1199 |
-
|
1200 |
-
return $html;
|
1201 |
-
}
|
1202 |
-
|
1203 |
-
|
1204 |
-
public static function get_quote( $testimonial, $atts, $widget_number ) {
|
1205 |
-
$char_limit = $atts['char_limit'];
|
1206 |
-
$content_more = apply_filters( 'testimonials_widget_content_more', esc_html__( '…', 'testimonials-widget' ) );
|
1207 |
-
$content_more .= self::$tag_close_quote;
|
1208 |
-
$do_content = ! $atts['hide_content'] && ! empty( $testimonial['testimonial_content'] );
|
1209 |
-
$use_quote_tag = $atts['use_quote_tag'];
|
1210 |
-
|
1211 |
-
$quote = '';
|
1212 |
-
if ( $do_content ) {
|
1213 |
-
$content = $testimonial['testimonial_content'];
|
1214 |
-
$content = self::format_content( $content, $widget_number, $atts );
|
1215 |
-
if ( $char_limit ) {
|
1216 |
-
$content = self::testimonials_truncate( $content, $char_limit, $content_more );
|
1217 |
-
$content = force_balance_tags( $content );
|
1218 |
-
}
|
1219 |
-
|
1220 |
-
$content = apply_filters( 'testimonials_widget_content', $content, $widget_number, $testimonial, $atts );
|
1221 |
-
$content = make_clickable( $content );
|
1222 |
-
|
1223 |
-
if ( ! $use_quote_tag ) {
|
1224 |
-
$quote = '<blockquote>';
|
1225 |
-
$quote .= $content;
|
1226 |
-
$quote .= '</blockquote>';
|
1227 |
-
} else {
|
1228 |
-
$quote = '<q>';
|
1229 |
-
$quote .= $content;
|
1230 |
-
$quote .= '</q>';
|
1231 |
-
}
|
1232 |
-
|
1233 |
-
$quote = "\n" . $quote;
|
1234 |
-
}
|
1235 |
-
|
1236 |
-
return $quote;
|
1237 |
-
}
|
1238 |
-
|
1239 |
-
|
1240 |
-
public static function get_cite( $testimonial, $atts ) {
|
1241 |
-
extract( $testimonial );
|
1242 |
-
|
1243 |
-
$do_company = ! $atts['hide_company'] && ! empty( $testimonial_company );
|
1244 |
-
$do_email = ! $atts['hide_email'] && ! empty( $testimonial_email ) && is_email( $testimonial_email );
|
1245 |
-
$do_location = ! $atts['hide_location'] && ! empty( $testimonial_location );
|
1246 |
-
$do_source = ! $atts['hide_source'] && ! empty( $testimonial_source );
|
1247 |
-
$do_title = ! $atts['hide_title'] && ! empty( $testimonial_title );
|
1248 |
-
$do_url = ! $atts['hide_url'] && ! empty( $testimonial_url );
|
1249 |
-
$use_quote_tag = $atts['use_quote_tag'];
|
1250 |
-
|
1251 |
-
$cite = '';
|
1252 |
-
|
1253 |
-
$done_url = false;
|
1254 |
-
if ( $do_source && $do_email ) {
|
1255 |
-
$cite .= '<span class="author">';
|
1256 |
-
$cite .= '<a href="mailto:' . $testimonial_email . '">';
|
1257 |
-
$cite .= $testimonial_source;
|
1258 |
-
$cite .= '</a>';
|
1259 |
-
$cite .= '</span>';
|
1260 |
-
} elseif ( $do_source && ! $do_company && $do_url ) {
|
1261 |
-
$done_url = true;
|
1262 |
-
|
1263 |
-
$cite .= '<span class="author">';
|
1264 |
-
$cite .= '<a href="' . $testimonial_url . '" rel="nofollow">';
|
1265 |
-
$cite .= $testimonial_source;
|
1266 |
-
$cite .= '</a>';
|
1267 |
-
$cite .= '</span>';
|
1268 |
-
} elseif ( $do_source ) {
|
1269 |
-
$cite .= '<span class="author">';
|
1270 |
-
$cite .= $testimonial_source;
|
1271 |
-
$cite .= '</span>';
|
1272 |
-
} elseif ( $do_email ) {
|
1273 |
-
$cite .= '<span class="email">';
|
1274 |
-
$cite .= make_clickable( $testimonial_email );
|
1275 |
-
$cite .= '</span>';
|
1276 |
-
}
|
1277 |
-
|
1278 |
-
if ( $do_title && $cite )
|
1279 |
-
$cite .= '<span class="join-title"></span>';
|
1280 |
-
|
1281 |
-
if ( $do_title ) {
|
1282 |
-
$cite .= '<span class="job-title">';
|
1283 |
-
$cite .= $testimonial_title;
|
1284 |
-
$cite .= '</span>';
|
1285 |
-
}
|
1286 |
-
|
1287 |
-
if ( $do_location && $cite )
|
1288 |
-
$cite .= '<span class="join-location"></span>';
|
1289 |
-
|
1290 |
-
if ( $do_location ) {
|
1291 |
-
$cite .= '<span class="location">';
|
1292 |
-
$cite .= $testimonial_location;
|
1293 |
-
$cite .= '</span>';
|
1294 |
-
}
|
1295 |
-
|
1296 |
-
if ( ( $do_company || ( $do_url && ! $done_url ) ) && $cite )
|
1297 |
-
$cite .= '<span class="join"></span>';
|
1298 |
-
|
1299 |
-
if ( $do_company && $do_url ) {
|
1300 |
-
$cite .= '<span class="company">';
|
1301 |
-
$cite .= '<a href="' . $testimonial_url . '" rel="nofollow">';
|
1302 |
-
$cite .= $testimonial_company;
|
1303 |
-
$cite .= '</a>';
|
1304 |
-
$cite .= '</span>';
|
1305 |
-
} elseif ( $do_company ) {
|
1306 |
-
$cite .= '<span class="company">';
|
1307 |
-
$cite .= $testimonial_company;
|
1308 |
-
$cite .= '</span>';
|
1309 |
-
} elseif ( $do_url && ! $done_url ) {
|
1310 |
-
$cite .= '<span class="url">';
|
1311 |
-
$cite .= make_clickable( $testimonial_url );
|
1312 |
-
$cite .= '</span>';
|
1313 |
-
}
|
1314 |
-
|
1315 |
-
$cite = apply_filters( 'testimonials_widget_cite_html', $cite, $testimonial, $atts );
|
1316 |
-
|
1317 |
-
if ( ! empty( $cite ) ) {
|
1318 |
-
if ( ! $use_quote_tag ) {
|
1319 |
-
$temp = '<div class="credit">';
|
1320 |
-
$temp .= $cite;
|
1321 |
-
$temp .= '</div>';
|
1322 |
-
|
1323 |
-
$cite = "\n" . $temp . "\n";
|
1324 |
-
} else {
|
1325 |
-
$cite = '<cite>' . $cite . '</cite>';
|
1326 |
-
}
|
1327 |
-
}
|
1328 |
-
|
1329 |
-
return $cite;
|
1330 |
-
}
|
1331 |
-
|
1332 |
-
|
1333 |
-
// Original PHP code as myTruncate2 by Chirp Internet: www.chirp.com.au
|
1334 |
-
public static function testimonials_truncate( $string, $char_limit = false, $pad = '…', $force_pad = false ) {
|
1335 |
-
if ( empty( $force_pad ) ) {
|
1336 |
-
if ( ! $char_limit )
|
1337 |
-
return $string;
|
1338 |
-
|
1339 |
-
// return with no change if string is shorter than $char_limit
|
1340 |
-
if ( strlen( $string ) <= $char_limit )
|
1341 |
-
return $string;
|
1342 |
-
}
|
1343 |
-
|
1344 |
-
if ( $char_limit )
|
1345 |
-
return self::truncate( $string, $char_limit, $pad, $force_pad );
|
1346 |
-
|
1347 |
-
return $string . $pad;
|
1348 |
-
}
|
1349 |
-
|
1350 |
-
|
1351 |
-
public static function format_content( $content, $widget_number, $atts ) {
|
1352 |
-
if ( empty ( $content ) )
|
1353 |
-
return $content;
|
1354 |
-
|
1355 |
-
$keep_whitespace = $atts['keep_whitespace'];
|
1356 |
-
$do_shortcode = $atts['do_shortcode'];
|
1357 |
-
|
1358 |
-
// wrap our own quote class around the content before any formatting
|
1359 |
-
// happens
|
1360 |
-
|
1361 |
-
$temp_content = self::$tag_open_quote;
|
1362 |
-
$temp_content .= $content;
|
1363 |
-
$temp_content .= self::$tag_close_quote;
|
1364 |
-
|
1365 |
-
$content = $temp_content;
|
1366 |
-
$content = trim( $content );
|
1367 |
-
$content = wptexturize( $content );
|
1368 |
-
$content = convert_smilies( $content );
|
1369 |
-
$content = convert_chars( $content );
|
1370 |
-
|
1371 |
-
if ( is_null( $widget_number ) || $keep_whitespace )
|
1372 |
-
$content = wpautop( $content );
|
1373 |
-
|
1374 |
-
$content = shortcode_unautop( $content );
|
1375 |
-
|
1376 |
-
if ( $do_shortcode )
|
1377 |
-
$content = do_shortcode( $content );
|
1378 |
-
else
|
1379 |
-
$content = strip_shortcodes( $content );
|
1380 |
-
|
1381 |
-
$content = str_replace( ']]>', ']]>', $content );
|
1382 |
-
$content = trim( $content );
|
1383 |
-
|
1384 |
-
return $content;
|
1385 |
-
}
|
1386 |
-
|
1387 |
-
|
1388 |
-
public static function get_testimonials_paging( $atts, $prepend = true ) {
|
1389 |
-
$html = '';
|
1390 |
-
|
1391 |
-
if ( is_home() || 1 === self::$max_num_pages )
|
1392 |
-
return $html;
|
1393 |
-
|
1394 |
-
$html .= '<div class="paging';
|
1395 |
-
|
1396 |
-
if ( $prepend )
|
1397 |
-
$html .= ' prepend';
|
1398 |
-
else
|
1399 |
-
$html .= ' append';
|
1400 |
-
|
1401 |
-
$html .= '">';
|
1402 |
-
$html .= "\n";
|
1403 |
-
|
1404 |
-
if ( $atts['paged'] )
|
1405 |
-
$paged = $atts['paged'];
|
1406 |
-
else
|
1407 |
-
$paged = 1;
|
1408 |
-
|
1409 |
-
if ( ! function_exists( 'wp_pagenavi' ) ) {
|
1410 |
-
$html .= '<div class="alignleft">';
|
1411 |
-
|
1412 |
-
if ( 1 < $paged ) {
|
1413 |
-
$laquo = apply_filters( 'testimonials_widget_previous_posts_link_text', esc_html__( '«', 'testimonials-widget' ) );
|
1414 |
-
$html .= get_previous_posts_link( $laquo, $paged );
|
1415 |
-
}
|
1416 |
-
|
1417 |
-
$html .= '</div>';
|
1418 |
-
$html .= "\n";
|
1419 |
-
$html .= '<div class="alignright">';
|
1420 |
-
if ( $paged != self::$max_num_pages ) {
|
1421 |
-
$raquo = apply_filters( 'testimonials_widget_next_posts_link_text', esc_html__( '»', 'testimonials-widget' ) );
|
1422 |
-
$html .= get_next_posts_link( $raquo, self::$max_num_pages );
|
1423 |
-
}
|
1424 |
-
|
1425 |
-
$html .= '</div>';
|
1426 |
-
$html .= "\n";
|
1427 |
-
} else {
|
1428 |
-
$args = array(
|
1429 |
-
'echo' => false,
|
1430 |
-
'query' => self::$wp_query,
|
1431 |
-
);
|
1432 |
-
$args = apply_filters( 'testimonials_widget_wp_pagenavi', $args );
|
1433 |
-
|
1434 |
-
$html .= wp_pagenavi( $args );
|
1435 |
-
$html .= "\n";
|
1436 |
-
}
|
1437 |
-
|
1438 |
-
$html .= '</div>';
|
1439 |
-
$html .= "\n";
|
1440 |
-
|
1441 |
-
return $html;
|
1442 |
-
}
|
1443 |
-
|
1444 |
-
|
1445 |
-
public static function get_testimonials_css() {
|
1446 |
-
if ( empty( self::$css_called ) ) {
|
1447 |
-
foreach ( self::$css as $css )
|
1448 |
-
echo $css;
|
1449 |
-
|
1450 |
-
self::$css_called = true;
|
1451 |
-
}
|
1452 |
-
}
|
1453 |
-
|
1454 |
-
|
1455 |
-
public static function get_testimonials_scripts() {
|
1456 |
-
if ( empty( self::$scripts_called ) ) {
|
1457 |
-
foreach ( self::$scripts as $script )
|
1458 |
-
echo $script;
|
1459 |
-
|
1460 |
-
self::$scripts_called = true;
|
1461 |
-
}
|
1462 |
-
}
|
1463 |
-
|
1464 |
-
|
1465 |
-
/**
|
1466 |
-
*
|
1467 |
-
*
|
1468 |
-
* @SuppressWarnings(PHPMD.UnusedLocalVariable)
|
1469 |
-
*/
|
1470 |
-
public static function get_query_args( $atts ) {
|
1471 |
-
extract( $atts );
|
1472 |
-
|
1473 |
-
if ( has_filter( 'posts_orderby', 'CPTOrderPosts' ) )
|
1474 |
-
remove_filter( 'posts_orderby', 'CPTOrderPosts', 99, 2 );
|
1475 |
-
|
1476 |
-
if ( $random ) {
|
1477 |
-
$orderby = 'rand';
|
1478 |
-
$order = false;
|
1479 |
-
}
|
1480 |
-
|
1481 |
-
$args = array(
|
1482 |
-
'orderby' => $orderby,
|
1483 |
-
'post_status' => array(
|
1484 |
-
'publish',
|
1485 |
-
'private',
|
1486 |
-
),
|
1487 |
-
'post_type' => Testimonials_Widget::PT,
|
1488 |
-
'posts_per_page' => $limit,
|
1489 |
-
);
|
1490 |
-
|
1491 |
-
if ( is_single() ) {
|
1492 |
-
$args['post_status'][] = 'pending';
|
1493 |
-
$args['post_status'][] = 'draft';
|
1494 |
-
}
|
1495 |
-
|
1496 |
-
if ( $paging && ! empty( $atts['paged'] ) && is_singular() )
|
1497 |
-
$args['paged'] = $atts['paged'];
|
1498 |
-
|
1499 |
-
if ( ! $random && $meta_key ) {
|
1500 |
-
$args['meta_key'] = $meta_key;
|
1501 |
-
$args['orderby'] = 'meta_value';
|
1502 |
-
}
|
1503 |
-
|
1504 |
-
if ( $order )
|
1505 |
-
$args['order'] = $order;
|
1506 |
-
|
1507 |
-
if ( $ids ) {
|
1508 |
-
$ids = explode( ',', $ids );
|
1509 |
-
|
1510 |
-
$args['post__in'] = $ids;
|
1511 |
-
|
1512 |
-
if ( 'none' == $args['orderby'] )
|
1513 |
-
add_filter( 'posts_results', array( 'Testimonials_Widget', 'posts_results_sort_none' ), 10, 2 );
|
1514 |
-
}
|
1515 |
-
|
1516 |
-
if ( $exclude ) {
|
1517 |
-
$exclude = explode( ',', $exclude );
|
1518 |
-
$args['post__not_in'] = $exclude;
|
1519 |
-
}
|
1520 |
-
|
1521 |
-
$use_cpt_taxonomy = tw_get_option( 'use_cpt_taxonomy', false );
|
1522 |
-
if ( ! $use_cpt_taxonomy ) {
|
1523 |
-
if ( $category )
|
1524 |
-
$args['category_name'] = $category;
|
1525 |
-
|
1526 |
-
if ( $tags ) {
|
1527 |
-
$tags = explode( ',', $tags );
|
1528 |
-
|
1529 |
-
if ( $tags_all )
|
1530 |
-
$args['tag_slug__and'] = $tags;
|
1531 |
-
else
|
1532 |
-
$args['tag_slug__in'] = $tags;
|
1533 |
-
}
|
1534 |
-
} else {
|
1535 |
-
if ( $category )
|
1536 |
-
$args[ self::$cpt_category ] = $category;
|
1537 |
-
|
1538 |
-
if ( $tags ) {
|
1539 |
-
if ( $tags_all ) {
|
1540 |
-
$args[ 'tax_query' ] = array(
|
1541 |
-
'relation' => 'AND',
|
1542 |
-
);
|
1543 |
-
|
1544 |
-
$tags = explode( ',', $tags );
|
1545 |
-
foreach ( $tags as $term ) {
|
1546 |
-
$args[ 'tax_query' ][] = array(
|
1547 |
-
'taxonomy' => self::$cpt_tags,
|
1548 |
-
'terms' => array( $term ),
|
1549 |
-
'field' => 'slug',
|
1550 |
-
);
|
1551 |
-
}
|
1552 |
-
} else {
|
1553 |
-
$args[ self::$cpt_tags ] = $tags;
|
1554 |
-
}
|
1555 |
-
}
|
1556 |
-
}
|
1557 |
-
|
1558 |
-
$args = apply_filters( 'testimonials_widget_query_args', $args, $atts );
|
1559 |
-
|
1560 |
-
return $args;
|
1561 |
-
}
|
1562 |
-
|
1563 |
-
|
1564 |
-
/**
|
1565 |
-
*
|
1566 |
-
*
|
1567 |
-
* @SuppressWarnings(PHPMD.LongVariable)
|
1568 |
-
*/
|
1569 |
-
public static function get_testimonials( $atts ) {
|
1570 |
-
$hide_gravatar = $atts['hide_gravatar'];
|
1571 |
-
|
1572 |
-
$args = self::get_query_args( $atts );
|
1573 |
-
$args['query'] = true;
|
1574 |
-
|
1575 |
-
$testimonials = apply_filters( 'testimonials_widget_cache_get', false, $args );
|
1576 |
-
if ( false === $testimonials ) {
|
1577 |
-
$testimonials = new WP_Query( $args );
|
1578 |
-
$testimonials = apply_filters( 'testimonials_widget_cache_set', $testimonials, $args );
|
1579 |
-
}
|
1580 |
-
|
1581 |
-
if ( has_filter( 'posts_results', array( 'Testimonials_Widget', 'posts_results_sort_none' ) ) )
|
1582 |
-
remove_filter( 'posts_results', array( 'Testimonials_Widget', 'posts_results_sort_none' ) );
|
1583 |
-
|
1584 |
-
self::$max_num_pages = $testimonials->max_num_pages;
|
1585 |
-
self::$found_posts = $testimonials->found_posts;
|
1586 |
-
self::$post_count = $testimonials->post_count;
|
1587 |
-
self::$wp_query = $testimonials;
|
1588 |
-
|
1589 |
-
wp_reset_postdata();
|
1590 |
-
|
1591 |
-
$image_size = apply_filters( 'testimonials_widget_image_size', 'thumbnail' );
|
1592 |
-
if ( ! is_array( $image_size ) ) {
|
1593 |
-
global $_wp_additional_image_sizes;
|
1594 |
-
if ( ! empty( $_wp_additional_image_sizes[ $image_size ] ) )
|
1595 |
-
$gravatar_size = $_wp_additional_image_sizes[ $image_size ]['width'];
|
1596 |
-
else
|
1597 |
-
$gravatar_size = get_option( $image_size . '_size_w' );
|
1598 |
-
|
1599 |
-
$gravatar_size = apply_filters( 'testimonials_widget_gravatar_size', $gravatar_size );
|
1600 |
-
} else
|
1601 |
-
$gravatar_size = apply_filters( 'testimonials_widget_gravatar_size', $image_size );
|
1602 |
-
|
1603 |
-
$testimonial_data = array();
|
1604 |
-
|
1605 |
-
if ( empty( self::$post_count ) )
|
1606 |
-
return $testimonial_data;
|
1607 |
-
|
1608 |
-
foreach ( $testimonials->posts as $row ) {
|
1609 |
-
$post_id = $row->ID;
|
1610 |
-
$email = get_post_meta( $post_id, 'testimonials-widget-email', true );
|
1611 |
-
|
1612 |
-
if ( has_post_thumbnail( $post_id ) ) {
|
1613 |
-
$image = get_the_post_thumbnail( $post_id, $image_size );
|
1614 |
-
} elseif ( ! $hide_gravatar && is_email( $email ) ) {
|
1615 |
-
$image = get_avatar( $email, $gravatar_size );
|
1616 |
-
|
1617 |
-
self::make_gravatar_featured( $post_id, $email );
|
1618 |
-
} else {
|
1619 |
-
$image = false;
|
1620 |
-
}
|
1621 |
-
|
1622 |
-
$image = self::strip_protocol( $image );
|
1623 |
-
|
1624 |
-
$url = get_post_meta( $post_id, 'testimonials-widget-url', true );
|
1625 |
-
if ( ! empty( $url ) && 0 === preg_match( '#https?://#', $url ) )
|
1626 |
-
$url = 'http://' . $url;
|
1627 |
-
|
1628 |
-
$data = array(
|
1629 |
-
'post_id' => $post_id,
|
1630 |
-
'testimonial_company' => get_post_meta( $post_id, 'testimonials-widget-company', true ),
|
1631 |
-
'testimonial_content' => $row->post_content,
|
1632 |
-
'testimonial_email' => $email,
|
1633 |
-
'testimonial_extra' => '',
|
1634 |
-
'testimonial_image' => $image,
|
1635 |
-
'testimonial_location' => get_post_meta( $post_id, 'testimonials-widget-location', true ),
|
1636 |
-
'testimonial_source' => $row->post_title,
|
1637 |
-
'testimonial_title' => get_post_meta( $post_id, 'testimonials-widget-title', true ),
|
1638 |
-
'testimonial_url' => $url,
|
1639 |
-
);
|
1640 |
-
|
1641 |
-
$testimonial_data[] = $data;
|
1642 |
-
}
|
1643 |
-
|
1644 |
-
$testimonial_data = apply_filters( 'testimonials_widget_data', $testimonial_data, $atts );
|
1645 |
-
|
1646 |
-
return $testimonial_data;
|
1647 |
-
}
|
1648 |
-
|
1649 |
-
|
1650 |
-
public static function posts_results_sort_none( $posts, $query ) {
|
1651 |
-
$order = $query->query_vars['post__in'];
|
1652 |
-
if ( empty( $order ) )
|
1653 |
-
return $posts;
|
1654 |
-
|
1655 |
-
$posts_none_sorted = array();
|
1656 |
-
// put posts in same orders as post__in
|
1657 |
-
foreach ( $order as $id ) {
|
1658 |
-
foreach ( $posts as $key => $post ) {
|
1659 |
-
if ( $id == $post->ID ) {
|
1660 |
-
$posts_none_sorted[] = $post;
|
1661 |
-
unset( $posts[$key] );
|
1662 |
-
}
|
1663 |
-
}
|
1664 |
-
}
|
1665 |
-
|
1666 |
-
return $posts_none_sorted;
|
1667 |
-
}
|
1668 |
-
|
1669 |
-
|
1670 |
-
public static function widgets_init() {
|
1671 |
-
register_widget( 'Testimonials_Widget_Widget' );
|
1672 |
-
}
|
1673 |
-
|
1674 |
-
|
1675 |
-
/**
|
1676 |
-
*
|
1677 |
-
*
|
1678 |
-
* @SuppressWarnings(PHPMD.UnusedLocalVariable)
|
1679 |
-
*/
|
1680 |
-
public static function add_meta_box_testimonials_widget() {
|
1681 |
-
$fields = array(
|
1682 |
-
array(
|
1683 |
-
'name' => esc_html__( 'Job Title', 'testimonials-widget' ),
|
1684 |
-
'id' => 'testimonials-widget-title',
|
1685 |
-
'type' => 'text',
|
1686 |
-
'desc' => '',
|
1687 |
-
),
|
1688 |
-
array(
|
1689 |
-
'name' => esc_html__( 'Location', 'testimonials-widget' ),
|
1690 |
-
'id' => 'testimonials-widget-location',
|
1691 |
-
'type' => 'text',
|
1692 |
-
'desc' => '',
|
1693 |
-
),
|
1694 |
-
array(
|
1695 |
-
'name' => esc_html__( 'Email', 'testimonials-widget' ),
|
1696 |
-
'id' => 'testimonials-widget-email',
|
1697 |
-
'type' => 'text',
|
1698 |
-
'desc' => '',
|
1699 |
-
),
|
1700 |
-
array(
|
1701 |
-
'name' => esc_html__( 'Company', 'testimonials-widget' ),
|
1702 |
-
'id' => 'testimonials-widget-company',
|
1703 |
-
'type' => 'text',
|
1704 |
-
'desc' => '',
|
1705 |
-
),
|
1706 |
-
array(
|
1707 |
-
'name' => esc_html__( 'URL', 'testimonials-widget' ),
|
1708 |
-
'id' => 'testimonials-widget-url',
|
1709 |
-
'type' => 'text',
|
1710 |
-
'desc' => '',
|
1711 |
-
),
|
1712 |
-
);
|
1713 |
-
|
1714 |
-
$fields = apply_filters( 'testimonials_widget_meta_box', $fields );
|
1715 |
-
|
1716 |
-
$meta_box = redrokk_metabox_class::getInstance(
|
1717 |
-
self::ID,
|
1718 |
-
array(
|
1719 |
-
'title' => esc_html__( 'Testimonial Data', 'testimonials-widget' ),
|
1720 |
-
'description' => '',
|
1721 |
-
'_object_types' => 'testimonials-widget',
|
1722 |
-
'priority' => 'high',
|
1723 |
-
'_fields' => $fields,
|
1724 |
-
)
|
1725 |
-
);
|
1726 |
-
}
|
1727 |
-
|
1728 |
-
|
1729 |
-
/**
|
1730 |
-
* Revise default new testimonial text
|
1731 |
-
*
|
1732 |
-
* Original author: Travis Ballard http://www.travisballard.com
|
1733 |
-
*
|
1734 |
-
* @param string $translation
|
1735 |
-
* @return string $translation
|
1736 |
-
*/
|
1737 |
-
public static function gettext_testimonials( $translation ) {
|
1738 |
-
remove_action( 'gettext', array( __CLASS__, 'gettext_testimonials' ) );
|
1739 |
-
|
1740 |
-
global $post;
|
1741 |
-
|
1742 |
-
if ( is_object( $post ) && self::PT == $post->post_type ) {
|
1743 |
-
switch ( $translation ) {
|
1744 |
-
case esc_html__( 'Enter title here', 'testimonials-widget' ):
|
1745 |
-
return esc_html__( 'Enter testimonial source here', 'testimonials-widget' );
|
1746 |
-
break;
|
1747 |
-
}
|
1748 |
-
}
|
1749 |
-
|
1750 |
-
add_action( 'gettext', array( __CLASS__, 'gettext_testimonials' ) );
|
1751 |
-
|
1752 |
-
return $translation;
|
1753 |
-
}
|
1754 |
-
|
1755 |
-
|
1756 |
-
/**
|
1757 |
-
* Update messages for custom post type
|
1758 |
-
*
|
1759 |
-
* Original author: Travis Ballard http://www.travisballard.com
|
1760 |
-
*
|
1761 |
-
* @SuppressWarnings(PHPMD.Superglobals)
|
1762 |
-
* @param mixed $m
|
1763 |
-
* @return mixed $m
|
1764 |
-
*/
|
1765 |
-
public static function post_updated_messages( $m ) {
|
1766 |
-
global $post;
|
1767 |
-
|
1768 |
-
$m[ self::PT ] = array(
|
1769 |
-
0 => '', // Unused. Messages start at index 1.
|
1770 |
-
1 => sprintf( __( 'Testimonial updated. <a href="%s">View testimonial</a>', 'testimonials-widget' ), esc_url( get_permalink( $post->ID ) ) ),
|
1771 |
-
2 => esc_html__( 'Custom field updated.', 'testimonials-widget' ),
|
1772 |
-
3 => esc_html__( 'Custom field deleted.', 'testimonials-widget' ),
|
1773 |
-
4 => esc_html__( 'Testimonial updated.', 'testimonials-widget' ),
|
1774 |
-
/* translators: %s: date and time of the revision */
|
1775 |
-
5 => isset( $_GET['revision'] ) ? sprintf( esc_html__( 'Testimonial restored to revision from %s', 'testimonials-widget' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
|
1776 |
-
6 => sprintf( __( 'Testimonial published. <a href="%s">View testimonial</a>', 'testimonials-widget' ), esc_url( get_permalink( $post->ID ) ) ),
|
1777 |
-
7 => esc_html__( 'Testimonial saved.', 'testimonials-widget' ),
|
1778 |
-
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 ) ) ) ),
|
1779 |
-
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 ) ) ),
|
1780 |
-
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 ) ) ) )
|
1781 |
-
);
|
1782 |
-
|
1783 |
-
return $m;
|
1784 |
-
}
|
1785 |
-
|
1786 |
-
|
1787 |
-
public static function right_now_content_table_end() {
|
1788 |
-
$content = '
|
1789 |
-
<tr>
|
1790 |
-
<td class="first b b-%1$s">%4$s%2$s%5$s</td>
|
1791 |
-
<td class="t %1$s">%4$s%3$s%5$s</td>
|
1792 |
-
</tr>';
|
1793 |
-
$posts = wp_count_posts( Testimonials_Widget::PT );
|
1794 |
-
$count = $posts->publish;
|
1795 |
-
$name = _n( 'Testimonial', 'Testimonials', $count, 'testimonials-widget' );
|
1796 |
-
$count_f = number_format_i18n( $count );
|
1797 |
-
$a_open = '<a href="edit.php?post_type=' . Testimonials_Widget::PT . '">';
|
1798 |
-
$a_close = '</a>';
|
1799 |
-
|
1800 |
-
if ( current_user_can( 'edit_others_posts' ) )
|
1801 |
-
$result = sprintf( $content, Testimonials_Widget::PT, $count_f, $name, $a_open, $a_close );
|
1802 |
-
else
|
1803 |
-
$result = sprintf( $content, Testimonials_Widget::PT, $count_f, $name, '', '' );
|
1804 |
-
|
1805 |
-
echo $result;
|
1806 |
-
}
|
1807 |
-
|
1808 |
-
|
1809 |
-
/**
|
1810 |
-
*
|
1811 |
-
*
|
1812 |
-
* @SuppressWarnings(PHPMD.UnusedLocalVariable)
|
1813 |
-
*/
|
1814 |
-
public static function get_schema( $testimonial, $atts ) {
|
1815 |
-
foreach ( $testimonial as $key => $value ) {
|
1816 |
-
if ( 'testimonial_image' != $key )
|
1817 |
-
$testimonial[ $key ] = self::clean_string( $value );
|
1818 |
-
}
|
1819 |
-
|
1820 |
-
extract( $testimonial );
|
1821 |
-
|
1822 |
-
$do_company = ! $atts['hide_company'] && ! empty( $testimonial_company );
|
1823 |
-
$do_content = ! empty( $testimonial['testimonial_content'] );
|
1824 |
-
$do_email = ! $atts['hide_email'] && ! empty( $testimonial_email ) && is_email( $testimonial_email );
|
1825 |
-
$do_image = ! $atts['hide_image'] && ! empty( $testimonial_image );
|
1826 |
-
$do_location = ! $atts['hide_location'] && ! empty( $testimonial_location );
|
1827 |
-
$do_source = ! $atts['hide_source'] && ! empty( $testimonial_source );
|
1828 |
-
$do_title = ! $atts['hide_title'] && ! empty( $testimonial_title );
|
1829 |
-
$do_url = ! $atts['hide_url'] && ! empty( $testimonial_url );
|
1830 |
-
|
1831 |
-
$item_reviewed = self::clean_string( $atts['item_reviewed'] );
|
1832 |
-
$item_reviewed_url = self::clean_string( $atts['item_reviewed_url'] );
|
1833 |
-
|
1834 |
-
$schema = '<div style="display: none;">';
|
1835 |
-
$schema .= "\n";
|
1836 |
-
|
1837 |
-
$agg_meta = array();
|
1838 |
-
$author_meta = array();
|
1839 |
-
$item_meta = array();
|
1840 |
-
$location_meta = array();
|
1841 |
-
$org_meta = array();
|
1842 |
-
$review_meta = array();
|
1843 |
-
|
1844 |
-
if ( $do_source )
|
1845 |
-
$author_meta[ self::$thing_name ] = $testimonial_source;
|
1846 |
-
|
1847 |
-
if ( $do_title )
|
1848 |
-
$author_meta[ self::$person_job_title ] = $testimonial_title;
|
1849 |
-
|
1850 |
-
if ( $do_email )
|
1851 |
-
$author_meta[ self::$person_email ] = $testimonial_email;
|
1852 |
-
|
1853 |
-
if ( ! $do_company ) {
|
1854 |
-
if ( $do_url )
|
1855 |
-
$author_meta[ self::$thing_url ] = $testimonial_url;
|
1856 |
-
} else {
|
1857 |
-
if ( $do_url )
|
1858 |
-
$org_meta[ self::$thing_url ] = $testimonial_url;
|
1859 |
-
|
1860 |
-
$org_meta[ self::$thing_name ] = $testimonial_company;
|
1861 |
-
}
|
1862 |
-
|
1863 |
-
if ( $do_location ) {
|
1864 |
-
$location_meta[ self::$thing_name ] = $testimonial_location;
|
1865 |
-
|
1866 |
-
if ( ! $do_company )
|
1867 |
-
$author_meta[ self::$person_home ] = array( self::$place_schema, $location_meta );
|
1868 |
-
else
|
1869 |
-
$org_meta[ self::$org_location ] = array( self::$place_schema, $location_meta );
|
1870 |
-
}
|
1871 |
-
|
1872 |
-
if ( ! empty( $author_meta ) && ! empty( $org_meta ) )
|
1873 |
-
$author_meta[ self::$person_member ] = array( self::$org_schema, $org_meta );
|
1874 |
-
elseif ( ! empty( $org_meta ) )
|
1875 |
-
$author_meta[ self::$cw_source_org ] = array( self::$org_schema, $org_meta );
|
1876 |
-
|
1877 |
-
$author_meta = apply_filters( 'testimonials_widget_schema_author', $author_meta, $testimonial, $atts );
|
1878 |
-
$author = self::create_schema_div_prop( self::$cw_author, self::$person_schema, $author_meta );
|
1879 |
-
$schema .= $author;
|
1880 |
-
$schema .= "\n";
|
1881 |
-
|
1882 |
-
$post = get_post( $testimonial['post_id'] );
|
1883 |
-
$the_date = mysql2date( 'Y-m-d', $post->post_date );
|
1884 |
-
$the_date_mod = mysql2date( 'Y-m-d', $post->post_modified );
|
1885 |
-
|
1886 |
-
$review_name_length = apply_filters( 'testimonials_widget_review_name_length', 156 );
|
1887 |
-
|
1888 |
-
if ( $do_content )
|
1889 |
-
$review_meta[ self::$review_body ] = $testimonial['testimonial_content'];
|
1890 |
-
|
1891 |
-
$review_meta[ self::$cw_date ] = $the_date;
|
1892 |
-
$review_meta[ self::$cw_date_mod ] = $the_date_mod;
|
1893 |
-
$review_meta[ self::$thing_name ] = self::testimonials_truncate( $testimonial_content, $review_name_length );
|
1894 |
-
$review_meta[ self::$thing_url ] = post_permalink( $post->ID );
|
1895 |
-
|
1896 |
-
if ( $do_image ) {
|
1897 |
-
$src = self::get_image_src( $testimonial_image );
|
1898 |
-
|
1899 |
-
$review_meta[ self::$thing_image ] = $src;
|
1900 |
-
}
|
1901 |
-
|
1902 |
-
$review_meta = apply_filters( 'testimonials_widget_schema_review', $review_meta, $testimonial, $atts );
|
1903 |
-
$review = self::create_schema_meta( $review_meta );
|
1904 |
-
$schema .= $review;
|
1905 |
-
$schema .= "\n";
|
1906 |
-
|
1907 |
-
$agg_meta[ self::$agg_count ] = self::$found_posts;
|
1908 |
-
|
1909 |
-
$agg_meta = apply_filters( 'testimonials_widget_schema_aggregate', $agg_meta, $testimonial, $atts );
|
1910 |
-
$aggregate = self::create_schema_div_prop( self::$cw_aggregate, self::$agg_schema, $agg_meta );
|
1911 |
-
$schema .= $aggregate;
|
1912 |
-
$schema .= "\n";
|
1913 |
-
|
1914 |
-
$item_meta[ self::$thing_name ] = $item_reviewed;
|
1915 |
-
$item_meta[ self::$thing_url ] = $item_reviewed_url;
|
1916 |
-
|
1917 |
-
$item_meta = apply_filters( 'testimonials_widget_schema_item', $item_meta, $testimonial, $atts );
|
1918 |
-
$item = self::create_schema_div_prop( self::$review_item, self::$thing_schema, $item_meta );
|
1919 |
-
$schema .= $item;
|
1920 |
-
$schema .= "\n";
|
1921 |
-
|
1922 |
-
$schema .= '</div>';
|
1923 |
-
$schema .= "\n";
|
1924 |
-
|
1925 |
-
$schema = apply_filters( 'testimonials_widget_schema', $schema, $testimonial, $atts );
|
1926 |
-
|
1927 |
-
return $schema;
|
1928 |
-
}
|
1929 |
-
|
1930 |
-
|
1931 |
-
public static function create_schema_meta( $meta_data ) {
|
1932 |
-
$meta = '';
|
1933 |
-
|
1934 |
-
if ( empty( $meta_data ) )
|
1935 |
-
return $meta;
|
1936 |
-
|
1937 |
-
foreach ( $meta_data as $key => $value ) {
|
1938 |
-
if ( is_array( $value ) )
|
1939 |
-
$meta .= self::create_schema_div_prop( $key, $value[ 0 ], $value[ 1 ] );
|
1940 |
-
else
|
1941 |
-
$meta .= sprintf( self::$schema_meta, $key, $value );
|
1942 |
-
|
1943 |
-
$meta .= "\n";
|
1944 |
-
}
|
1945 |
-
|
1946 |
-
return $meta;
|
1947 |
-
}
|
1948 |
-
|
1949 |
-
|
1950 |
-
public static function create_schema_span( $property_name, $span_data ) {
|
1951 |
-
$span = '';
|
1952 |
-
|
1953 |
-
if ( empty( $span_data ) )
|
1954 |
-
return $span;
|
1955 |
-
|
1956 |
-
$span = sprintf( self::$schema_span, $property_name, $span_data );
|
1957 |
-
|
1958 |
-
return $span;
|
1959 |
-
}
|
1960 |
-
|
1961 |
-
|
1962 |
-
public static function create_schema_div_prop( $property_name, $schema_name, $meta_data ) {
|
1963 |
-
$meta = '';
|
1964 |
-
$schema = '';
|
1965 |
-
|
1966 |
-
if ( empty( $meta_data ) )
|
1967 |
-
return $schema;
|
1968 |
-
|
1969 |
-
if ( is_array( $meta_data ) ) {
|
1970 |
-
foreach ( $meta_data as $key => $value ) {
|
1971 |
-
if ( is_array( $value ) )
|
1972 |
-
$meta .= self::create_schema_div_prop( $key, $value[ 0 ], $value[ 1 ] );
|
1973 |
-
else
|
1974 |
-
$meta .= sprintf( self::$schema_meta, $key, $value );
|
1975 |
-
|
1976 |
-
$meta .= "\n";
|
1977 |
-
}
|
1978 |
-
|
1979 |
-
$schema = sprintf( self::$schema_div_prop, $property_name, $schema_name, $meta );
|
1980 |
-
} else
|
1981 |
-
$schema = sprintf( self::$schema_div_prop, $property_name, $schema_name, $meta_data );
|
1982 |
-
|
1983 |
-
return $schema;
|
1984 |
-
}
|
1985 |
-
|
1986 |
-
|
1987 |
-
public static function generate_css( $atts, $widget_number = null ) {
|
1988 |
-
$atts['subtype'] = 'css';
|
1989 |
-
|
1990 |
-
$css = apply_filters( 'testimonials_widget_cache_get', false, $atts );
|
1991 |
-
if ( false === $css ) {
|
1992 |
-
$css = self::get_testimonials_html_css( $atts, $widget_number );
|
1993 |
-
$css = apply_filters( 'testimonials_widget_cache_set', $css, $atts );
|
1994 |
-
}
|
1995 |
-
|
1996 |
-
if ( ! empty( $css ) ) {
|
1997 |
-
self::$css = array_merge( $css, self::$css );
|
1998 |
-
add_action( 'wp_footer', array( 'Testimonials_Widget', 'get_testimonials_css' ), 20 );
|
1999 |
-
}
|
2000 |
-
}
|
2001 |
-
|
2002 |
-
|
2003 |
-
public static function generate_js( $testimonials, $atts, $widget_number = null ) {
|
2004 |
-
$atts['subtype'] = 'js';
|
2005 |
-
|
2006 |
-
$js = apply_filters( 'testimonials_widget_cache_get', false, $atts );
|
2007 |
-
if ( false === $js ) {
|
2008 |
-
$js = self::get_testimonials_html_js( $testimonials, $atts, $widget_number );
|
2009 |
-
$js = apply_filters( 'testimonials_widget_cache_set', $js, $atts );
|
2010 |
-
}
|
2011 |
-
|
2012 |
-
if ( ! empty( $js ) ) {
|
2013 |
-
self::$scripts = array_merge( $js, self::$scripts );
|
2014 |
-
add_action( 'wp_footer', array( 'Testimonials_Widget', 'get_testimonials_scripts' ), 20 );
|
2015 |
-
}
|
2016 |
-
}
|
2017 |
-
|
2018 |
-
|
2019 |
-
public static function call_scripts_styles( $testimonials, $atts, $widget_number = null ) {
|
2020 |
-
if ( is_null( $widget_number ) )
|
2021 |
-
$widget_number = Testimonials_Widget::get_instance();
|
2022 |
-
|
2023 |
-
self::scripts( $atts );
|
2024 |
-
|
2025 |
-
self::generate_css( $atts );
|
2026 |
-
self::generate_js( $testimonials, $atts, $widget_number );
|
2027 |
-
}
|
2028 |
-
|
2029 |
-
|
2030 |
-
public static function make_gravatar_featured( $post_id, $email ) {
|
2031 |
-
$size = get_option( 'large_size_w' );
|
2032 |
-
$image = get_avatar( $email, $size );
|
2033 |
-
$src = self::get_image_src( $image, false );
|
2034 |
-
$file = sanitize_title( $email ) . '.jpeg';
|
2035 |
-
|
2036 |
-
self::add_media( $post_id, $src, $file );
|
2037 |
-
}
|
2038 |
-
|
2039 |
-
|
2040 |
-
public static function notice_2_15_0() {
|
2041 |
-
$text = sprintf( __( 'If your Testimonials display has gone to funky town, please <a href="%s">read the FAQ</a> about possible fixes.', 'testimonials-widget' ), esc_url( 'https://aihrus.zendesk.com/entries/28402246-Major-Change-for-2-15-0' ) );
|
2042 |
-
|
2043 |
-
aihr_notice_updated( $text );
|
2044 |
-
}
|
2045 |
-
|
2046 |
-
|
2047 |
-
public static function show_shortcodes() {
|
2048 |
-
echo '<div class="wrap">';
|
2049 |
-
echo '<div class="icon32" id="icon-options-general"></div>';
|
2050 |
-
echo '<h2>' . esc_html__( 'Testimonials Shortcode Examples', 'testimonials-widget' ) . '</h2>';
|
2051 |
-
|
2052 |
-
$shortcodes = <<<EOD
|
2053 |
-
<h3>[testimonials]</h3>
|
2054 |
-
|
2055 |
-
<ul>
|
2056 |
-
<li><code>[testimonials category="category-name"]</code> - Testimonial list by category</li>
|
2057 |
-
<li><code>[testimonials category=product hide_not_found=true]</code> - Testimonial list by category and hide "No testimonials found" message</li>
|
2058 |
-
<li><code>[testimonials category=product tags=widget limit=5]</code> - Testimonial list by tag, showing 5 at most</li>
|
2059 |
-
<li><code>[testimonials char_limit=0 limit=-1]</code> - Show all testimonials on one page</li>
|
2060 |
-
<li><code>[testimonials char_limit=0 target=_new limit=3 disable_quotes=true]</code> - Show 3 full-length testimonials, with opening and closing quote marks removed</li>
|
2061 |
-
<li><code>[testimonials hide_source=true hide_url=true]</code> - Show testimonial list with source and urls hidden</li>
|
2062 |
-
<li><code>[testimonials ids="1,11,111" paging=false]</code> - Show only these 3 testimonials</li>
|
2063 |
-
<li><code>[testimonials meta_key=testimonials-widget-company order=asc limit=15]</code> - Show 15 testimonials, in company order</li>
|
2064 |
-
<li><code>[testimonials order=ASC orderby=title]</code> - List testimonials by post title</li>
|
2065 |
-
<li><code>[testimonials tags="test,fun" random=true exclude="2,22,333"]</code> - Select testimonials tagged with either "test" or "fun", in random order, but ignore those of the excluded ids</li>
|
2066 |
-
</ul>
|
2067 |
-
|
2068 |
-
<h3>[testimonials_slider]</h3>
|
2069 |
-
|
2070 |
-
<ul>
|
2071 |
-
<li><code>[testimonials_slider category=product order=asc]</code> - Show rotating testimonials, of the product category, lowest post ids first</li>
|
2072 |
-
<li><code>[testimonials_slider tags=sometag random=true]</code> - Show rotating, random testimonials having tag "sometag"</li>
|
2073 |
-
</ul>
|
2074 |
-
EOD;
|
2075 |
-
|
2076 |
-
$shortcodes = apply_filters( 'testimonials_widget_shortcodes', $shortcodes );
|
2077 |
-
|
2078 |
-
echo $shortcodes;
|
2079 |
-
echo '</div>';
|
2080 |
-
}
|
2081 |
-
|
2082 |
-
|
2083 |
-
public static function set_not_found( $not_found = false ) {
|
2084 |
-
self::$not_found = $not_found;
|
2085 |
-
}
|
2086 |
-
|
2087 |
-
|
2088 |
-
public static function get_not_found() {
|
2089 |
-
return self::$not_found;
|
2090 |
-
}
|
2091 |
-
|
2092 |
-
|
2093 |
-
public static function version_check() {
|
2094 |
-
$valid_version = true;
|
2095 |
-
if ( ! $valid_version ) {
|
2096 |
-
$deactivate_reason = esc_html__( 'Failed version check', 'testimonials-widget' );
|
2097 |
-
aihr_deactivate_plugin( self::BASE, TW_NAME, $deactivate_reason );
|
2098 |
-
self::check_notices();
|
2099 |
-
}
|
2100 |
-
|
2101 |
-
return $valid_version;
|
2102 |
-
}
|
2103 |
-
|
2104 |
-
|
2105 |
-
/**
|
2106 |
-
*
|
2107 |
-
*
|
2108 |
-
* @SuppressWarnings(PHPMD.Superglobals)
|
2109 |
-
*/
|
2110 |
-
public static function do_load() {
|
2111 |
-
$do_load = false;
|
2112 |
-
if ( ! empty( $GLOBALS['pagenow'] ) && in_array( $GLOBALS['pagenow'], array( 'options.php' ) ) ) {
|
2113 |
-
$do_load = true;
|
2114 |
-
} elseif ( ! empty( $_REQUEST['post_type'] ) && self::PT == $_REQUEST['post_type'] ) {
|
2115 |
-
if ( ! empty( $GLOBALS['pagenow'] ) && in_array( $GLOBALS['pagenow'], array( 'edit.php', 'edit-tags.php' ) ) ) {
|
2116 |
-
$do_load = true;
|
2117 |
-
} elseif ( ! empty( $_REQUEST['page'] ) && Testimonials_Widget_Settings::ID == $_REQUEST['page'] ) {
|
2118 |
-
$do_load = true;
|
2119 |
-
}
|
2120 |
-
}
|
2121 |
-
|
2122 |
-
return $do_load;
|
2123 |
-
}
|
2124 |
-
|
2125 |
-
|
2126 |
-
public static function category_columns( $columns ) {
|
2127 |
-
$columns['shortcode'] = esc_html__( 'Shortcode', 'testimonials-widget' );
|
2128 |
-
|
2129 |
-
return $columns;
|
2130 |
-
}
|
2131 |
-
|
2132 |
-
|
2133 |
-
public static function category_column( $result, $column_name, $term_id, $category = true ) {
|
2134 |
-
$attribute = $category ? 'category' : 'tags';
|
2135 |
-
|
2136 |
-
$use_cpt_taxonomy = tw_get_option( 'use_cpt_taxonomy', false );
|
2137 |
-
if ( ! $use_cpt_taxonomy ) {
|
2138 |
-
if ( $category )
|
2139 |
-
$term = get_term( $term_id, 'category' );
|
2140 |
-
else
|
2141 |
-
$term = get_term( $term_id, 'post_tag' );
|
2142 |
-
} else {
|
2143 |
-
if ( $category )
|
2144 |
-
$term = get_term( $term_id, self::$cpt_category );
|
2145 |
-
else
|
2146 |
-
$term = get_term( $term_id, self::$cpt_tags );
|
2147 |
-
}
|
2148 |
-
|
2149 |
-
switch ( $column_name ) {
|
2150 |
-
case 'shortcode':
|
2151 |
-
$result = '[testimonials ' . $attribute . '="' .$term->slug . '"]';
|
2152 |
-
$result .= '<br />';
|
2153 |
-
$result .= '[testimonials_slider ' . $attribute . '="' .$term->slug . '"]';
|
2154 |
-
break;
|
2155 |
-
}
|
2156 |
-
|
2157 |
-
return $result;
|
2158 |
-
}
|
2159 |
-
|
2160 |
-
|
2161 |
-
public static function post_tag_column( $result, $column_name, $term_id ) {
|
2162 |
-
return self::category_column( $result, $column_name, $term_id, false );
|
2163 |
-
}
|
2164 |
-
}
|
2165 |
-
|
2166 |
-
|
2167 |
-
?>
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trunk/includes/libraries/aihrus-framework/CHANGELOG.md
DELETED
@@ -1,96 +0,0 @@
|
|
1 |
-
# CHANGELOG Aihrus Framework
|
2 |
-
|
3 |
-
## master
|
4 |
-
|
5 |
-
## 1.1.1
|
6 |
-
* Remove unused `widget_options`
|
7 |
-
* RESOLVE michael-cannon/testimonials-widget#65 Widget blank options aren't saving correctly
|
8 |
-
|
9 |
-
## 1.1.0
|
10 |
-
* Abstract deactivate_plugins actual to aihr_deactivate_plugin_do
|
11 |
-
* Add class redrokk_metabox_class
|
12 |
-
* Add class wp_custom_post_status
|
13 |
-
* Add date, time, and datetime types to redrokk_metabox_class
|
14 |
-
* Add rich_editor type
|
15 |
-
* Add validate_email
|
16 |
-
* Consolidate deactivate_plugins activity into aihr_deactivate_plugin
|
17 |
-
* Don't esc_attr rich editor value
|
18 |
-
* Limit wp_custom_post_status to post type
|
19 |
-
* Move classes/interfaces to includes
|
20 |
-
* Register `jquery-style`
|
21 |
-
* Rename requirements.php to aihrus-framework.php
|
22 |
-
* RESOLVE michael-cannon/testimonials-widget#63 Unable to activate premium license
|
23 |
-
* RESOLVE michael-cannon/testimonials-widget#65 Widget blank options aren't saving correctly
|
24 |
-
* RESOLVE michael-cannon/testimonials-widget#76 Undefined index: hide_image_single
|
25 |
-
* RESOLVE redrokk_metabox_class prepare warning
|
26 |
-
* Revise get_styles handling
|
27 |
-
* Set AIHR_DIR* helpers
|
28 |
-
* Set defaults for validators
|
29 |
-
* Set premium license key for 2 years though it expires at 1
|
30 |
-
* Update copyright year
|
31 |
-
|
32 |
-
## 1.0.3
|
33 |
-
* RESOLVE Fatal error: Call to undefined function add_settings_error() in class-aihrus-settings.php on line 559
|
34 |
-
* RESOLVE Featured image via Gravatar not saving correctly
|
35 |
-
* Revise data deletion description - Thank you Mark
|
36 |
-
|
37 |
-
## 1.0.2
|
38 |
-
* Add phpunit.xml
|
39 |
-
* Add `slash_sanitize_title` verification helper
|
40 |
-
* Coding standards
|
41 |
-
* Display "Settings saved."
|
42 |
-
* Move ci to tests
|
43 |
-
* Remove Travis configuration
|
44 |
-
* RESOLVE michael-cannon/testimonials-widget#48 Activation on WP 3.6 not working
|
45 |
-
* RESOLVE michael-cannon/wootheme-testimonials-to-testimonials#2 No settings saved notice upon saving settings
|
46 |
-
* Update usage instructions
|
47 |
-
* Use $plugin_assets than $plugin_path
|
48 |
-
|
49 |
-
## 1.0.1
|
50 |
-
* Add strip_protocol
|
51 |
-
* Add valid_hash check
|
52 |
-
* Move relicensing to plugin level
|
53 |
-
|
54 |
-
## 1.0.0
|
55 |
-
* Enable aihr_check_aihrus_framework
|
56 |
-
|
57 |
-
## 0.0.0
|
58 |
-
* Abstract notice helper methods as functions
|
59 |
-
* Add TODO
|
60 |
-
* Add `add_media` post attachment helper
|
61 |
-
* Add `clean_string` trim, strip_shortcodes, and strip_tags a string
|
62 |
-
* Add `create_link( $link )`
|
63 |
-
* Add `create_nonce( $action )`
|
64 |
-
* Add `file_get_contents_curl`
|
65 |
-
* Add `get_image_src`
|
66 |
-
* Add `is_true`, terms, url validate cases
|
67 |
-
* Add `truncate`
|
68 |
-
* Add `verify_nonce( $nonce, $action )`
|
69 |
-
* Add abstract class Aihrus_Settings
|
70 |
-
* Add abstract class Aihrus_Widget
|
71 |
-
* Add aihr_notice_license
|
72 |
-
* Add name filed to aihr_check_php
|
73 |
-
* Add requirements helper
|
74 |
-
* Add shortcode id helpers
|
75 |
-
* Allow reset_defaults in widget
|
76 |
-
* BUGFIX Method version not static
|
77 |
-
* BUGFIX Widget title is same as link
|
78 |
-
* CLOSES #2 Disable purchase premium links if premium is active
|
79 |
-
* Check for PHP 5.3
|
80 |
-
* Convert TODO to https://github.com/michael-cannon/aihrus-framework/issues
|
81 |
-
* Display option values as is
|
82 |
-
* Encase pronouns in double-quotes
|
83 |
-
* RESOLVES #1 PHP Version checking
|
84 |
-
* RESOLVES #3 Add WordPress version check
|
85 |
-
* Remove unused methods
|
86 |
-
* Rename $options[$id] to $field_value
|
87 |
-
* Rename no_code to show_code
|
88 |
-
* Revise create_link parameters
|
89 |
-
* Settings link with null post_type
|
90 |
-
* Switch from require_once to require file inclusion
|
91 |
-
* Use `aihr_` as function prefix
|
92 |
-
* Widget title uses create_link
|
93 |
-
* static::ITEM_NAME to static::NAME
|
94 |
-
|
95 |
-
## 0.0.0
|
96 |
-
* Initial code release
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trunk/includes/libraries/aihrus-framework/LICENSE
DELETED
@@ -1,339 +0,0 @@
|
|
1 |
-
GNU GENERAL PUBLIC LICENSE
|
2 |
-
Version 2, June 1991
|
3 |
-
|
4 |
-
Copyright (C) 1989, 1991 Free Software Foundation, Inc., <http://fsf.org/>
|
5 |
-
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
6 |
-
Everyone is permitted to copy and distribute verbatim copies
|
7 |
-
of this license document, but changing it is not allowed.
|
8 |
-
|
9 |
-
Preamble
|
10 |
-
|
11 |
-
The licenses for most software are designed to take away your
|
12 |
-
freedom to share and change it. By contrast, the GNU General Public
|
13 |
-
License is intended to guarantee your freedom to share and change free
|
14 |
-
software--to make sure the software is free for all its users. This
|
15 |
-
General Public License applies to most of the Free Software
|
16 |
-
Foundation's software and to any other program whose authors commit to
|
17 |
-
using it. (Some other Free Software Foundation software is covered by
|
18 |
-
the GNU Lesser General Public License instead.) You can apply it to
|
19 |
-
your programs, too.
|
20 |
-
|
21 |
-
When we speak of free software, we are referring to freedom, not
|
22 |
-
price. Our General Public Licenses are designed to make sure that you
|
23 |
-
have the freedom to distribute copies of free software (and charge for
|
24 |
-
this service if you wish), that you receive source code or can get it
|
25 |
-
if you want it, that you can change the software or use pieces of it
|
26 |
-
in new free programs; and that you know you can do these things.
|
27 |
-
|
28 |
-
To protect your rights, we need to make restrictions that forbid
|
29 |
-
anyone to deny you these rights or to ask you to surrender the rights.
|
30 |
-
These restrictions translate to certain responsibilities for you if you
|
31 |
-
distribute copies of the software, or if you modify it.
|
32 |
-
|
33 |
-
For example, if you distribute copies of such a program, whether
|
34 |
-
gratis or for a fee, you must give the recipients all the rights that
|
35 |
-
you have. You must make sure that they, too, receive or can get the
|
36 |
-
source code. And you must show them these terms so they know their
|
37 |
-
rights.
|
38 |
-
|
39 |
-
We protect your rights with two steps: (1) copyright the software, and
|
40 |
-
(2) offer you this license which gives you legal permission to copy,
|
41 |
-
distribute and/or modify the software.
|
42 |
-
|
43 |
-
Also, for each author's protection and ours, we want to make certain
|
44 |
-
that everyone understands that there is no warranty for this free
|
45 |
-
software. If the software is modified by someone else and passed on, we
|
46 |
-
want its recipients to know that what they have is not the original, so
|
47 |
-
that any problems introduced by others will not reflect on the original
|
48 |
-
authors' reputations.
|
49 |
-
|
50 |
-
Finally, any free program is threatened constantly by software
|
51 |
-
patents. We wish to avoid the danger that redistributors of a free
|
52 |
-
program will individually obtain patent licenses, in effect making the
|
53 |
-
program proprietary. To prevent this, we have made it clear that any
|
54 |
-
patent must be licensed for everyone's free use or not licensed at all.
|
55 |
-
|
56 |
-
The precise terms and conditions for copying, distribution and
|
57 |
-
modification follow.
|
58 |
-
|
59 |
-
GNU GENERAL PUBLIC LICENSE
|
60 |
-
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
61 |
-
|
62 |
-
0. This License applies to any program or other work which contains
|
63 |
-
a notice placed by the copyright holder saying it may be distributed
|
64 |
-
under the terms of this General Public License. The "Program", below,
|
65 |
-
refers to any such program or work, and a "work based on the Program"
|
66 |
-
means either the Program or any derivative work under copyright law:
|
67 |
-
that is to say, a work containing the Program or a portion of it,
|
68 |
-
either verbatim or with modifications and/or translated into another
|
69 |
-
language. (Hereinafter, translation is included without limitation in
|
70 |
-
the term "modification".) Each licensee is addressed as "you".
|
71 |
-
|
72 |
-
Activities other than copying, distribution and modification are not
|
73 |
-
covered by this License; they are outside its scope. The act of
|
74 |
-
running the Program is not restricted, and the output from the Program
|
75 |
-
is covered only if its contents constitute a work based on the
|
76 |
-
Program (independent of having been made by running the Program).
|
77 |
-
Whether that is true depends on what the Program does.
|
78 |
-
|
79 |
-
1. You may copy and distribute verbatim copies of the Program's
|
80 |
-
source code as you receive it, in any medium, provided that you
|
81 |
-
conspicuously and appropriately publish on each copy an appropriate
|
82 |
-
copyright notice and disclaimer of warranty; keep intact all the
|
83 |
-
notices that refer to this License and to the absence of any warranty;
|
84 |
-
and give any other recipients of the Program a copy of this License
|
85 |
-
along with the Program.
|
86 |
-
|
87 |
-
You may charge a fee for the physical act of transferring a copy, and
|
88 |
-
you may at your option offer warranty protection in exchange for a fee.
|
89 |
-
|
90 |
-
2. You may modify your copy or copies of the Program or any portion
|
91 |
-
of it, thus forming a work based on the Program, and copy and
|
92 |
-
distribute such modifications or work under the terms of Section 1
|
93 |
-
above, provided that you also meet all of these conditions:
|
94 |
-
|
95 |
-
a) You must cause the modified files to carry prominent notices
|
96 |
-
stating that you changed the files and the date of any change.
|
97 |
-
|
98 |
-
b) You must cause any work that you distribute or publish, that in
|
99 |
-
whole or in part contains or is derived from the Program or any
|
100 |
-
part thereof, to be licensed as a whole at no charge to all third
|
101 |
-
parties under the terms of this License.
|
102 |
-
|
103 |
-
c) If the modified program normally reads commands interactively
|
104 |
-
when run, you must cause it, when started running for such
|
105 |
-
interactive use in the most ordinary way, to print or display an
|
106 |
-
announcement including an appropriate copyright notice and a
|
107 |
-
notice that there is no warranty (or else, saying that you provide
|
108 |
-
a warranty) and that users may redistribute the program under
|
109 |
-
these conditions, and telling the user how to view a copy of this
|
110 |
-
License. (Exception: if the Program itself is interactive but
|
111 |
-
does not normally print such an announcement, your work based on
|
112 |
-
the Program is not required to print an announcement.)
|
113 |
-
|
114 |
-
These requirements apply to the modified work as a whole. If
|
115 |
-
identifiable sections of that work are not derived from the Program,
|
116 |
-
and can be reasonably considered independent and separate works in
|
117 |
-
themselves, then this License, and its terms, do not apply to those
|
118 |
-
sections when you distribute them as separate works. But when you
|
119 |
-
distribute the same sections as part of a whole which is a work based
|
120 |
-
on the Program, the distribution of the whole must be on the terms of
|
121 |
-
this License, whose permissions for other licensees extend to the
|
122 |
-
entire whole, and thus to each and every part regardless of who wrote it.
|
123 |
-
|
124 |
-
Thus, it is not the intent of this section to claim rights or contest
|
125 |
-
your rights to work written entirely by you; rather, the intent is to
|
126 |
-
exercise the right to control the distribution of derivative or
|
127 |
-
collective works based on the Program.
|
128 |
-
|
129 |
-
In addition, mere aggregation of another work not based on the Program
|
130 |
-
with the Program (or with a work based on the Program) on a volume of
|
131 |
-
a storage or distribution medium does not bring the other work under
|
132 |
-
the scope of this License.
|
133 |
-
|
134 |
-
3. You may copy and distribute the Program (or a work based on it,
|
135 |
-
under Section 2) in object code or executable form under the terms of
|
136 |
-
Sections 1 and 2 above provided that you also do one of the following:
|
137 |
-
|
138 |
-
a) Accompany it with the complete corresponding machine-readable
|
139 |
-
source code, which must be distributed under the terms of Sections
|
140 |
-
1 and 2 above on a medium customarily used for software interchange; or,
|
141 |
-
|
142 |
-
b) Accompany it with a written offer, valid for at least three
|
143 |
-
years, to give any third party, for a charge no more than your
|
144 |
-
cost of physically performing source distribution, a complete
|
145 |
-
machine-readable copy of the corresponding source code, to be
|
146 |
-
distributed under the terms of Sections 1 and 2 above on a medium
|
147 |
-
customarily used for software interchange; or,
|
148 |
-
|
149 |
-
c) Accompany it with the information you received as to the offer
|
150 |
-
to distribute corresponding source code. (This alternative is
|
151 |
-
allowed only for noncommercial distribution and only if you
|
152 |
-
received the program in object code or executable form with such
|
153 |
-
an offer, in accord with Subsection b above.)
|
154 |
-
|
155 |
-
The source code for a work means the preferred form of the work for
|
156 |
-
making modifications to it. For an executable work, complete source
|
157 |
-
code means all the source code for all modules it contains, plus any
|
158 |
-
associated interface definition files, plus the scripts used to
|
159 |
-
control compilation and installation of the executable. However, as a
|
160 |
-
special exception, the source code distributed need not include
|
161 |
-
anything that is normally distributed (in either source or binary
|
162 |
-
form) with the major components (compiler, kernel, and so on) of the
|
163 |
-
operating system on which the executable runs, unless that component
|
164 |
-
itself accompanies the executable.
|
165 |
-
|
166 |
-
If distribution of executable or object code is made by offering
|
167 |
-
access to copy from a designated place, then offering equivalent
|
168 |
-
access to copy the source code from the same place counts as
|
169 |
-
distribution of the source code, even though third parties are not
|
170 |
-
compelled to copy the source along with the object code.
|
171 |
-
|
172 |
-
4. You may not copy, modify, sublicense, or distribute the Program
|
173 |
-
except as expressly provided under this License. Any attempt
|
174 |
-
otherwise to copy, modify, sublicense or distribute the Program is
|
175 |
-
void, and will automatically terminate your rights under this License.
|
176 |
-
However, parties who have received copies, or rights, from you under
|
177 |
-
this License will not have their licenses terminated so long as such
|
178 |
-
parties remain in full compliance.
|
179 |
-
|
180 |
-
5. You are not required to accept this License, since you have not
|
181 |
-
signed it. However, nothing else grants you permission to modify or
|
182 |
-
distribute the Program or its derivative works. These actions are
|
183 |
-
prohibited by law if you do not accept this License. Therefore, by
|
184 |
-
modifying or distributing the Program (or any work based on the
|
185 |
-
Program), you indicate your acceptance of this License to do so, and
|
186 |
-
all its terms and conditions for copying, distributing or modifying
|
187 |
-
the Program or works based on it.
|
188 |
-
|
189 |
-
6. Each time you redistribute the Program (or any work based on the
|
190 |
-
Program), the recipient automatically receives a license from the
|
191 |
-
original licensor to copy, distribute or modify the Program subject to
|
192 |
-
these terms and conditions. You may not impose any further
|
193 |
-
restrictions on the recipients' exercise of the rights granted herein.
|
194 |
-
You are not responsible for enforcing compliance by third parties to
|
195 |
-
this License.
|
196 |
-
|
197 |
-
7. If, as a consequence of a court judgment or allegation of patent
|
198 |
-
infringement or for any other reason (not limited to patent issues),
|
199 |
-
conditions are imposed on you (whether by court order, agreement or
|
200 |
-
otherwise) that contradict the conditions of this License, they do not
|
201 |
-
excuse you from the conditions of this License. If you cannot
|
202 |
-
distribute so as to satisfy simultaneously your obligations under this
|
203 |
-
License and any other pertinent obligations, then as a consequence you
|
204 |
-
may not distribute the Program at all. For example, if a patent
|
205 |
-
license would not permit royalty-free redistribution of the Program by
|
206 |
-
all those who receive copies directly or indirectly through you, then
|
207 |
-
the only way you could satisfy both it and this License would be to
|
208 |
-
refrain entirely from distribution of the Program.
|
209 |
-
|
210 |
-
If any portion of this section is held invalid or unenforceable under
|
211 |
-
any particular circumstance, the balance of the section is intended to
|
212 |
-
apply and the section as a whole is intended to apply in other
|
213 |
-
circumstances.
|
214 |
-
|
215 |
-
It is not the purpose of this section to induce you to infringe any
|
216 |
-
patents or other property right claims or to contest validity of any
|
217 |
-
such claims; this section has the sole purpose of protecting the
|
218 |
-
integrity of the free software distribution system, which is
|
219 |
-
implemented by public license practices. Many people have made
|
220 |
-
generous contributions to the wide range of software distributed
|
221 |
-
through that system in reliance on consistent application of that
|
222 |
-
system; it is up to the author/donor to decide if he or she is willing
|
223 |
-
to distribute software through any other system and a licensee cannot
|
224 |
-
impose that choice.
|
225 |
-
|
226 |
-
This section is intended to make thoroughly clear what is believed to
|
227 |
-
be a consequence of the rest of this License.
|
228 |
-
|
229 |
-
8. If the distribution and/or use of the Program is restricted in
|
230 |
-
certain countries either by patents or by copyrighted interfaces, the
|
231 |
-
original copyright holder who places the Program under this License
|
232 |
-
may add an explicit geographical distribution limitation excluding
|
233 |
-
those countries, so that distribution is permitted only in or among
|
234 |
-
countries not thus excluded. In such case, this License incorporates
|
235 |
-
the limitation as if written in the body of this License.
|
236 |
-
|
237 |
-
9. The Free Software Foundation may publish revised and/or new versions
|
238 |
-
of the General Public License from time to time. Such new versions will
|
239 |
-
be similar in spirit to the present version, but may differ in detail to
|
240 |
-
address new problems or concerns.
|
241 |
-
|
242 |
-
Each version is given a distinguishing version number. If the Program
|
243 |
-
specifies a version number of this License which applies to it and "any
|
244 |
-
later version", you have the option of following the terms and conditions
|
245 |
-
either of that version or of any later version published by the Free
|
246 |
-
Software Foundation. If the Program does not specify a version number of
|
247 |
-
this License, you may choose any version ever published by the Free Software
|
248 |
-
Foundation.
|
249 |
-
|
250 |
-
10. If you wish to incorporate parts of the Program into other free
|
251 |
-
programs whose distribution conditions are different, write to the author
|
252 |
-
to ask for permission. For software which is copyrighted by the Free
|
253 |
-
Software Foundation, write to the Free Software Foundation; we sometimes
|
254 |
-
make exceptions for this. Our decision will be guided by the two goals
|
255 |
-
of preserving the free status of all derivatives of our free software and
|
256 |
-
of promoting the sharing and reuse of software generally.
|
257 |
-
|
258 |
-
NO WARRANTY
|
259 |
-
|
260 |
-
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
261 |
-
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
262 |
-
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
263 |
-
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
264 |
-
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
265 |
-
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
266 |
-
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
267 |
-
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
268 |
-
REPAIR OR CORRECTION.
|
269 |
-
|
270 |
-
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
271 |
-
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
272 |
-
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
273 |
-
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
274 |
-
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
275 |
-
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
276 |
-
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
277 |
-
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
278 |
-
POSSIBILITY OF SUCH DAMAGES.
|
279 |
-
|
280 |
-
END OF TERMS AND CONDITIONS
|
281 |
-
|
282 |
-
How to Apply These Terms to Your New Programs
|
283 |
-
|
284 |
-
If you develop a new program, and you want it to be of the greatest
|
285 |
-
possible use to the public, the best way to achieve this is to make it
|
286 |
-
free software which everyone can redistribute and change under these terms.
|
287 |
-
|
288 |
-
To do so, attach the following notices to the program. It is safest
|
289 |
-
to attach them to the start of each source file to most effectively
|
290 |
-
convey the exclusion of warranty; and each file should have at least
|
291 |
-
the "copyright" line and a pointer to where the full notice is found.
|
292 |
-
|
293 |
-
{description}
|
294 |
-
Copyright (C) {year} {fullname}
|
295 |
-
|
296 |
-
This program is free software; you can redistribute it and/or modify
|
297 |
-
it under the terms of the GNU General Public License as published by
|
298 |
-
the Free Software Foundation; either version 2 of the License, or
|
299 |
-
(at your option) any later version.
|
300 |
-
|
301 |
-
This program is distributed in the hope that it will be useful,
|
302 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
303 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
304 |
-
GNU General Public License for more details.
|
305 |
-
|
306 |
-
You should have received a copy of the GNU General Public License along
|
307 |
-
with this program; if not, write to the Free Software Foundation, Inc.,
|
308 |
-
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
309 |
-
|
310 |
-
Also add information on how to contact you by electronic and paper mail.
|
311 |
-
|
312 |
-
If the program is interactive, make it output a short notice like this
|
313 |
-
when it starts in an interactive mode:
|
314 |
-
|
315 |
-
Gnomovision version 69, Copyright (C) year name of author
|
316 |
-
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
317 |
-
This is free software, and you are welcome to redistribute it
|
318 |
-
under certain conditions; type `show c' for details.
|
319 |
-
|
320 |
-
The hypothetical commands `show w' and `show c' should show the appropriate
|
321 |
-
parts of the General Public License. Of course, the commands you use may
|
322 |
-
be called something other than `show w' and `show c'; they could even be
|
323 |
-
mouse-clicks or menu items--whatever suits your program.
|
324 |
-
|
325 |
-
You should also get your employer (if you work as a programmer) or your
|
326 |
-
school, if any, to sign a "copyright disclaimer" for the program, if
|
327 |
-
necessary. Here is a sample; alter the names:
|
328 |
-
|
329 |
-
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
330 |
-
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
331 |
-
|
332 |
-
{signature of Ty Coon}, 1 April 1989
|
333 |
-
Ty Coon, President of Vice
|
334 |
-
|
335 |
-
This General Public License does not permit incorporating your program into
|
336 |
-
proprietary programs. If your program is a subroutine library, you may
|
337 |
-
consider it more useful to permit linking proprietary applications with the
|
338 |
-
library. If this is what you want to do, use the GNU Lesser General
|
339 |
-
Public License instead of this License.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trunk/includes/libraries/aihrus-framework/README.md
DELETED
@@ -1,74 +0,0 @@
|
|
1 |
-
# Aihrus Framework
|
2 |
-
|
3 |
-
A helper library for WordPress plugins by Aihrus.
|
4 |
-
|
5 |
-
## Features
|
6 |
-
|
7 |
-
* Content truncation helper methods
|
8 |
-
* Donation links
|
9 |
-
* Image source and media attachment helper methods
|
10 |
-
* Licensing
|
11 |
-
* Link creation helper methods
|
12 |
-
* Nonce helper methods
|
13 |
-
* Notifications
|
14 |
-
* Validation helper methods
|
15 |
-
|
16 |
-
## Usage
|
17 |
-
|
18 |
-
* Change to plugin directory that's a Git clone
|
19 |
-
* Load and link the external library
|
20 |
-
|
21 |
-
```
|
22 |
-
git remote add aihrus https://github.com/michael-cannon/aihrus-framework.git
|
23 |
-
git subtree add -P include/libraries/aihrus-framework aihrus master
|
24 |
-
git commit -a -m "Readd aihrus framework"
|
25 |
-
git push origin master
|
26 |
-
```
|
27 |
-
|
28 |
-
* Link plugin to libary
|
29 |
-
|
30 |
-
```
|
31 |
-
require WPS_DIR_LIB . '/aihrus-framework/class-aihrus-common.php';
|
32 |
-
```
|
33 |
-
|
34 |
-
* Extend plugin class to library
|
35 |
-
|
36 |
-
```
|
37 |
-
class Wordpress_Starter extends Aihrus_Common {
|
38 |
-
```
|
39 |
-
|
40 |
-
* Add class static members
|
41 |
-
|
42 |
-
```
|
43 |
-
public static $class = __CLASS__;
|
44 |
-
public static $notice_key;
|
45 |
-
```
|
46 |
-
|
47 |
-
* Set notices…
|
48 |
-
|
49 |
-
```
|
50 |
-
…
|
51 |
-
if ( $bad_version )
|
52 |
-
add_action( 'admin_notices', 'wps_notice_aihrus' );
|
53 |
-
…
|
54 |
-
function wps_notice_aihrus() {
|
55 |
-
$help_url = esc_url( 'https://aihrus.zendesk.com/entries/35689458' );
|
56 |
-
$help_link = sprintf( __( '<a href="%1$s">Update plugins</a>. <a href="%2$s">More information</a>.' ), self_admin_url( 'update-core.php' ), $help_url );
|
57 |
-
|
58 |
-
$text = sprintf( esc_html__( 'Plugin "%1$s" has been deactivated as it requires a current Aihrus Framework. Once corrected, "%1$s" can be activated. %2$s' ), WPS_NAME, $help_link );
|
59 |
-
|
60 |
-
aihr_notice_error( $text );
|
61 |
-
}
|
62 |
-
```
|
63 |
-
|
64 |
-
* Update the external library
|
65 |
-
|
66 |
-
```
|
67 |
-
git subtree pull -P include/libraries/aihrus-framework aihrus master
|
68 |
-
```
|
69 |
-
|
70 |
-
* Update the plugin repository
|
71 |
-
|
72 |
-
```
|
73 |
-
git push origin master
|
74 |
-
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trunk/includes/libraries/aihrus-framework/aihrus-framework.php
DELETED
@@ -1,341 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
3 |
-
Copyright 2014 Michael Cannon (email: mc@aihr.us)
|
4 |
-
|
5 |
-
This program is free software; you can redistribute it and/or modify
|
6 |
-
it under the terms of the GNU General Public License, version 2, as
|
7 |
-
published by the Free Software Foundation.
|
8 |
-
|
9 |
-
This program is distributed in the hope that it will be useful,
|
10 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12 |
-
GNU General Public License for more details.
|
13 |
-
|
14 |
-
You should have received a copy of the GNU General Public License
|
15 |
-
along with this program; if not, write to the Free Software
|
16 |
-
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
17 |
-
*/
|
18 |
-
|
19 |
-
if ( ! defined( 'AIHR_BASE' ) )
|
20 |
-
define( 'AIHR_BASE', __FILE__ );
|
21 |
-
|
22 |
-
if ( ! defined( 'AIHR_DIR' ) )
|
23 |
-
define( 'AIHR_DIR', plugin_dir_path( __FILE__ ) );
|
24 |
-
|
25 |
-
if ( ! defined( 'AIHR_DIR_INC' ) )
|
26 |
-
define( 'AIHR_DIR_INC', AIHR_DIR . 'includes/' );
|
27 |
-
|
28 |
-
if ( ! defined( 'AIHR_DIR_LIB' ) )
|
29 |
-
define( 'AIHR_DIR_LIB', AIHR_DIR_INC . 'libraries/' );
|
30 |
-
|
31 |
-
if ( ! defined( 'AIHR_VERSION' ) )
|
32 |
-
define( 'AIHR_VERSION', '1.1.1' );
|
33 |
-
|
34 |
-
require_once ABSPATH . 'wp-admin/includes/plugin.php';
|
35 |
-
|
36 |
-
|
37 |
-
if ( ! function_exists( 'aihr_check_aihrus_framework' ) ) {
|
38 |
-
function aihr_check_aihrus_framework( $file = null, $name = null, $aihr_min = '1.0.0' ) {
|
39 |
-
if ( is_null( $file ) ) {
|
40 |
-
aihr_notice_error( __( '`aihr_check_aihrus_framework` requires $file argument' ) );
|
41 |
-
|
42 |
-
return false;
|
43 |
-
}
|
44 |
-
|
45 |
-
if ( ! defined( 'AIHR_VERSION' ) ) {
|
46 |
-
$check_okay = false;
|
47 |
-
} else {
|
48 |
-
$check_okay = version_compare( AIHR_VERSION, $aihr_min, '>=' );
|
49 |
-
}
|
50 |
-
|
51 |
-
$file = plugin_basename( $file );
|
52 |
-
if ( ! $check_okay && __FILE__ != $file ) {
|
53 |
-
if ( ! defined( 'AIHR_VERSION_FILE' ) ) {
|
54 |
-
define( 'AIHR_VERSION_FILE', $file );
|
55 |
-
}
|
56 |
-
|
57 |
-
if ( ! is_null( $name ) && ! defined( 'AIHR_VERSION_NAME' ) ) {
|
58 |
-
define( 'AIHR_VERSION_NAME', $name );
|
59 |
-
}
|
60 |
-
|
61 |
-
if ( ! defined( 'AIHR_VERSION_MIN' ) ) {
|
62 |
-
define( 'AIHR_VERSION_MIN', $aihr_min );
|
63 |
-
}
|
64 |
-
|
65 |
-
add_action( 'admin_notices', 'aihr_notice_aihrus_framework' );
|
66 |
-
}
|
67 |
-
|
68 |
-
return $check_okay;
|
69 |
-
}
|
70 |
-
}
|
71 |
-
|
72 |
-
if ( ! function_exists( 'aihr_notice_aihrus_framework' ) ) {
|
73 |
-
function aihr_notice_aihrus_framework() {
|
74 |
-
if ( defined( 'AIHR_VERSION_NAME' ) ) {
|
75 |
-
$name = AIHR_VERSION_NAME;
|
76 |
-
} else {
|
77 |
-
$name = basename( dirname( AIHR_VERSION_FILE ) );
|
78 |
-
$name = str_replace( '-', ' ', $name );
|
79 |
-
$name = ucwords( $name );
|
80 |
-
}
|
81 |
-
|
82 |
-
$help_url = esc_url( 'https://aihrus.zendesk.com/entries/35689458' );
|
83 |
-
$help_link = sprintf( __( '<a href="%1$s">Update plugins</a>. <a href="%2$s">More information</a>.' ), self_admin_url( 'update-core.php' ), $help_url );
|
84 |
-
|
85 |
-
$note = '';
|
86 |
-
if ( defined( 'AIHR_BASE' ) ) {
|
87 |
-
$plugin = plugin_basename( AIHR_BASE );
|
88 |
-
$plugin = explode( '/', $plugin );
|
89 |
-
|
90 |
-
$plugin_name = $plugin[0];
|
91 |
-
$plugin_name = str_replace( '-', ' ', $plugin_name );
|
92 |
-
$plugin_name = ucwords( $plugin_name );
|
93 |
-
|
94 |
-
$note = sprintf( esc_html__( 'Plugin "%1$s" is causing the out of date issue.' ), $plugin_name );
|
95 |
-
}
|
96 |
-
|
97 |
-
$aihr_version = defined( 'AIHR_VERSION' ) ? AIHR_VERSION : '0.0.0';
|
98 |
-
|
99 |
-
$text = sprintf( esc_html__( 'Plugin "%1$s" has been deactivated as it requires Aihrus Framework %2$s or newer. You\'re running Aihrus Framework %4$s. Once corrected, "%1$s" can be activated. %5$s %3$s' ), $name, AIHR_VERSION_MIN, $help_link, $aihr_version, $note );
|
100 |
-
|
101 |
-
aihr_notice_error( $text );
|
102 |
-
}
|
103 |
-
}
|
104 |
-
|
105 |
-
if ( ! function_exists( 'aihr_check_php' ) ) {
|
106 |
-
function aihr_check_php( $file = null, $name = null, $php_min = '5.3.0' ) {
|
107 |
-
if ( is_null( $file ) ) {
|
108 |
-
aihr_notice_error( __( '`aihr_check_php` requires $file argument' ) );
|
109 |
-
|
110 |
-
return false;
|
111 |
-
}
|
112 |
-
|
113 |
-
$check_okay = version_compare( PHP_VERSION, $php_min, '>=' );
|
114 |
-
$file = plugin_basename( $file );
|
115 |
-
if ( ! $check_okay && __FILE__ != $file ) {
|
116 |
-
if ( ! defined( 'AIHR_PHP_VERSION_FILE' ) ) {
|
117 |
-
define( 'AIHR_PHP_VERSION_FILE', $file );
|
118 |
-
}
|
119 |
-
|
120 |
-
if ( ! is_null( $name ) && ! defined( 'AIHR_PHP_VERSION_NAME' ) ) {
|
121 |
-
define( 'AIHR_PHP_VERSION_NAME', $name );
|
122 |
-
}
|
123 |
-
|
124 |
-
if ( ! defined( 'AIHR_PHP_VERSION_MIN' ) ) {
|
125 |
-
define( 'AIHR_PHP_VERSION_MIN', $php_min );
|
126 |
-
}
|
127 |
-
|
128 |
-
add_action( 'admin_notices', 'aihr_notice_php' );
|
129 |
-
}
|
130 |
-
|
131 |
-
return $check_okay;
|
132 |
-
}
|
133 |
-
}
|
134 |
-
|
135 |
-
if ( ! function_exists( 'aihr_notice_php' ) ) {
|
136 |
-
function aihr_notice_php() {
|
137 |
-
if ( defined( 'AIHR_PHP_VERSION_NAME' ) ) {
|
138 |
-
$name = AIHR_PHP_VERSION_NAME;
|
139 |
-
} else {
|
140 |
-
$name = basename( dirname( AIHR_PHP_VERSION_FILE ) );
|
141 |
-
$name = str_replace( '-', ' ', $name );
|
142 |
-
$name = ucwords( $name );
|
143 |
-
}
|
144 |
-
|
145 |
-
$help_url = esc_url( 'https://aihrus.zendesk.com/entries/30678006' );
|
146 |
-
|
147 |
-
$text = sprintf( __( 'Plugin "%1$s" has been deactivated as it requires PHP %2$s or newer. You\'re running PHP %4$s. Once corrected, "%1$s" can be activated. <a href="%3$s">More information</a>.' ), $name, AIHR_PHP_VERSION_MIN, $help_url, PHP_VERSION );
|
148 |
-
|
149 |
-
aihr_notice_error( $text );
|
150 |
-
}
|
151 |
-
}
|
152 |
-
|
153 |
-
if ( ! function_exists( 'aihr_check_wp' ) ) {
|
154 |
-
function aihr_check_wp( $file = null, $name = null, $wp_min = '3.6' ) {
|
155 |
-
if ( is_null( $file ) ) {
|
156 |
-
aihr_notice_error( __( '`aihr_check_wp` requires $file argument' ) );
|
157 |
-
|
158 |
-
return false;
|
159 |
-
}
|
160 |
-
|
161 |
-
global $wp_version;
|
162 |
-
|
163 |
-
$check_okay = version_compare( $wp_version, $wp_min, '>=' );
|
164 |
-
$file = plugin_basename( $file );
|
165 |
-
if ( ! $check_okay && __FILE__ != $file ) {
|
166 |
-
if ( ! defined( 'AIHR_WP_VERSION_FILE' ) ) {
|
167 |
-
define( 'AIHR_WP_VERSION_FILE', $file );
|
168 |
-
}
|
169 |
-
|
170 |
-
if ( ! is_null( $name ) && ! defined( 'AIHR_WP_VERSION_NAME' ) ) {
|
171 |
-
define( 'AIHR_WP_VERSION_NAME', $name );
|
172 |
-
}
|
173 |
-
|
174 |
-
if ( ! defined( 'AIHR_WP_VERSION_MIN' ) ) {
|
175 |
-
define( 'AIHR_WP_VERSION_MIN', $wp_min );
|
176 |
-
}
|
177 |
-
|
178 |
-
add_action( 'admin_notices', 'aihr_notice_wp' );
|
179 |
-
}
|
180 |
-
|
181 |
-
return $check_okay;
|
182 |
-
}
|
183 |
-
}
|
184 |
-
|
185 |
-
if ( ! function_exists( 'aihr_notice_wp' ) ) {
|
186 |
-
function aihr_notice_wp() {
|
187 |
-
global $wp_version;
|
188 |
-
|
189 |
-
if ( defined( 'AIHR_WP_VERSION_NAME' ) ) {
|
190 |
-
$name = AIHR_WP_VERSION_NAME;
|
191 |
-
} else {
|
192 |
-
$name = basename( dirname( AIHR_WP_VERSION_FILE ) );
|
193 |
-
$name = str_replace( '-', ' ', $name );
|
194 |
-
$name = ucwords( $name );
|
195 |
-
}
|
196 |
-
|
197 |
-
$help_url = network_admin_url( 'update-core.php' );
|
198 |
-
|
199 |
-
$text = sprintf( __( 'Plugin "%1$s" has been deactivated as it requires WordPress %2$s or newer. You\'re running WordPress %4$s. Once corrected, "%1$s" can be activated. <a href="%3$s">Update WordPress</a>.' ), $name, AIHR_WP_VERSION_MIN, $help_url, $wp_version );
|
200 |
-
|
201 |
-
aihr_notice_error( $text );
|
202 |
-
}
|
203 |
-
}
|
204 |
-
|
205 |
-
if ( ! function_exists( 'aihr_notice_error' ) ) {
|
206 |
-
function aihr_notice_error( $text ) {
|
207 |
-
aihr_notice_updated( $text, 'error' );
|
208 |
-
}
|
209 |
-
}
|
210 |
-
|
211 |
-
if ( ! function_exists( 'aihr_notice_updated' ) ) {
|
212 |
-
function aihr_notice_updated( $text, $class = 'updated' ) {
|
213 |
-
if ( 'updated' == $class )
|
214 |
-
$class .= ' fade';
|
215 |
-
|
216 |
-
$content = '';
|
217 |
-
$content .= '<div class="' . $class . '"><p>';
|
218 |
-
$content .= $text;
|
219 |
-
$content .= '</p></div>';
|
220 |
-
|
221 |
-
echo $content;
|
222 |
-
}
|
223 |
-
}
|
224 |
-
|
225 |
-
if ( ! function_exists( 'aihr_notice_version' ) ) {
|
226 |
-
function aihr_notice_version( $required_base, $required_name, $required_slug, $required_version, $item_name ) {
|
227 |
-
$is_active = is_plugin_active( $required_base );
|
228 |
-
if ( $is_active )
|
229 |
-
$link = sprintf( __( '<a href="%1$s">update to</a>' ), self_admin_url( 'update-core.php' ) );
|
230 |
-
else {
|
231 |
-
$plugins = get_plugins();
|
232 |
-
if ( empty( $plugins[ $required_base ] ) ) {
|
233 |
-
$install = esc_url( wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=' . $required_slug ), 'install-plugin_' . $required_slug ) );
|
234 |
-
$link = sprintf( __( '<a href="%1$s">install</a>' ), $install );
|
235 |
-
} else {
|
236 |
-
$activate = esc_url( wp_nonce_url( admin_url( 'plugins.php?action=activate&plugin=' . $required_base ), 'activate-plugin_' . $required_base ) );
|
237 |
-
$link = sprintf( __( '<a href="%1$s">activate</a>' ), $activate );
|
238 |
-
}
|
239 |
-
}
|
240 |
-
|
241 |
-
$text = sprintf( __( 'Plugin "%3$s" has been deactivated. Please %1$s "%4$s" version %2$s or newer before activating "%3$s".' ), $link, $required_version, $item_name, $required_name );
|
242 |
-
|
243 |
-
aihr_notice_error( $text );
|
244 |
-
}
|
245 |
-
}
|
246 |
-
|
247 |
-
if ( ! function_exists( 'aihr_notice_license' ) ) {
|
248 |
-
function aihr_notice_license( $post_type, $settings_id, $free_name, $purchase_url, $item_name ) {
|
249 |
-
if ( empty( $post_type ) )
|
250 |
-
$link = get_admin_url() . 'options-general.php?page=' . $settings_id;
|
251 |
-
else
|
252 |
-
$link = get_admin_url() . 'edit.php?post_type=' . $post_type . '&page=' . $settings_id;
|
253 |
-
|
254 |
-
$text = __( '<a href="%1$s">%2$s > Settings</a>, <em>Premium</em> tab, <em>License Key</em> entry' );
|
255 |
-
|
256 |
-
$settings_link = sprintf( $text, $link, $free_name );
|
257 |
-
|
258 |
-
$link = esc_url( 'https://aihrus.zendesk.com/entries/28745227' );
|
259 |
-
$text = __( '<a href="%s">Where\'s my license key?</a>' );
|
260 |
-
|
261 |
-
$faq_link = sprintf( $text, $link );
|
262 |
-
|
263 |
-
$link = esc_url( $purchase_url );
|
264 |
-
$text = __( '<a href="%1$s">%2$s</a>' );
|
265 |
-
|
266 |
-
$buy_link = sprintf( $text, $link, $item_name );
|
267 |
-
|
268 |
-
$text = sprintf( __( 'Plugin "%1$s" requires license activation before updating will work. Please activate the license key through %2$s. No license key? See "%3$s" or purchase "%4$s".' ), $item_name, $settings_link, $faq_link, $buy_link );
|
269 |
-
|
270 |
-
aihr_notice_error( $text );
|
271 |
-
}
|
272 |
-
}
|
273 |
-
|
274 |
-
if ( ! function_exists( 'aihr_deactivate_plugin' ) ) {
|
275 |
-
function aihr_deactivate_plugin( $file = null, $name = null, $reason = '' ) {
|
276 |
-
error_log( print_r( debug_backtrace(), true ) );
|
277 |
-
|
278 |
-
if ( is_null( $file ) ) {
|
279 |
-
aihr_notice_error( __( '`aihr_deactivate_plugin` requires $file argument' ) );
|
280 |
-
|
281 |
-
return false;
|
282 |
-
}
|
283 |
-
|
284 |
-
if ( is_null( $name ) && empty( $reason ) ) {
|
285 |
-
aihr_deactivate_plugin_do( $file );
|
286 |
-
return false;
|
287 |
-
}
|
288 |
-
|
289 |
-
if ( ! defined( 'AIHR_DEACTIVATE_REASON' ) ) {
|
290 |
-
define( 'AIHR_DEACTIVATE_REASON', $reason );
|
291 |
-
}
|
292 |
-
|
293 |
-
if ( ! defined( 'AIHR_DEACTIVATE_FILE' ) ) {
|
294 |
-
define( 'AIHR_DEACTIVATE_FILE', $file );
|
295 |
-
}
|
296 |
-
|
297 |
-
if ( ! is_null( $name ) && ! defined( 'AIHR_DEACTIVATE_NAME' ) ) {
|
298 |
-
define( 'AIHR_DEACTIVATE_NAME', $name );
|
299 |
-
}
|
300 |
-
|
301 |
-
add_action( 'admin_notices', 'aihr_notice_deactivate' );
|
302 |
-
}
|
303 |
-
}
|
304 |
-
|
305 |
-
if ( ! function_exists( 'aihr_notice_deactivate' ) ) {
|
306 |
-
function aihr_notice_deactivate() {
|
307 |
-
if ( defined( 'AIHR_DEACTIVATE_NAME' ) ) {
|
308 |
-
$name = AIHR_DEACTIVATE_NAME;
|
309 |
-
} else {
|
310 |
-
$name = basename( dirname( AIHR_DEACTIVATE_FILE ) );
|
311 |
-
$name = str_replace( '-', ' ', $name );
|
312 |
-
$name = ucwords( $name );
|
313 |
-
}
|
314 |
-
|
315 |
-
if ( defined( 'AIHR_DEACTIVATE_REASON' ) ) {
|
316 |
-
$reason = AIHR_DEACTIVATE_REASON;
|
317 |
-
} else {
|
318 |
-
$reason = esc_html__( 'Unknown' );
|
319 |
-
}
|
320 |
-
|
321 |
-
$text = sprintf( __( 'Plugin "%1$s" has been deactivated due to "%2$s". Once corrected, "%1$s" can be activated.' ), $name, $reason );
|
322 |
-
|
323 |
-
aihr_notice_error( $text );
|
324 |
-
|
325 |
-
aihr_deactivate_plugin_do( AIHR_DEACTIVATE_FILE );
|
326 |
-
}
|
327 |
-
}
|
328 |
-
|
329 |
-
if ( ! function_exists( 'aihr_deactivate_plugin_do' ) ) {
|
330 |
-
function aihr_deactivate_plugin_do( $file = null ) {
|
331 |
-
if ( is_null( $file ) ) {
|
332 |
-
aihr_notice_error( __( '`aihr_deactivate_plugin_do` requires $file argument' ) );
|
333 |
-
|
334 |
-
return false;
|
335 |
-
}
|
336 |
-
|
337 |
-
deactivate_plugins( $file );
|
338 |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trunk/includes/libraries/aihrus-framework/class-aihrus-common.php
DELETED
@@ -1,462 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
3 |
-
Copyright 2014 Michael Cannon (email: mc@aihr.us)
|
4 |
-
|
5 |
-
This program is free software; you can redistribute it and/or modify
|
6 |
-
it under the terms of the GNU General Public License, version 2, as
|
7 |
-
published by the Free Software Foundation.
|
8 |
-
|
9 |
-
This program is distributed in the hope that it will be useful,
|
10 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12 |
-
GNU General Public License for more details.
|
13 |
-
|
14 |
-
You should have received a copy of the GNU General Public License
|
15 |
-
along with this program; if not, write to the Free Software
|
16 |
-
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
17 |
-
*/
|
18 |
-
|
19 |
-
if ( class_exists( 'Aihrus_Common' ) )
|
20 |
-
return;
|
21 |
-
|
22 |
-
require_once 'interface-aihrus-common.php';
|
23 |
-
|
24 |
-
|
25 |
-
abstract class Aihrus_Common implements Aihrus_Common_Interface {
|
26 |
-
public static $donate_button;
|
27 |
-
public static $donate_link;
|
28 |
-
|
29 |
-
|
30 |
-
public function __construct() {
|
31 |
-
self::set_notice_key();
|
32 |
-
|
33 |
-
self::$donate_button = <<<EOD
|
34 |
-
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
|
35 |
-
<input type="hidden" name="cmd" value="_s-xclick">
|
36 |
-
<input type="hidden" name="hosted_button_id" value="WM4F995W9LHXE">
|
37 |
-
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
|
38 |
-
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
|
39 |
-
</form>
|
40 |
-
EOD;
|
41 |
-
|
42 |
-
self::$donate_link = '<a href="http://aihr.us/about-aihrus/donate/"><img src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif" border="0" alt="PayPal - The safer, easier way to pay online!" /></a>';
|
43 |
-
|
44 |
-
add_action( 'admin_init', array( static::$class, 'check_notices' ), 9999 );
|
45 |
-
}
|
46 |
-
|
47 |
-
|
48 |
-
public static function set_notice( $notice_name, $frequency_limit = false ) {
|
49 |
-
$notice_key = self::get_notice_key();
|
50 |
-
|
51 |
-
$frequency_limit = intval( $frequency_limit );
|
52 |
-
if ( ! empty( $frequency_limit ) ) {
|
53 |
-
$fl_key = $notice_key . '_' . $notice_name;
|
54 |
-
$proceed = get_transient( $fl_key );
|
55 |
-
if ( false === $proceed ) {
|
56 |
-
delete_transient( $fl_key );
|
57 |
-
set_transient( $fl_key, time(), $frequency_limit );
|
58 |
-
} else {
|
59 |
-
return;
|
60 |
-
}
|
61 |
-
}
|
62 |
-
|
63 |
-
$notices = get_transient( $notice_key );
|
64 |
-
if ( false === $notices )
|
65 |
-
$notices = array();
|
66 |
-
|
67 |
-
$notices[] = $notice_name;
|
68 |
-
|
69 |
-
self::delete_notices();
|
70 |
-
set_transient( $notice_key, $notices, HOUR_IN_SECONDS );
|
71 |
-
}
|
72 |
-
|
73 |
-
|
74 |
-
public static function delete_notices() {
|
75 |
-
$notice_key = self::get_notice_key();
|
76 |
-
|
77 |
-
delete_transient( $notice_key );
|
78 |
-
}
|
79 |
-
|
80 |
-
|
81 |
-
public static function check_notices() {
|
82 |
-
$notice_key = self::get_notice_key();
|
83 |
-
|
84 |
-
$notices = get_transient( $notice_key );
|
85 |
-
if ( false === $notices )
|
86 |
-
return;
|
87 |
-
|
88 |
-
$notices = array_unique( $notices );
|
89 |
-
foreach ( $notices as $notice ) {
|
90 |
-
if ( function_exists( $notice ) ) {
|
91 |
-
add_action( 'admin_notices', $notice );
|
92 |
-
} elseif ( is_array( $notice ) ) {
|
93 |
-
add_action( 'admin_notices', $notice );
|
94 |
-
} else {
|
95 |
-
add_action( 'admin_notices', array( static::$class, $notice ) );
|
96 |
-
}
|
97 |
-
}
|
98 |
-
|
99 |
-
self::delete_notices();
|
100 |
-
}
|
101 |
-
|
102 |
-
|
103 |
-
public static function get_notice_key() {
|
104 |
-
if ( is_null( static::$notice_key ) )
|
105 |
-
self::set_notice_key();
|
106 |
-
|
107 |
-
return static::$notice_key;
|
108 |
-
}
|
109 |
-
|
110 |
-
|
111 |
-
public static function set_notice_key() {
|
112 |
-
static::$notice_key = static::SLUG . 'notices';
|
113 |
-
}
|
114 |
-
|
115 |
-
|
116 |
-
public static function version( $version ) {
|
117 |
-
$version .= '-' . static::ID . '-' . static::VERSION;
|
118 |
-
|
119 |
-
return $version;
|
120 |
-
}
|
121 |
-
|
122 |
-
|
123 |
-
/**
|
124 |
-
* flatten an arbitrarily deep multidimensional array
|
125 |
-
* into a list of its scalar values
|
126 |
-
* (may be inefficient for large structures)
|
127 |
-
* (will infinite recurse on self-referential structures)
|
128 |
-
* (could be extended to handle objects)
|
129 |
-
*
|
130 |
-
* @ref http://in1.php.net/manual/en/function.array-values.php#41967
|
131 |
-
*/
|
132 |
-
|
133 |
-
|
134 |
-
public static function array_values_recursive( $ary ) {
|
135 |
-
$lst = array();
|
136 |
-
foreach ( array_keys( $ary ) as $k ) {
|
137 |
-
$v = $ary[$k];
|
138 |
-
if ( is_scalar( $v ) ) {
|
139 |
-
$lst[] = $v;
|
140 |
-
} elseif ( is_array( $v ) ) {
|
141 |
-
$lst = array_merge(
|
142 |
-
$lst,
|
143 |
-
self::array_values_recursive( $v )
|
144 |
-
);
|
145 |
-
}
|
146 |
-
}
|
147 |
-
|
148 |
-
return $lst;
|
149 |
-
}
|
150 |
-
|
151 |
-
|
152 |
-
public static function notice_donate( $disable_donate = null, $item_name = null ) {
|
153 |
-
if ( $disable_donate )
|
154 |
-
return;
|
155 |
-
|
156 |
-
$text = sprintf( esc_html__( 'Please donate $5 towards ongoing free support and development of the "%1$s" plugin. %2$s' ), $item_name, self::$donate_button );
|
157 |
-
|
158 |
-
aihr_notice_updated( $text );
|
159 |
-
}
|
160 |
-
|
161 |
-
|
162 |
-
public static function get_scripts() {
|
163 |
-
if ( static::$scripts_called )
|
164 |
-
return;
|
165 |
-
|
166 |
-
foreach ( static::$scripts as $script )
|
167 |
-
echo $script;
|
168 |
-
|
169 |
-
static::$scripts_called = true;
|
170 |
-
}
|
171 |
-
|
172 |
-
|
173 |
-
public static function get_styles() {
|
174 |
-
if ( static::$styles_called )
|
175 |
-
return;
|
176 |
-
|
177 |
-
foreach ( static::$styles as $style )
|
178 |
-
echo $style;
|
179 |
-
|
180 |
-
static::$styles_called = true;
|
181 |
-
}
|
182 |
-
|
183 |
-
|
184 |
-
public static function create_nonce( $action ) {
|
185 |
-
$nonce = uniqid();
|
186 |
-
$uid = get_current_user_id();
|
187 |
-
$check = $uid . $action;
|
188 |
-
set_transient( $nonce, $check, HOUR_IN_SECONDS );
|
189 |
-
|
190 |
-
return $nonce;
|
191 |
-
}
|
192 |
-
|
193 |
-
|
194 |
-
public static function verify_nonce( $nonce, $action ) {
|
195 |
-
$active = get_transient( $nonce );
|
196 |
-
$uid = get_current_user_id();
|
197 |
-
$check = $uid . $action;
|
198 |
-
$valid = false;
|
199 |
-
|
200 |
-
if ( $active == $check ) {
|
201 |
-
delete_transient( $nonce );
|
202 |
-
$valid = true;
|
203 |
-
}
|
204 |
-
|
205 |
-
return $valid;
|
206 |
-
}
|
207 |
-
|
208 |
-
|
209 |
-
/**
|
210 |
-
* If incoming link is empty, then get_site_url() is used instead.
|
211 |
-
*/
|
212 |
-
public static function create_link( $link, $title = null, $target = null, $return_as_tag = true ) {
|
213 |
-
if ( empty( $link ) )
|
214 |
-
$link = get_site_url();
|
215 |
-
|
216 |
-
if ( preg_match( '#^\d+$#', $link ) ) {
|
217 |
-
$permalink = get_permalink( $link );
|
218 |
-
$tag_title = get_the_title( $link );
|
219 |
-
if ( empty( $title ) )
|
220 |
-
$title = $tag_title;
|
221 |
-
|
222 |
-
$tag = '<a href="';
|
223 |
-
$tag .= $permalink;
|
224 |
-
$tag .= '" title="';
|
225 |
-
$tag .= $tag_title;
|
226 |
-
$tag .= '">';
|
227 |
-
$tag .= $title;
|
228 |
-
$tag .= '</a>';
|
229 |
-
} else {
|
230 |
-
$orig_link = empty( $title ) ? $link : $title;
|
231 |
-
$do_http = true;
|
232 |
-
|
233 |
-
if ( 0 === strpos( $link, '/' ) )
|
234 |
-
$do_http = false;
|
235 |
-
|
236 |
-
if ( $do_http && 0 === preg_match( '#https?://#', $link ) )
|
237 |
-
$link = 'http://' . $link;
|
238 |
-
|
239 |
-
$permalink = $link;
|
240 |
-
|
241 |
-
$tag = '<a href="';
|
242 |
-
$tag .= $permalink;
|
243 |
-
$tag .= '">';
|
244 |
-
$tag .= $orig_link;
|
245 |
-
$tag .= '</a>';
|
246 |
-
}
|
247 |
-
|
248 |
-
if ( ! empty( $target ) && is_string( $target ) )
|
249 |
-
$tag = links_add_target( $tag, $target );
|
250 |
-
|
251 |
-
if ( $return_as_tag )
|
252 |
-
return $tag;
|
253 |
-
else
|
254 |
-
return array(
|
255 |
-
'link' => $permalink,
|
256 |
-
'tag' => $tag,
|
257 |
-
);
|
258 |
-
}
|
259 |
-
|
260 |
-
|
261 |
-
public static function add_media( $post_id, $media_src, $media_name = null, $featured_image = true ) {
|
262 |
-
require_once ABSPATH . 'wp-admin/includes/image.php';
|
263 |
-
|
264 |
-
if ( empty( $media_name ) )
|
265 |
-
$media_name = basename( $media_src );
|
266 |
-
|
267 |
-
$wp_filetype = wp_check_filetype( $media_name, null );
|
268 |
-
$attachment = array(
|
269 |
-
'post_mime_type' => $wp_filetype['type'],
|
270 |
-
'post_status' => 'inherit',
|
271 |
-
'post_title' => $media_name,
|
272 |
-
);
|
273 |
-
|
274 |
-
$file_move = wp_upload_bits( $media_name, null, self::file_get_contents_curl( $media_src ) );
|
275 |
-
$file_name = $file_move['file'];
|
276 |
-
|
277 |
-
$image_id = wp_insert_attachment( $attachment, $file_name, $post_id );
|
278 |
-
$metadata = wp_generate_attachment_metadata( $image_id, $file_name );
|
279 |
-
wp_update_attachment_metadata( $image_id, $metadata );
|
280 |
-
|
281 |
-
if ( $featured_image )
|
282 |
-
update_post_meta( $post_id, '_thumbnail_id', $image_id );
|
283 |
-
|
284 |
-
return $image_id;
|
285 |
-
}
|
286 |
-
|
287 |
-
|
288 |
-
/**
|
289 |
-
* Thank you Tobylewis
|
290 |
-
*
|
291 |
-
* file_get_contents support on some shared systems is turned off
|
292 |
-
*
|
293 |
-
* @ref http://wordpress.org/support/topic/plugin-flickr-shortcode-importer-file_get_contents-with-url-isp-does-not-support?replies=2#post-2878241
|
294 |
-
*/
|
295 |
-
public static function file_get_contents_curl( $url ) {
|
296 |
-
$ch = curl_init();
|
297 |
-
|
298 |
-
curl_setopt( $ch, CURLOPT_AUTOREFERER, true );
|
299 |
-
curl_setopt( $ch, CURLOPT_HEADER, 0 );
|
300 |
-
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
|
301 |
-
curl_setopt( $ch, CURLOPT_URL, $url );
|
302 |
-
curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, true );
|
303 |
-
|
304 |
-
$data = curl_exec( $ch );
|
305 |
-
curl_close( $ch );
|
306 |
-
|
307 |
-
return $data;
|
308 |
-
}
|
309 |
-
|
310 |
-
|
311 |
-
public static function get_image_src( $image, $strip_protocol = true ) {
|
312 |
-
$doc = new DOMDocument();
|
313 |
-
$doc->loadHTML( $image );
|
314 |
-
$xpath = new DOMXPath( $doc );
|
315 |
-
$src = $xpath->evaluate( 'string(//img/@src)' );
|
316 |
-
|
317 |
-
if ( $strip_protocol )
|
318 |
-
$src = self::strip_protocol( $src );
|
319 |
-
|
320 |
-
return $src;
|
321 |
-
}
|
322 |
-
|
323 |
-
|
324 |
-
public static function clean_string( $string ) {
|
325 |
-
if ( ! is_string( $string ) )
|
326 |
-
return $string;
|
327 |
-
|
328 |
-
return trim( strip_shortcodes( strip_tags( $string ) ) );
|
329 |
-
}
|
330 |
-
|
331 |
-
|
332 |
-
/**
|
333 |
-
* Truncate HTML, close opened tags. UTF-8 aware, and aware of unpaired tags
|
334 |
-
* (which don't need a matching closing tag)
|
335 |
-
*
|
336 |
-
* @param string $html
|
337 |
-
* @param int $max_length Maximum length of the characters of the string
|
338 |
-
* @param string $indicator Suffix to use if string was truncated.
|
339 |
-
* @param boolean $force_indicator Suffix to use if string was truncated.
|
340 |
-
* @return string
|
341 |
-
*
|
342 |
-
* @ref http://pastie.org/3084080
|
343 |
-
*/
|
344 |
-
public static function truncate( $html, $max_length, $indicator = '…', $force_indicator = false ) {
|
345 |
-
$output_length = 0; // number of counted characters stored so far in $output
|
346 |
-
$position = 0; // character offset within input string after last tag/entity
|
347 |
-
$tag_stack = array(); // stack of tags we've encountered but not closed
|
348 |
-
$output = '';
|
349 |
-
$truncated = false;
|
350 |
-
|
351 |
-
/**
|
352 |
-
* these tags don't have matching closing elements, in HTML (in XHTML they
|
353 |
-
* theoretically need a closing /> )
|
354 |
-
*
|
355 |
-
* @see http://www.netstrider.com/tutorials/HTMLRef/a_d.html
|
356 |
-
* @see http://www.w3schools.com/tags/default.asp
|
357 |
-
* @see http://stackoverflow.com/questions/3741896/what-do-you-call-tags-that-need-no-ending-tag
|
358 |
-
*/
|
359 |
-
$unpaired_tags = array(
|
360 |
-
'doctype',
|
361 |
-
'!doctype',
|
362 |
-
'area',
|
363 |
-
'base',
|
364 |
-
'basefont',
|
365 |
-
'bgsound',
|
366 |
-
'br',
|
367 |
-
'col',
|
368 |
-
'embed',
|
369 |
-
'frame',
|
370 |
-
'hr',
|
371 |
-
'img',
|
372 |
-
'input',
|
373 |
-
'link',
|
374 |
-
'meta',
|
375 |
-
'param',
|
376 |
-
'sound',
|
377 |
-
'spacer',
|
378 |
-
'wbr',
|
379 |
-
);
|
380 |
-
|
381 |
-
$func_strcut = function_exists( 'mb_strcut' ) ? 'mb_strcut' : 'substr';
|
382 |
-
$func_strlen = function_exists( 'mb_strlen' ) ? 'mb_strlen' : 'strlen';
|
383 |
-
|
384 |
-
// loop through, splitting at HTML entities or tags
|
385 |
-
while ( $output_length < $max_length && preg_match( '{</?([a-z]+)[^>]*>|&#?[a-zA-Z0-9]+;}', $html, $match, PREG_OFFSET_CAPTURE, $position ) ) {
|
386 |
-
list( $tag, $tag_position ) = $match[0];
|
387 |
-
|
388 |
-
// get text leading up to the tag, and store it – up to max_length
|
389 |
-
$text = $func_strcut( $html, $position, $tag_position - $position );
|
390 |
-
if ( $output_length + $func_strlen( $text ) > $max_length ) {
|
391 |
-
$output .= $func_strcut( $text, 0, $max_length - $output_length );
|
392 |
-
$truncated = true;
|
393 |
-
$output_length = $max_length;
|
394 |
-
break;
|
395 |
-
}
|
396 |
-
|
397 |
-
// store everything, it wasn't too long
|
398 |
-
$output .= $text;
|
399 |
-
$output_length += $func_strlen( $text );
|
400 |
-
|
401 |
-
if ( $tag[0] == '&' ) {
|
402 |
-
// Handle HTML entity by copying straight through
|
403 |
-
$output .= $tag;
|
404 |
-
$output_length++; // only counted as one character
|
405 |
-
} else {
|
406 |
-
// Handle HTML tag
|
407 |
-
$tag_inner = $match[1][0];
|
408 |
-
if ( $tag[1] == '/' ) {
|
409 |
-
// This is a closing tag.
|
410 |
-
$output .= $tag;
|
411 |
-
// If input tags aren't balanced, we leave the popped tag
|
412 |
-
// on the stack so hopefully we're not introducing more
|
413 |
-
// problems.
|
414 |
-
|
415 |
-
if ( end( $tag_stack ) == $tag_inner )
|
416 |
-
array_pop( $tag_stack );
|
417 |
-
} elseif ( $tag[$func_strlen( $tag ) - 2] == '/' || in_array( strtolower( $tag_inner ), $unpaired_tags ) ) {
|
418 |
-
// Self-closing or unpaired tag
|
419 |
-
$output .= $tag;
|
420 |
-
} else {
|
421 |
-
// Opening tag.
|
422 |
-
$output .= $tag;
|
423 |
-
$tag_stack[] = $tag_inner; // push tag onto the stack
|
424 |
-
}
|
425 |
-
}
|
426 |
-
|
427 |
-
// Continue after the tag we just found
|
428 |
-
$position = $tag_position + $func_strlen( $tag );
|
429 |
-
}
|
430 |
-
|
431 |
-
// Print any remaining text after the last tag, if there's room
|
432 |
-
|
433 |
-
if ( $output_length < $max_length && $position < $func_strlen( $html ) )
|
434 |
-
$output .= $func_strcut( $html, $position, $max_length - $output_length );
|
435 |
-
|
436 |
-
$truncated = $func_strlen( $html ) - $position > $max_length - $output_length;
|
437 |
-
|
438 |
-
// add terminator if it was truncated in loop or just above here
|
439 |
-
if ( $truncated || $force_indicator )
|
440 |
-
$output .= $indicator;
|
441 |
-
|
442 |
-
// Close any open tags
|
443 |
-
while ( ! empty( $tag_stack ) )
|
444 |
-
$output .= '</'.array_pop( $tag_stack ).'>';
|
445 |
-
|
446 |
-
return $output;
|
447 |
-
}
|
448 |
-
|
449 |
-
|
450 |
-
public static function strip_protocol( $link ) {
|
451 |
-
if ( ! empty( $link ) ) {
|
452 |
-
$link = preg_replace( '#https?:#', '', $link );
|
453 |
-
}
|
454 |
-
|
455 |
-
return $link;
|
456 |
-
}
|
457 |
-
|
458 |
-
|
459 |
-
}
|
460 |
-
|
461 |
-
|
462 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trunk/includes/libraries/aihrus-framework/class-aihrus-licensing.php
DELETED
@@ -1,188 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
3 |
-
Copyright 2014 Michael Cannon (email: mc@aihr.us)
|
4 |
-
|
5 |
-
This program is free software; you can redistribute it and/or modify
|
6 |
-
it under the terms of the GNU General Public License, version 2, as
|
7 |
-
published by the Free Software Foundation.
|
8 |
-
|
9 |
-
This program is distributed in the hope that it will be useful,
|
10 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12 |
-
GNU General Public License for more details.
|
13 |
-
|
14 |
-
You should have received a copy of the GNU General Public License
|
15 |
-
along with this program; if not, write to the Free Software
|
16 |
-
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
17 |
-
*/
|
18 |
-
|
19 |
-
if ( class_exists( 'Aihrus_Licensing' ) )
|
20 |
-
return;
|
21 |
-
|
22 |
-
require_once 'interface-aihrus-licensing.php';
|
23 |
-
|
24 |
-
|
25 |
-
abstract class Aihrus_Licensing implements Aihrus_Licensing_Interface {
|
26 |
-
public $author;
|
27 |
-
public $item_name;
|
28 |
-
public $slug;
|
29 |
-
public $store_url;
|
30 |
-
|
31 |
-
|
32 |
-
public function __construct( $slug, $item_name, $author = 'Michael Cannon', $store_url = 'http://aihr.us' ) {
|
33 |
-
$this->author = $author;
|
34 |
-
$this->item_name = urlencode( $item_name );
|
35 |
-
$this->slug = $slug;
|
36 |
-
$this->store_url = $store_url;
|
37 |
-
}
|
38 |
-
|
39 |
-
|
40 |
-
public function license_key() {
|
41 |
-
$key = $this->slug . 'license_key';
|
42 |
-
|
43 |
-
return $key;
|
44 |
-
}
|
45 |
-
|
46 |
-
|
47 |
-
public function get_license() {
|
48 |
-
$key = $this->license_key();
|
49 |
-
$license = get_transient( $key );
|
50 |
-
|
51 |
-
return $license;
|
52 |
-
}
|
53 |
-
|
54 |
-
|
55 |
-
public function update_license( $value = null ) {
|
56 |
-
$license = $this->get_license();
|
57 |
-
if ( $license === $value )
|
58 |
-
return $value;
|
59 |
-
|
60 |
-
if ( $this->valid_hash( $value ) ) {
|
61 |
-
$this->set_license( $value );
|
62 |
-
$value = $this->activate_license();
|
63 |
-
$this->set_license( $value );
|
64 |
-
|
65 |
-
return $value;
|
66 |
-
} else {
|
67 |
-
$this->deactivate_license();
|
68 |
-
$this->delete_license();
|
69 |
-
|
70 |
-
return '';
|
71 |
-
}
|
72 |
-
}
|
73 |
-
|
74 |
-
|
75 |
-
public function set_license( $value = null ) {
|
76 |
-
$key = $this->license_key();
|
77 |
-
|
78 |
-
delete_transient( $key );
|
79 |
-
|
80 |
-
if ( ! is_null( $value ) )
|
81 |
-
set_transient( $key, $value, WEEK_IN_SECONDS );
|
82 |
-
}
|
83 |
-
|
84 |
-
|
85 |
-
public function valid_license() {
|
86 |
-
$license = $this->get_license();
|
87 |
-
if ( $this->valid_hash( $license ) )
|
88 |
-
return true;
|
89 |
-
else
|
90 |
-
return false;
|
91 |
-
}
|
92 |
-
|
93 |
-
|
94 |
-
public function get_api_call( $action ) {
|
95 |
-
$license = $this->get_license();
|
96 |
-
$api_params = array(
|
97 |
-
'edd_action' => $action,
|
98 |
-
'item_name' => $this->item_name,
|
99 |
-
'license' => $license,
|
100 |
-
);
|
101 |
-
|
102 |
-
$api_call = add_query_arg(
|
103 |
-
$api_params,
|
104 |
-
$this->store_url
|
105 |
-
);
|
106 |
-
|
107 |
-
return $api_call;
|
108 |
-
}
|
109 |
-
|
110 |
-
|
111 |
-
public function get_remote_get( $api_call ) {
|
112 |
-
$response = wp_remote_get(
|
113 |
-
$api_call,
|
114 |
-
array(
|
115 |
-
'timeout' => 10,
|
116 |
-
'sslverify' => false,
|
117 |
-
)
|
118 |
-
);
|
119 |
-
|
120 |
-
return $response;
|
121 |
-
}
|
122 |
-
|
123 |
-
|
124 |
-
public function activate_license() {
|
125 |
-
$license_data = $this->get_license_data( 'activate_license' );
|
126 |
-
if ( false !== $license_data ) {
|
127 |
-
if ( 'valid' == $license_data->license ) {
|
128 |
-
$license = $this->get_license();
|
129 |
-
|
130 |
-
return $license;
|
131 |
-
}
|
132 |
-
|
133 |
-
return $license_data->license;
|
134 |
-
}
|
135 |
-
|
136 |
-
return false;
|
137 |
-
}
|
138 |
-
|
139 |
-
|
140 |
-
public function get_license_data( $action = 'check_license' ) {
|
141 |
-
$api_call = $this->get_api_call( $action );
|
142 |
-
$response = $this->get_remote_get( $api_call );
|
143 |
-
if ( is_wp_error( $response ) )
|
144 |
-
return false;
|
145 |
-
|
146 |
-
$license_data = json_decode( wp_remote_retrieve_body( $response ) );
|
147 |
-
|
148 |
-
return $license_data;
|
149 |
-
}
|
150 |
-
|
151 |
-
|
152 |
-
public function deactivate_license() {
|
153 |
-
$license_data = $this->get_license_data( 'deactivate_license' );
|
154 |
-
if ( false !== $license_data ) {
|
155 |
-
if ( 'deactivated' == $license_data->license )
|
156 |
-
return true;
|
157 |
-
|
158 |
-
return $license_data->license;
|
159 |
-
}
|
160 |
-
|
161 |
-
return false;
|
162 |
-
}
|
163 |
-
|
164 |
-
|
165 |
-
public function delete_license() {
|
166 |
-
$this->set_license();
|
167 |
-
}
|
168 |
-
|
169 |
-
|
170 |
-
public function license_notice() {
|
171 |
-
$result = '<p><em>' . esc_html( 'Premium features require licensing to function.' ) . '</em></p>';
|
172 |
-
|
173 |
-
return $result;
|
174 |
-
}
|
175 |
-
|
176 |
-
|
177 |
-
public function valid_hash( $value = null ) {
|
178 |
-
if ( is_string( $value ) && preg_match( '#^[0-9a-f]{32}$#i', $value ) )
|
179 |
-
return true;
|
180 |
-
|
181 |
-
return false;
|
182 |
-
}
|
183 |
-
|
184 |
-
|
185 |
-
}
|
186 |
-
|
187 |
-
|
188 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trunk/includes/libraries/aihrus-framework/class-aihrus-settings.php
DELETED
@@ -1,757 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
3 |
-
Copyright 2014 Michael Cannon (email: mc@aihr.us)
|
4 |
-
|
5 |
-
This program is free software; you can redistribute it and/or modify
|
6 |
-
it under the terms of the GNU General Public License, version 2, as
|
7 |
-
published by the Free Software Foundation.
|
8 |
-
|
9 |
-
This program is distributed in the hope that it will be useful,
|
10 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12 |
-
GNU General Public License for more details.
|
13 |
-
|
14 |
-
You should have received a copy of the GNU General Public License
|
15 |
-
along with this program; if not, write to the Free Software
|
16 |
-
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
17 |
-
*/
|
18 |
-
|
19 |
-
/**
|
20 |
-
* Aihrus Framework settings helper class
|
21 |
-
*
|
22 |
-
* Based upon http://alisothegeek.com/2011/01/wordpress-settings-api-tutorial-1/
|
23 |
-
*/
|
24 |
-
|
25 |
-
require_once ABSPATH . 'wp-admin/includes/template.php';
|
26 |
-
|
27 |
-
if ( class_exists( 'Aihrus_Settings' ) )
|
28 |
-
return;
|
29 |
-
|
30 |
-
|
31 |
-
abstract class Aihrus_Settings {
|
32 |
-
public static $default = array(
|
33 |
-
'backwards' => array(
|
34 |
-
'version' => null, // below this version number, use std
|
35 |
-
'std' => null,
|
36 |
-
),
|
37 |
-
'choices' => array(), // key => value
|
38 |
-
'class' => null, // warning, etc.
|
39 |
-
'desc' => null,
|
40 |
-
'id' => null,
|
41 |
-
'section' => 'general',
|
42 |
-
'show_code' => false,
|
43 |
-
'std' => null, // default key or value
|
44 |
-
'suggest' => false, // attempt for auto-suggest on inputs
|
45 |
-
'title' => null,
|
46 |
-
'type' => 'text', // textarea, checkbox, radio, select, hidden, heading, password, expand_begin, expand_end
|
47 |
-
'validate' => null, // required, term, slug, slugs, ids, order, single paramater PHP functions
|
48 |
-
'widget' => 1, // show in widget options, 0 off
|
49 |
-
);
|
50 |
-
|
51 |
-
|
52 |
-
public function __construct() {}
|
53 |
-
|
54 |
-
|
55 |
-
public static function load_options() {
|
56 |
-
static::sections();
|
57 |
-
static::settings();
|
58 |
-
}
|
59 |
-
|
60 |
-
|
61 |
-
public static function sections() {
|
62 |
-
static::$sections['reset'] = esc_html__( 'Reset' );
|
63 |
-
static::$sections['about'] = esc_html__( 'About' );
|
64 |
-
}
|
65 |
-
|
66 |
-
|
67 |
-
/**
|
68 |
-
*
|
69 |
-
*
|
70 |
-
* @SuppressWarnings(PHPMD.Superglobals)
|
71 |
-
*/
|
72 |
-
public static function settings() {
|
73 |
-
// Reset section defaults
|
74 |
-
$options = get_option( static::ID );
|
75 |
-
if ( ! empty( $options ) ) {
|
76 |
-
$serialized_options = serialize( $options );
|
77 |
-
$_SESSION['export'] = $serialized_options;
|
78 |
-
|
79 |
-
static::$settings['export'] = array(
|
80 |
-
'section' => 'reset',
|
81 |
-
'title' => esc_html__( 'Export Settings' ),
|
82 |
-
'type' => 'readonly',
|
83 |
-
'desc' => esc_html__( 'These are your current settings in a serialized format. Copy the contents to make a backup of your settings.' ),
|
84 |
-
'std' => $serialized_options,
|
85 |
-
'widget' => 0,
|
86 |
-
);
|
87 |
-
}
|
88 |
-
|
89 |
-
static::$settings['import'] = array(
|
90 |
-
'section' => 'reset',
|
91 |
-
'title' => esc_html__( 'Import Settings' ),
|
92 |
-
'type' => 'textarea',
|
93 |
-
'desc' => esc_html__( 'Paste new serialized settings here to overwrite your current configuration.' ),
|
94 |
-
'widget' => 0,
|
95 |
-
);
|
96 |
-
|
97 |
-
$desc = esc_html__( 'Delete all %s data and options from database on plugin deletion. Even if this option isn\'t checked, WordPress will still give a data deletion warning.' );
|
98 |
-
|
99 |
-
static::$settings['delete_data'] = array(
|
100 |
-
'section' => 'reset',
|
101 |
-
'title' => esc_html__( 'Remove Plugin Data on Deletion?' ),
|
102 |
-
'type' => 'checkbox',
|
103 |
-
'class' => 'warning',
|
104 |
-
'desc' => sprintf( $desc, static::NAME ),
|
105 |
-
'widget' => 0,
|
106 |
-
);
|
107 |
-
|
108 |
-
static::$settings['reset_defaults'] = array(
|
109 |
-
'section' => 'reset',
|
110 |
-
'title' => esc_html__( 'Reset to Defaults?' ),
|
111 |
-
'type' => 'checkbox',
|
112 |
-
'class' => 'warning',
|
113 |
-
'desc' => esc_html__( 'Check this box to reset options to their defaults' ),
|
114 |
-
);
|
115 |
-
}
|
116 |
-
|
117 |
-
|
118 |
-
public static function get_defaults( $mode = null, $old_version = null ) {
|
119 |
-
if ( empty( static::$defaults ) )
|
120 |
-
static::settings();
|
121 |
-
|
122 |
-
$do_backwards = false;
|
123 |
-
if ( 'backwards' == $mode ) {
|
124 |
-
if ( ! empty( $old_version ) )
|
125 |
-
$do_backwards = true;
|
126 |
-
}
|
127 |
-
|
128 |
-
foreach ( static::$settings as $id => $parts ) {
|
129 |
-
$std = isset( $parts['std'] ) ? $parts['std'] : '';
|
130 |
-
if ( $do_backwards ) {
|
131 |
-
$version = ! empty( $parts['backwards']['version'] ) ? $parts['backwards']['version'] : false;
|
132 |
-
if ( ! empty( $version ) ) {
|
133 |
-
if ( $old_version < $version )
|
134 |
-
$std = $parts['backwards']['std'];
|
135 |
-
}
|
136 |
-
}
|
137 |
-
|
138 |
-
static::$defaults[ $id ] = $std;
|
139 |
-
}
|
140 |
-
|
141 |
-
return static::$defaults;
|
142 |
-
}
|
143 |
-
|
144 |
-
|
145 |
-
public static function get_settings() {
|
146 |
-
if ( empty( static::$settings ) )
|
147 |
-
static::settings();
|
148 |
-
|
149 |
-
return static::$settings;
|
150 |
-
}
|
151 |
-
|
152 |
-
|
153 |
-
public static function initialize_settings( $version = null ) {
|
154 |
-
$defaults = static::get_defaults( 'backwards' );
|
155 |
-
$current = get_option( static::ID );
|
156 |
-
$current = wp_parse_args( $current, $defaults );
|
157 |
-
|
158 |
-
$current['admin_notices'] = $version;
|
159 |
-
$current['version'] = static::$version;
|
160 |
-
|
161 |
-
update_option( static::ID, $current );
|
162 |
-
}
|
163 |
-
|
164 |
-
|
165 |
-
/**
|
166 |
-
*
|
167 |
-
*
|
168 |
-
* @SuppressWarnings(PHPMD.UnusedLocalVariable)
|
169 |
-
*/
|
170 |
-
public static function create_setting( $args = array() ) {
|
171 |
-
extract( $args );
|
172 |
-
|
173 |
-
if ( preg_match( '#(_expand_begin|_expand_end)#', $id ) )
|
174 |
-
return;
|
175 |
-
|
176 |
-
$field_args = array(
|
177 |
-
'choices' => $choices,
|
178 |
-
'class' => $class,
|
179 |
-
'desc' => $desc,
|
180 |
-
'id' => $id,
|
181 |
-
'label_for' => $id,
|
182 |
-
'show_code' => $show_code,
|
183 |
-
'std' => $std,
|
184 |
-
'suggest' => $suggest,
|
185 |
-
'type' => $type,
|
186 |
-
);
|
187 |
-
|
188 |
-
static::$defaults[$id] = $std;
|
189 |
-
|
190 |
-
add_settings_field( $id, $title, array( static::$class, 'display_setting' ), static::ID, $section, $field_args );
|
191 |
-
}
|
192 |
-
|
193 |
-
|
194 |
-
public static function section_scripts() {
|
195 |
-
echo '
|
196 |
-
<script type="text/javascript">
|
197 |
-
jQuery(document).ready(function($) {
|
198 |
-
$( "#' . static::ID . '" ).tabs();
|
199 |
-
// This will make the "warning" checkbox class really stand out when checked.
|
200 |
-
$(".warning").change(function() {
|
201 |
-
if ($(this).is(":checked"))
|
202 |
-
$(this).parent().css("background", "#c00").css("color", "#fff").css("fontWeight", "bold");
|
203 |
-
else
|
204 |
-
$(this).parent().css("background", "inherit").css("color", "inherit").css("fontWeight", "inherit");
|
205 |
-
});
|
206 |
-
});
|
207 |
-
</script>
|
208 |
-
';
|
209 |
-
}
|
210 |
-
|
211 |
-
|
212 |
-
public static function do_settings_sections( $page ) {
|
213 |
-
global $wp_settings_sections, $wp_settings_fields;
|
214 |
-
|
215 |
-
if ( ! isset( $wp_settings_sections ) || ! isset( $wp_settings_sections[$page] ) )
|
216 |
-
return;
|
217 |
-
|
218 |
-
foreach ( (array) $wp_settings_sections[$page] as $section ) {
|
219 |
-
if ( $section['callback'] )
|
220 |
-
call_user_func( $section['callback'], $section );
|
221 |
-
|
222 |
-
if ( ! isset( $wp_settings_fields ) || ! isset( $wp_settings_fields[$page] ) || ! isset( $wp_settings_fields[$page][$section['id']] ) )
|
223 |
-
continue;
|
224 |
-
|
225 |
-
echo '<table id=' . $section['id'] . ' class="form-table">';
|
226 |
-
do_settings_fields( $page, $section['id'] );
|
227 |
-
echo '</table>';
|
228 |
-
}
|
229 |
-
}
|
230 |
-
|
231 |
-
|
232 |
-
public static function display_section() {}
|
233 |
-
|
234 |
-
|
235 |
-
public static function display_about() {
|
236 |
-
$name = str_replace( ' Settings', '', static::NAME );
|
237 |
-
$text = __( '<img class="alignright size-medium" src="%1$simages/michael-cannon-red-square-300x2251.jpg" alt="Michael in Red Square, Moscow, Russia" width="300" height="225" /><a href="%2$s">%3$s</a> is by <a href="%4$s">Michael Cannon</a>. He\'s <a href="%5$s">Peichi’s</a> smiling man, an adventurous <a href="%6$s" target="_blank">water-rat</a>, <a href="%7$s">chief people officer</a>, <a href="%8$s">cyclist</a>, <a href="%9$s">full stack developer</a>, <a href="%10$s">poet</a>, <a href="%11$s">WWOOF’er</a> and <a href="%12$s">world traveler</a>.' );
|
238 |
-
|
239 |
-
echo '<div id="about" style="width: 70%; min-height: 225px;"><p>';
|
240 |
-
echo sprintf(
|
241 |
-
$text,
|
242 |
-
static::$plugin_assets,
|
243 |
-
esc_url( static::$plugin_url ),
|
244 |
-
$name,
|
245 |
-
esc_url( 'http://aihr.us/resume/' ),
|
246 |
-
esc_url( 'http://peimic.com/t/peichi-liu/' ),
|
247 |
-
esc_url( 'http://www.chinesehoroscope.org/chinese_zodiac/rat/' ),
|
248 |
-
esc_url( 'http://axelerant.com/who-we-are' ),
|
249 |
-
esc_url( 'http://peimic.com/c/biking/' ),
|
250 |
-
esc_url( 'http://aihr.us/about-aihrus/' ),
|
251 |
-
esc_url( 'http://peimic.com/t/poetry/' ),
|
252 |
-
esc_url( 'http://peimic.com/t/WWOOF/' ),
|
253 |
-
esc_url( 'http://peimic.com/c/travel/' )
|
254 |
-
);
|
255 |
-
echo '</p></div>';
|
256 |
-
}
|
257 |
-
|
258 |
-
|
259 |
-
public static function display_page( $disable_donate = false ) {
|
260 |
-
echo '<div class="wrap">
|
261 |
-
<div class="icon32" id="icon-options-general"></div>
|
262 |
-
<h2>' . static::NAME . '</h2>';
|
263 |
-
|
264 |
-
echo '<form action="options.php" method="post">';
|
265 |
-
|
266 |
-
settings_errors( static::ID );
|
267 |
-
settings_fields( static::ID );
|
268 |
-
|
269 |
-
echo '<div id="' . static::ID . '">
|
270 |
-
<ul>';
|
271 |
-
|
272 |
-
foreach ( static::$sections as $section_slug => $section )
|
273 |
-
echo '<li><a href="#' . $section_slug . '">' . $section . '</a></li>';
|
274 |
-
|
275 |
-
echo '</ul>';
|
276 |
-
|
277 |
-
self::do_settings_sections( static::ID );
|
278 |
-
|
279 |
-
echo '
|
280 |
-
<p class="submit"><input name="Submit" type="submit" class="button-primary" value="' . esc_html__( 'Save Changes' ) . '" /></p>
|
281 |
-
</form>
|
282 |
-
</div>
|
283 |
-
';
|
284 |
-
|
285 |
-
if ( ! $disable_donate ) {
|
286 |
-
echo '<p>' .
|
287 |
-
sprintf(
|
288 |
-
__( 'If you like this plugin, please <a href="%1$s" title="Donate for Good Karma"><img src="%2$s" border="0" alt="Donate for Good Karma" /></a> or <a href="%3$s" title="purchase premium WordPress plugins from Aihrus ">purchase the Premium version</a> to help fund further development and <a href="%4$s" title="Support forums">support</a>.' ),
|
289 |
-
esc_url( 'http://aihr.us/about-aihrus/donate/' ),
|
290 |
-
esc_url( 'https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif' ),
|
291 |
-
esc_url( 'http://aihr.us/store/' ),
|
292 |
-
esc_url( 'https://aihrus.zendesk.com/home' )
|
293 |
-
) .
|
294 |
-
'</p>';
|
295 |
-
}
|
296 |
-
|
297 |
-
echo '<p class="copyright">' .
|
298 |
-
sprintf(
|
299 |
-
__( 'Copyright ©%1$s <a href="%2$s">Aihrus</a>.' ),
|
300 |
-
date( 'Y' ),
|
301 |
-
esc_url( 'http://aihr.us' )
|
302 |
-
) .
|
303 |
-
'</p>';
|
304 |
-
|
305 |
-
echo '</div>';
|
306 |
-
|
307 |
-
add_action( 'admin_footer', array( static::$class, 'section_scripts' ) );
|
308 |
-
}
|
309 |
-
|
310 |
-
|
311 |
-
public static function display_setting( $args = array(), $do_echo = true, $input = null ) {
|
312 |
-
$content = '';
|
313 |
-
|
314 |
-
extract( $args );
|
315 |
-
|
316 |
-
if ( is_null( $input ) )
|
317 |
-
$options = get_option( static::ID );
|
318 |
-
else {
|
319 |
-
$options = array();
|
320 |
-
$options[$id] = $input;
|
321 |
-
}
|
322 |
-
|
323 |
-
if ( ! isset( $options[$id] ) && $type != 'checkbox' )
|
324 |
-
$options[$id] = $std;
|
325 |
-
elseif ( ! isset( $options[$id] ) )
|
326 |
-
$options[$id] = 0;
|
327 |
-
|
328 |
-
$field_class = '';
|
329 |
-
if ( ! empty( $class ) )
|
330 |
-
$field_class = ' ' . $class;
|
331 |
-
|
332 |
-
// desc isn't escaped because it's might contain allowed html
|
333 |
-
$choices = array_map( 'esc_attr', $choices );
|
334 |
-
$field_class = esc_attr( $field_class );
|
335 |
-
$id = esc_attr( $id );
|
336 |
-
$field_value = esc_attr( $options[$id] );
|
337 |
-
$std = esc_attr( $std );
|
338 |
-
|
339 |
-
switch ( $type ) {
|
340 |
-
case 'checkbox':
|
341 |
-
$content .= '<input class="checkbox' . $field_class . '" type="checkbox" id="' . $id . '" name="' . static::ID . '[' . $id . ']" value="1" ' . checked( $field_value, 1, false ) . ' /> ';
|
342 |
-
|
343 |
-
if ( ! empty( $desc ) )
|
344 |
-
$content .= '<label for="' . $id . '"><span class="description">' . $desc . '</span></label>';
|
345 |
-
|
346 |
-
if ( $show_code )
|
347 |
-
$content .= '<br /><code>' . $id . '</code>';
|
348 |
-
break;
|
349 |
-
|
350 |
-
case 'file':
|
351 |
-
$content .= '<input class="regular-text' . $field_class . '" type="file" id="' . $id . '" name="' . static::ID . '[' . $id . ']" />';
|
352 |
-
|
353 |
-
if ( ! empty( $desc ) )
|
354 |
-
$content .= '<br /><span class="description">' . $desc . '</span>';
|
355 |
-
|
356 |
-
break;
|
357 |
-
|
358 |
-
case 'heading':
|
359 |
-
$content .= '</td></tr><tr valign="top"><td colspan="2"><h4>' . $desc . '</h4>';
|
360 |
-
break;
|
361 |
-
|
362 |
-
case 'hidden':
|
363 |
-
$content .= '<input type="hidden" id="' . $id . '" name="' . static::ID . '[' . $id . ']" value="' . $field_value . '" />';
|
364 |
-
|
365 |
-
break;
|
366 |
-
|
367 |
-
case 'password':
|
368 |
-
$content .= '<input class="regular-text' . $field_class . '" type="password" id="' . $id . '" name="' . static::ID . '[' . $id . ']" value="' . $field_value . '" />';
|
369 |
-
|
370 |
-
if ( ! empty( $desc ) )
|
371 |
-
$content .= '<br /><span class="description">' . $desc . '</span>';
|
372 |
-
|
373 |
-
break;
|
374 |
-
|
375 |
-
case 'radio':
|
376 |
-
$i = 1;
|
377 |
-
$count_choices = count( $choices );
|
378 |
-
foreach ( $choices as $value => $label ) {
|
379 |
-
$content .= '<input class="radio' . $field_class . '" type="radio" name="' . static::ID . '[' . $id . ']" id="' . $id . $i . '" value="' . $value . '" ' . checked( $field_value, $value, false ) . '> <label for="' . $id . $i . '">' . $label . '</label>';
|
380 |
-
|
381 |
-
if ( $i < $count_choices )
|
382 |
-
$content .= '<br />';
|
383 |
-
|
384 |
-
$i++;
|
385 |
-
}
|
386 |
-
|
387 |
-
if ( ! empty( $desc ) )
|
388 |
-
$content .= '<br /><span class="description">' . $desc . '</span>';
|
389 |
-
|
390 |
-
if ( $show_code )
|
391 |
-
$content .= '<br /><code>' . $id . '</code>';
|
392 |
-
break;
|
393 |
-
|
394 |
-
case 'readonly':
|
395 |
-
$content .= '<input class="regular-text' . $field_class . '" type="text" id="' . $id . '" name="' . static::ID . '[' . $id . ']" value="' . $field_value . '" readonly="readonly" />';
|
396 |
-
|
397 |
-
if ( ! empty( $desc ) )
|
398 |
-
$content .= '<br /><span class="description">' . $desc . '</span>';
|
399 |
-
|
400 |
-
break;
|
401 |
-
|
402 |
-
case 'select':
|
403 |
-
$content .= '<select class="select' . $field_class . '" id="' . $id . '" name="' . static::ID . '[' . $id . ']">';
|
404 |
-
|
405 |
-
foreach ( $choices as $value => $label )
|
406 |
-
$content .= '<option value="' . $value . '"' . selected( $field_value, $value, false ) . '>' . $label . '</option>';
|
407 |
-
|
408 |
-
$content .= '</select>';
|
409 |
-
|
410 |
-
if ( ! empty( $desc ) )
|
411 |
-
$content .= '<br /><span class="description">' . $desc . '</span>';
|
412 |
-
|
413 |
-
if ( $show_code )
|
414 |
-
$content .= '<br /><code>' . $id . '</code>';
|
415 |
-
break;
|
416 |
-
|
417 |
-
case 'text':
|
418 |
-
$content .= '<input class="regular-text' . $field_class . '" type="text" id="' . $id . '" name="' . static::ID . '[' . $id . ']" placeholder="' . $std . '" value="' . $field_value . '" />';
|
419 |
-
|
420 |
-
if ( ! empty( $desc ) )
|
421 |
-
$content .= '<br /><span class="description">' . $desc . '</span>';
|
422 |
-
|
423 |
-
if ( $show_code )
|
424 |
-
$content .= '<br /><code>' . $id . '</code>';
|
425 |
-
break;
|
426 |
-
|
427 |
-
case 'textarea':
|
428 |
-
$content .= '<textarea class="' . $field_class . '" id="' . $id . '" name="' . static::ID . '[' . $id . ']" placeholder="' . $std . '" rows="5" cols="30">' . $field_value . '</textarea>';
|
429 |
-
|
430 |
-
if ( ! empty( $desc ) )
|
431 |
-
$content .= '<br /><span class="description">' . $desc . '</span>';
|
432 |
-
|
433 |
-
if ( $show_code )
|
434 |
-
$content .= '<br /><code>' . $id . '</code>';
|
435 |
-
break;
|
436 |
-
|
437 |
-
default:
|
438 |
-
break;
|
439 |
-
}
|
440 |
-
|
441 |
-
if ( ! $do_echo )
|
442 |
-
return $content;
|
443 |
-
|
444 |
-
echo $content;
|
445 |
-
}
|
446 |
-
|
447 |
-
|
448 |
-
public static function register_settings() {
|
449 |
-
register_setting( static::ID, static::ID, array( static::$class, 'validate_settings' ) );
|
450 |
-
|
451 |
-
foreach ( static::$sections as $slug => $title ) {
|
452 |
-
if ( $slug == 'about' )
|
453 |
-
add_settings_section( $slug, $title, array( static::$class, 'display_about' ), static::ID );
|
454 |
-
else
|
455 |
-
add_settings_section( $slug, $title, array( static::$class, 'display_section' ), static::ID );
|
456 |
-
}
|
457 |
-
|
458 |
-
foreach ( static::$settings as $id => $setting ) {
|
459 |
-
$setting['id'] = $id;
|
460 |
-
static::create_setting( $setting );
|
461 |
-
}
|
462 |
-
}
|
463 |
-
|
464 |
-
|
465 |
-
public static function scripts() {
|
466 |
-
wp_enqueue_script( 'jquery-ui-tabs' );
|
467 |
-
}
|
468 |
-
|
469 |
-
|
470 |
-
public static function styles() {
|
471 |
-
wp_register_style( 'jquery-style', '//ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/smoothness/jquery-ui.css' );
|
472 |
-
wp_enqueue_style( 'jquery-style' );
|
473 |
-
}
|
474 |
-
|
475 |
-
|
476 |
-
/**
|
477 |
-
*
|
478 |
-
*
|
479 |
-
* @SuppressWarnings(PHPMD.Superglobals)
|
480 |
-
*/
|
481 |
-
public static function validate_settings( $input, $options = null, $do_errors = false ) {
|
482 |
-
$errors = array();
|
483 |
-
|
484 |
-
$null_options = false;
|
485 |
-
if ( is_null( $options ) ) {
|
486 |
-
$null_options = true;
|
487 |
-
|
488 |
-
$defaults = static::get_defaults();
|
489 |
-
$options = self::get_settings();
|
490 |
-
|
491 |
-
if ( is_admin() ) {
|
492 |
-
if ( ! empty( $input['reset_defaults'] ) ) {
|
493 |
-
foreach ( $defaults as $id => $std )
|
494 |
-
$input[$id] = $std;
|
495 |
-
|
496 |
-
unset( $input['reset_defaults'] );
|
497 |
-
|
498 |
-
$input['resetted'] = true;
|
499 |
-
}
|
500 |
-
|
501 |
-
if ( ! empty( $input['import'] ) && $_SESSION['export'] != $input['import'] ) {
|
502 |
-
$import = $input['import'];
|
503 |
-
$unserialized = unserialize( $import );
|
504 |
-
if ( is_array( $unserialized ) ) {
|
505 |
-
foreach ( $unserialized as $id => $std )
|
506 |
-
$input[$id] = $std;
|
507 |
-
}
|
508 |
-
}
|
509 |
-
}
|
510 |
-
}
|
511 |
-
|
512 |
-
foreach ( $options as $id => $parts ) {
|
513 |
-
$default = $parts['std'];
|
514 |
-
$type = $parts['type'];
|
515 |
-
$validations = ! empty( $parts['validate'] ) ? $parts['validate'] : array();
|
516 |
-
if ( ! empty( $validations ) )
|
517 |
-
$validations = explode( ',', $validations );
|
518 |
-
|
519 |
-
if ( ! isset( $input[ $id ] ) ) {
|
520 |
-
if ( 'checkbox' != $type ) {
|
521 |
-
$input[ $id ] = $default;
|
522 |
-
} else {
|
523 |
-
if ( empty( $parts['widget'] ) ) {
|
524 |
-
continue;
|
525 |
-
} else {
|
526 |
-
$input[ $id ] = 0;
|
527 |
-
}
|
528 |
-
}
|
529 |
-
}
|
530 |
-
|
531 |
-
if ( $default == $input[ $id ] && ! in_array( 'required', $validations ) )
|
532 |
-
continue;
|
533 |
-
|
534 |
-
if ( 'checkbox' == $type ) {
|
535 |
-
if ( self::is_true( $input[ $id ] ) )
|
536 |
-
$input[ $id ] = 1;
|
537 |
-
else
|
538 |
-
$input[ $id ] = 0;
|
539 |
-
} elseif ( in_array( $type, array( 'radio', 'select' ) ) ) {
|
540 |
-
// single choices only
|
541 |
-
$keys = array_keys( $parts['choices'] );
|
542 |
-
|
543 |
-
if ( ! in_array( $input[ $id ], $keys ) ) {
|
544 |
-
if ( self::is_true( $input[ $id ] ) )
|
545 |
-
$input[ $id ] = 1;
|
546 |
-
else
|
547 |
-
$input[ $id ] = 0;
|
548 |
-
}
|
549 |
-
}
|
550 |
-
|
551 |
-
if ( ! empty( $validations ) ) {
|
552 |
-
foreach ( $validations as $validate )
|
553 |
-
self::validators( $validate, $id, $input, $default, $errors );
|
554 |
-
}
|
555 |
-
}
|
556 |
-
|
557 |
-
unset( $input['export'] );
|
558 |
-
unset( $input['import'] );
|
559 |
-
|
560 |
-
$hide_update_notice = false;
|
561 |
-
if ( isset( static::$hide_update_notice ) && ! empty( static::$hide_update_notice ) ) {
|
562 |
-
$hide_update_notice = true;
|
563 |
-
}
|
564 |
-
|
565 |
-
if ( $null_options && empty( $errors ) && ! $hide_update_notice ) {
|
566 |
-
add_settings_error( static::ID, 'settings_updated', esc_html__( 'Settings saved.' ), 'updated' );
|
567 |
-
set_transient( 'settings_errors', get_settings_errors(), 30 );
|
568 |
-
}
|
569 |
-
|
570 |
-
if ( empty( $do_errors ) ) {
|
571 |
-
$validated = $input;
|
572 |
-
} else {
|
573 |
-
$validated = array(
|
574 |
-
'input' => $input,
|
575 |
-
'errors' => $errors,
|
576 |
-
);
|
577 |
-
}
|
578 |
-
|
579 |
-
return $validated;
|
580 |
-
}
|
581 |
-
|
582 |
-
|
583 |
-
public static function validators( $validate, $id, &$input, $default, &$errors ) {
|
584 |
-
switch ( $validate ) {
|
585 |
-
case 'absint':
|
586 |
-
case 'intval':
|
587 |
-
if ( '' !== $input[ $id ] )
|
588 |
-
$input[ $id ] = $validate( $input[ $id ] );
|
589 |
-
else
|
590 |
-
$input[ $id ] = $default;
|
591 |
-
break;
|
592 |
-
|
593 |
-
case 'ids':
|
594 |
-
$input[ $id ] = self::validate_ids( $input[ $id ], $default );
|
595 |
-
break;
|
596 |
-
|
597 |
-
case 'is_true':
|
598 |
-
$input[ $id ] = self::is_true( $input[ $id ] );
|
599 |
-
break;
|
600 |
-
|
601 |
-
case 'min1':
|
602 |
-
$input[ $id ] = intval( $input[ $id ] );
|
603 |
-
if ( 0 >= $input[ $id ] )
|
604 |
-
$input[ $id ] = $default;
|
605 |
-
break;
|
606 |
-
|
607 |
-
case 'nozero':
|
608 |
-
$input[ $id ] = intval( $input[ $id ] );
|
609 |
-
if ( 0 === $input[ $id ] )
|
610 |
-
$input[ $id ] = $default;
|
611 |
-
break;
|
612 |
-
|
613 |
-
case 'order':
|
614 |
-
$input[ $id ] = self::validate_order( $input[ $id ], $default );
|
615 |
-
break;
|
616 |
-
|
617 |
-
case 'required':
|
618 |
-
if ( empty( $input[ $id ] ) )
|
619 |
-
$errors[ $id ] = esc_html__( 'Required' );
|
620 |
-
break;
|
621 |
-
|
622 |
-
case 'slash_sanitize_title':
|
623 |
-
$temp = explode( '/', $input[ $id ] );
|
624 |
-
$temp = array_map( 'sanitize_title', $temp );
|
625 |
-
$temp = implode( '/', $temp );
|
626 |
-
|
627 |
-
$input[ $id ] = $temp;
|
628 |
-
break;
|
629 |
-
|
630 |
-
case 'slug':
|
631 |
-
$input[ $id ] = self::validate_slug( $input[ $id ], $default );
|
632 |
-
$input[ $id ] = strtolower( $input[ $id ] );
|
633 |
-
break;
|
634 |
-
|
635 |
-
case 'slugs':
|
636 |
-
$input[ $id ] = self::validate_slugs( $input[ $id ], $default );
|
637 |
-
$input[ $id ] = strtolower( $input[ $id ] );
|
638 |
-
break;
|
639 |
-
|
640 |
-
case 'term':
|
641 |
-
$input[ $id ] = self::validate_term( $input[ $id ], $default );
|
642 |
-
$input[ $id ] = strtolower( $input[ $id ] );
|
643 |
-
break;
|
644 |
-
|
645 |
-
case 'terms':
|
646 |
-
$input[ $id ] = self::validate_terms( $input[ $id ], $default );
|
647 |
-
break;
|
648 |
-
|
649 |
-
case 'trim':
|
650 |
-
$options = explode( "\n", $input[ $id ] );
|
651 |
-
foreach ( $options as $key => $value )
|
652 |
-
$options[ $key ] = trim( $value );
|
653 |
-
|
654 |
-
$input[ $id ] = implode( "\n", $options );
|
655 |
-
break;
|
656 |
-
|
657 |
-
case 'url':
|
658 |
-
$input[ $id ] = self::validate_url( $input[ $id ], $default );
|
659 |
-
break;
|
660 |
-
|
661 |
-
default:
|
662 |
-
$input[ $id ] = $validate( $input[ $id ] );
|
663 |
-
break;
|
664 |
-
}
|
665 |
-
}
|
666 |
-
|
667 |
-
|
668 |
-
public static function validate_ids( $input, $default ) {
|
669 |
-
if ( preg_match( '#^\d+(,\s?\d+)*$#', $input ) )
|
670 |
-
return preg_replace( '#\s#', '', $input );
|
671 |
-
|
672 |
-
return $default;
|
673 |
-
}
|
674 |
-
|
675 |
-
|
676 |
-
public static function validate_order( $input, $default ) {
|
677 |
-
if ( preg_match( '#^desc|asc$#i', $input ) )
|
678 |
-
return $input;
|
679 |
-
|
680 |
-
return $default;
|
681 |
-
}
|
682 |
-
|
683 |
-
|
684 |
-
public static function validate_slugs( $input, $default ) {
|
685 |
-
if ( preg_match( '#^[\w-]+(,\s?[\w-]+)*$#', $input ) )
|
686 |
-
return preg_replace( '#\s#', '', $input );
|
687 |
-
|
688 |
-
return $default;
|
689 |
-
}
|
690 |
-
|
691 |
-
|
692 |
-
public static function validate_slug( $input, $default ) {
|
693 |
-
if ( preg_match( '#^[\w-]+$#', $input ) )
|
694 |
-
return $input;
|
695 |
-
|
696 |
-
return $default;
|
697 |
-
}
|
698 |
-
|
699 |
-
|
700 |
-
public static function validate_term( $input, $default ) {
|
701 |
-
if ( preg_match( '#^\w+$#', $input ) )
|
702 |
-
return $input;
|
703 |
-
|
704 |
-
return $default;
|
705 |
-
}
|
706 |
-
|
707 |
-
|
708 |
-
/**
|
709 |
-
* Let values like true, 'true', 1, 'on', and 'yes' to be true. Else, false
|
710 |
-
*/
|
711 |
-
public static function is_true( $value = null, $return_boolean = true ) {
|
712 |
-
if ( true === $value || 'true' == strtolower( $value ) || 1 == $value || 'on' == strtolower( $value ) || 'yes' == strtolower( $value ) ) {
|
713 |
-
if ( $return_boolean )
|
714 |
-
return true;
|
715 |
-
else
|
716 |
-
return 1;
|
717 |
-
} else {
|
718 |
-
if ( $return_boolean )
|
719 |
-
return false;
|
720 |
-
else
|
721 |
-
return 0;
|
722 |
-
}
|
723 |
-
}
|
724 |
-
|
725 |
-
|
726 |
-
public static function validate_terms( $input, $default ) {
|
727 |
-
if ( preg_match( '#^(([\w- ]+)(,\s?)?)+$#', $input ) )
|
728 |
-
return preg_replace( '#,\s*$#', '', $input );
|
729 |
-
|
730 |
-
return $default;
|
731 |
-
}
|
732 |
-
|
733 |
-
|
734 |
-
public static function validate_url( $input, $default ) {
|
735 |
-
if ( filter_var( $input, FILTER_VALIDATE_URL ) )
|
736 |
-
return $input;
|
737 |
-
|
738 |
-
return $default;
|
739 |
-
}
|
740 |
-
|
741 |
-
|
742 |
-
public static function get_scripts() {
|
743 |
-
foreach ( static::$scripts as $script )
|
744 |
-
echo $script;
|
745 |
-
}
|
746 |
-
|
747 |
-
|
748 |
-
public static function get_styles() {
|
749 |
-
foreach ( static::$styles as $style )
|
750 |
-
echo $style;
|
751 |
-
}
|
752 |
-
|
753 |
-
|
754 |
-
}
|
755 |
-
|
756 |
-
|
757 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trunk/includes/libraries/aihrus-framework/class-aihrus-widget.php
DELETED
@@ -1,252 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
3 |
-
Copyright 2014 Michael Cannon (email: mc@aihr.us)
|
4 |
-
|
5 |
-
This program is free software; you can redistribute it and/or modify
|
6 |
-
it under the terms of the GNU General Public License, version 2, as
|
7 |
-
published by the Free Software Foundation.
|
8 |
-
|
9 |
-
This program is distributed in the hope that it will be useful,
|
10 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12 |
-
GNU General Public License for more details.
|
13 |
-
|
14 |
-
You should have received a copy of the GNU General Public License
|
15 |
-
along with this program; if not, write to the Free Software
|
16 |
-
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
17 |
-
*/
|
18 |
-
|
19 |
-
if ( class_exists( 'Aihrus_Widget' ) )
|
20 |
-
return;
|
21 |
-
|
22 |
-
require_once 'interface-aihrus-widget.php';
|
23 |
-
|
24 |
-
|
25 |
-
abstract class Aihrus_Widget extends WP_Widget implements Aihrus_Widget_Interface {
|
26 |
-
public static $suggest_id = 0;
|
27 |
-
|
28 |
-
|
29 |
-
public function __construct( $classname, $description, $id_base, $title ) {
|
30 |
-
// Widget settings
|
31 |
-
$widget_ops = array(
|
32 |
-
'classname' => $classname,
|
33 |
-
'description' => $description,
|
34 |
-
);
|
35 |
-
|
36 |
-
// Widget control settings
|
37 |
-
$control_ops = array(
|
38 |
-
'id_base' => $id_base,
|
39 |
-
);
|
40 |
-
|
41 |
-
// Create the widget
|
42 |
-
$this->WP_Widget(
|
43 |
-
static::ID,
|
44 |
-
$title,
|
45 |
-
$widget_ops,
|
46 |
-
$control_ops
|
47 |
-
);
|
48 |
-
}
|
49 |
-
|
50 |
-
|
51 |
-
public function widget( $args, $instance ) {
|
52 |
-
global $before_widget, $before_title, $after_title, $after_widget;
|
53 |
-
|
54 |
-
$args = wp_parse_args( $args, static::get_defaults() );
|
55 |
-
extract( $args );
|
56 |
-
|
57 |
-
// Our variables from the widget settings
|
58 |
-
$title = apply_filters( 'widget_title', $instance['title'], null );
|
59 |
-
$content = static::get_content( $instance, $this->number );
|
60 |
-
|
61 |
-
// Before widget (defined by themes)
|
62 |
-
echo $before_widget;
|
63 |
-
|
64 |
-
if ( ! empty( $instance['title_link'] ) ) {
|
65 |
-
$target = ! empty( $instance['target'] ) ? $instance['target'] : null;
|
66 |
-
$title = Aihrus_Common::create_link( $instance['title_link'], $title, $target );
|
67 |
-
}
|
68 |
-
|
69 |
-
// Display the widget title if one was input (before and after defined by themes)
|
70 |
-
if ( ! empty( $title ) )
|
71 |
-
echo $before_title . $title . $after_title;
|
72 |
-
|
73 |
-
// Display Widget
|
74 |
-
echo $content;
|
75 |
-
|
76 |
-
// After widget (defined by themes)
|
77 |
-
echo $after_widget;
|
78 |
-
}
|
79 |
-
|
80 |
-
|
81 |
-
/**
|
82 |
-
*
|
83 |
-
*
|
84 |
-
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
85 |
-
*/
|
86 |
-
|
87 |
-
|
88 |
-
public function update( $new_instance, $old_instance ) {
|
89 |
-
$instance = static::validate_settings( $new_instance );
|
90 |
-
|
91 |
-
return $instance;
|
92 |
-
}
|
93 |
-
|
94 |
-
|
95 |
-
public function form( $instance ) {
|
96 |
-
$instance = static::form_instance( $instance );
|
97 |
-
$defaults = static::get_defaults();
|
98 |
-
$instance = wp_parse_args( $instance, $defaults );
|
99 |
-
|
100 |
-
$form_parts = static::form_parts( $instance, $this->number );
|
101 |
-
foreach ( $form_parts as $key => $part ) {
|
102 |
-
$part[ 'id' ] = $key;
|
103 |
-
$this->display_setting( $part, $instance );
|
104 |
-
}
|
105 |
-
}
|
106 |
-
|
107 |
-
|
108 |
-
public static function widget_options( $options ) {
|
109 |
-
foreach ( $options as $id => $parts ) {
|
110 |
-
// remove non-widget parts
|
111 |
-
if ( empty( $parts['widget'] ) )
|
112 |
-
unset( $options[ $id ] );
|
113 |
-
}
|
114 |
-
|
115 |
-
return $options;
|
116 |
-
}
|
117 |
-
|
118 |
-
|
119 |
-
/**
|
120 |
-
*
|
121 |
-
*
|
122 |
-
* @SuppressWarnings(PHPMD.UnusedLocalVariable)
|
123 |
-
*/
|
124 |
-
public function display_setting( $args = array(), $options ) {
|
125 |
-
extract( $args );
|
126 |
-
|
127 |
-
$do_return = false;
|
128 |
-
switch ( $type ) {
|
129 |
-
case 'heading':
|
130 |
-
if ( ! empty( $desc ) )
|
131 |
-
echo '<h3>' . $desc . '</h3>';
|
132 |
-
|
133 |
-
$do_return = true;
|
134 |
-
break;
|
135 |
-
|
136 |
-
case 'expand_all':
|
137 |
-
if ( ! empty( $desc ) )
|
138 |
-
echo '<h3>' . $desc . '</h3>';
|
139 |
-
|
140 |
-
echo '<a id="' . $this->get_field_id( $id ) . '" style="cursor:pointer;" onclick="jQuery( \'.tw-collapsible-control\' ) . slideToggle(); jQuery( \'.tw-collapsible\' ) . slideToggle();">' . esc_html__( 'Expand/Collapse All Options' ) . ' »</a>';
|
141 |
-
|
142 |
-
$do_return = true;
|
143 |
-
break;
|
144 |
-
|
145 |
-
case 'expand_begin':
|
146 |
-
if ( ! empty( $desc ) )
|
147 |
-
echo '<h3>' . $desc . '</h3>';
|
148 |
-
|
149 |
-
echo '<a id="' . $this->get_field_id( $id ) . '" style="cursor:pointer;" onclick="jQuery( \'div#' . $this->get_field_id( $id ) . '\' ) . slideToggle();" class="tw-collapsible-control">' . esc_html__( 'Expand/Collapse' ) . ' »</a>';
|
150 |
-
echo '<div id="' . $this->get_field_id( $id ) . '" style="display:none" class="tw-collapsible">';
|
151 |
-
|
152 |
-
$do_return = true;
|
153 |
-
break;
|
154 |
-
|
155 |
-
case 'expand_end':
|
156 |
-
echo '</div>';
|
157 |
-
|
158 |
-
$do_return = true;
|
159 |
-
break;
|
160 |
-
|
161 |
-
default:
|
162 |
-
break;
|
163 |
-
}
|
164 |
-
|
165 |
-
if ( $do_return )
|
166 |
-
return;
|
167 |
-
|
168 |
-
if ( ! isset( $options[$id] ) && $type != 'checkbox' )
|
169 |
-
$options[$id] = $std;
|
170 |
-
elseif ( ! isset( $options[$id] ) )
|
171 |
-
$options[$id] = 0;
|
172 |
-
|
173 |
-
$field_class = '';
|
174 |
-
if ( ! empty( $class ) )
|
175 |
-
$field_class = ' ' . $class;
|
176 |
-
|
177 |
-
echo '<p>';
|
178 |
-
|
179 |
-
switch ( $type ) {
|
180 |
-
case 'checkbox':
|
181 |
-
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 ) . ' /> ';
|
182 |
-
|
183 |
-
echo '<label for="' . $this->get_field_id( $id ) . '">' . $title . '</label>';
|
184 |
-
break;
|
185 |
-
|
186 |
-
case 'select':
|
187 |
-
echo '<label for="' . $this->get_field_id( $id ) . '">' . $title . '</label>';
|
188 |
-
echo '<select id="' . $this->get_field_id( $id ) . '"class="select' . $field_class . '" name="' . $this->get_field_name( $id ) . '">';
|
189 |
-
|
190 |
-
foreach ( $choices as $value => $label )
|
191 |
-
echo '<option value="' . esc_attr( $value ) . '"' . selected( $options[$id], $value, false ) . '>' . $label . '</option>';
|
192 |
-
|
193 |
-
echo '</select>';
|
194 |
-
break;
|
195 |
-
|
196 |
-
case 'radio':
|
197 |
-
$i = 0;
|
198 |
-
$count_options = count( $options ) - 1;
|
199 |
-
|
200 |
-
foreach ( $choices as $value => $label ) {
|
201 |
-
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>';
|
202 |
-
if ( $i < $count_options )
|
203 |
-
echo '<br />';
|
204 |
-
$i++;
|
205 |
-
}
|
206 |
-
|
207 |
-
echo '<label for="' . $this->get_field_id( $id ) . '">' . $title . '</label>';
|
208 |
-
break;
|
209 |
-
|
210 |
-
case 'textarea':
|
211 |
-
echo '<label for="' . $this->get_field_id( $id ) . '">' . $title . '</label>';
|
212 |
-
|
213 |
-
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>';
|
214 |
-
break;
|
215 |
-
|
216 |
-
case 'password':
|
217 |
-
echo '<label for="' . $this->get_field_id( $id ) . '">' . $title . '</label>';
|
218 |
-
|
219 |
-
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] ) . '" />';
|
220 |
-
break;
|
221 |
-
|
222 |
-
case 'readonly':
|
223 |
-
echo '<label for="' . $this->get_field_id( $id ) . '">' . $title . '</label>';
|
224 |
-
|
225 |
-
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" />';
|
226 |
-
break;
|
227 |
-
|
228 |
-
case 'text':
|
229 |
-
echo '<label for="' . $this->get_field_id( $id ) . '">' . $title . '</label>';
|
230 |
-
|
231 |
-
$suggest_id = 'suggest_' . self::$suggest_id++;
|
232 |
-
echo '<input class="widefat' . $field_class . ' ' . $suggest_id . '" type="text" id="' . $this->get_field_id( $id ) . '" name="' . $this->get_field_name( $id ) . '" placeholder="' . $std . '" value="' . esc_attr( $options[$id] ) . '" />';
|
233 |
-
|
234 |
-
if ( $suggest )
|
235 |
-
echo static::get_suggest( $id, $suggest_id );
|
236 |
-
break;
|
237 |
-
|
238 |
-
default:
|
239 |
-
break;
|
240 |
-
}
|
241 |
-
|
242 |
-
if ( ! empty( $desc ) )
|
243 |
-
echo '<br /><span class="setting-description"><small>' . $desc . '</small></span>';
|
244 |
-
|
245 |
-
echo '</p>';
|
246 |
-
}
|
247 |
-
|
248 |
-
|
249 |
-
}
|
250 |
-
|
251 |
-
|
252 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trunk/includes/libraries/aihrus-framework/includes/class-aihrus-common.php
DELETED
@@ -1,468 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
3 |
-
Copyright 2014 Michael Cannon (email: mc@aihr.us)
|
4 |
-
|
5 |
-
This program is free software; you can redistribute it and/or modify
|
6 |
-
it under the terms of the GNU General Public License, version 2, as
|
7 |
-
published by the Free Software Foundation.
|
8 |
-
|
9 |
-
This program is distributed in the hope that it will be useful,
|
10 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12 |
-
GNU General Public License for more details.
|
13 |
-
|
14 |
-
You should have received a copy of the GNU General Public License
|
15 |
-
along with this program; if not, write to the Free Software
|
16 |
-
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
17 |
-
*/
|
18 |
-
|
19 |
-
if ( class_exists( 'Aihrus_Common' ) )
|
20 |
-
return;
|
21 |
-
|
22 |
-
require_once 'interface-aihrus-common.php';
|
23 |
-
|
24 |
-
|
25 |
-
abstract class Aihrus_Common implements Aihrus_Common_Interface {
|
26 |
-
public static $donate_button;
|
27 |
-
public static $donate_link;
|
28 |
-
|
29 |
-
|
30 |
-
public function __construct() {
|
31 |
-
self::set_notice_key();
|
32 |
-
|
33 |
-
self::$donate_button = <<<EOD
|
34 |
-
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
|
35 |
-
<input type="hidden" name="cmd" value="_s-xclick">
|
36 |
-
<input type="hidden" name="hosted_button_id" value="WM4F995W9LHXE">
|
37 |
-
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
|
38 |
-
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
|
39 |
-
</form>
|
40 |
-
EOD;
|
41 |
-
|
42 |
-
self::$donate_link = '<a href="http://aihr.us/about-aihrus/donate/"><img src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif" border="0" alt="PayPal - The safer, easier way to pay online!" /></a>';
|
43 |
-
|
44 |
-
add_action( 'admin_init', array( static::$class, 'check_notices' ), 9999 );
|
45 |
-
}
|
46 |
-
|
47 |
-
|
48 |
-
public static function set_notice( $notice_name, $frequency_limit = false ) {
|
49 |
-
$notice_key = self::get_notice_key();
|
50 |
-
|
51 |
-
$frequency_limit = intval( $frequency_limit );
|
52 |
-
if ( ! empty( $frequency_limit ) ) {
|
53 |
-
$fl_key = $notice_key . '_' . $notice_name;
|
54 |
-
$proceed = get_transient( $fl_key );
|
55 |
-
if ( false === $proceed ) {
|
56 |
-
delete_transient( $fl_key );
|
57 |
-
set_transient( $fl_key, time(), $frequency_limit );
|
58 |
-
} else {
|
59 |
-
return;
|
60 |
-
}
|
61 |
-
}
|
62 |
-
|
63 |
-
$notices = get_transient( $notice_key );
|
64 |
-
if ( false === $notices )
|
65 |
-
$notices = array();
|
66 |
-
|
67 |
-
$notices[] = $notice_name;
|
68 |
-
|
69 |
-
self::delete_notices();
|
70 |
-
set_transient( $notice_key, $notices, HOUR_IN_SECONDS );
|
71 |
-
}
|
72 |
-
|
73 |
-
|
74 |
-
public static function delete_notices() {
|
75 |
-
$notice_key = self::get_notice_key();
|
76 |
-
|
77 |
-
delete_transient( $notice_key );
|
78 |
-
}
|
79 |
-
|
80 |
-
|
81 |
-
public static function check_notices() {
|
82 |
-
$notice_key = self::get_notice_key();
|
83 |
-
|
84 |
-
$notices = get_transient( $notice_key );
|
85 |
-
if ( false === $notices )
|
86 |
-
return;
|
87 |
-
|
88 |
-
$notices = array_unique( $notices );
|
89 |
-
foreach ( $notices as $notice ) {
|
90 |
-
if ( function_exists( $notice ) ) {
|
91 |
-
add_action( 'admin_notices', $notice );
|
92 |
-
} elseif ( is_array( $notice ) ) {
|
93 |
-
add_action( 'admin_notices', $notice );
|
94 |
-
} else {
|
95 |
-
add_action( 'admin_notices', array( static::$class, $notice ) );
|
96 |
-
}
|
97 |
-
}
|
98 |
-
|
99 |
-
self::delete_notices();
|
100 |
-
}
|
101 |
-
|
102 |
-
|
103 |
-
public static function get_notice_key() {
|
104 |
-
if ( is_null( static::$notice_key ) )
|
105 |
-
self::set_notice_key();
|
106 |
-
|
107 |
-
return static::$notice_key;
|
108 |
-
}
|
109 |
-
|
110 |
-
|
111 |
-
public static function set_notice_key() {
|
112 |
-
static::$notice_key = static::SLUG . 'notices';
|
113 |
-
}
|
114 |
-
|
115 |
-
|
116 |
-
public static function version( $version ) {
|
117 |
-
$version .= '-' . static::ID . '-' . static::VERSION;
|
118 |
-
|
119 |
-
return $version;
|
120 |
-
}
|
121 |
-
|
122 |
-
|
123 |
-
/**
|
124 |
-
* flatten an arbitrarily deep multidimensional array
|
125 |
-
* into a list of its scalar values
|
126 |
-
* (may be inefficient for large structures)
|
127 |
-
* (will infinite recurse on self-referential structures)
|
128 |
-
* (could be extended to handle objects)
|
129 |
-
*
|
130 |
-
* @ref http://in1.php.net/manual/en/function.array-values.php#41967
|
131 |
-
*/
|
132 |
-
|
133 |
-
|
134 |
-
public static function array_values_recursive( $ary ) {
|
135 |
-
$lst = array();
|
136 |
-
foreach ( array_keys( $ary ) as $k ) {
|
137 |
-
$v = $ary[$k];
|
138 |
-
if ( is_scalar( $v ) ) {
|
139 |
-
$lst[] = $v;
|
140 |
-
} elseif ( is_array( $v ) ) {
|
141 |
-
$lst = array_merge(
|
142 |
-
$lst,
|
143 |
-
self::array_values_recursive( $v )
|
144 |
-
);
|
145 |
-
}
|
146 |
-
}
|
147 |
-
|
148 |
-
return $lst;
|
149 |
-
}
|
150 |
-
|
151 |
-
|
152 |
-
public static function notice_donate( $disable_donate = null, $item_name = null ) {
|
153 |
-
if ( $disable_donate )
|
154 |
-
return;
|
155 |
-
|
156 |
-
$text = sprintf( esc_html__( 'Please donate $5 towards ongoing free support and development of the "%1$s" plugin. %2$s' ), $item_name, self::$donate_button );
|
157 |
-
|
158 |
-
aihr_notice_updated( $text );
|
159 |
-
}
|
160 |
-
|
161 |
-
|
162 |
-
public static function get_scripts() {
|
163 |
-
if ( static::$scripts_called )
|
164 |
-
return;
|
165 |
-
|
166 |
-
foreach ( static::$scripts as $script )
|
167 |
-
echo $script;
|
168 |
-
|
169 |
-
static::$scripts_called = true;
|
170 |
-
}
|
171 |
-
|
172 |
-
|
173 |
-
public static function get_styles() {
|
174 |
-
if ( empty( self::$styles ) )
|
175 |
-
return;
|
176 |
-
|
177 |
-
if ( empty( self::$styles_called ) ) {
|
178 |
-
echo '<style>';
|
179 |
-
|
180 |
-
foreach ( self::$styles as $style )
|
181 |
-
echo $style;
|
182 |
-
|
183 |
-
echo '</style>';
|
184 |
-
|
185 |
-
self::$styles_called = true;
|
186 |
-
}
|
187 |
-
}
|
188 |
-
|
189 |
-
|
190 |
-
public static function create_nonce( $action ) {
|
191 |
-
$nonce = uniqid();
|
192 |
-
$uid = get_current_user_id();
|
193 |
-
$check = $uid . $action;
|
194 |
-
set_transient( $nonce, $check, HOUR_IN_SECONDS );
|
195 |
-
|
196 |
-
return $nonce;
|
197 |
-
}
|
198 |
-
|
199 |
-
|
200 |
-
public static function verify_nonce( $nonce, $action ) {
|
201 |
-
$active = get_transient( $nonce );
|
202 |
-
$uid = get_current_user_id();
|
203 |
-
$check = $uid . $action;
|
204 |
-
$valid = false;
|
205 |
-
|
206 |
-
if ( $active == $check ) {
|
207 |
-
delete_transient( $nonce );
|
208 |
-
$valid = true;
|
209 |
-
}
|
210 |
-
|
211 |
-
return $valid;
|
212 |
-
}
|
213 |
-
|
214 |
-
|
215 |
-
/**
|
216 |
-
* If incoming link is empty, then get_site_url() is used instead.
|
217 |
-
*/
|
218 |
-
public static function create_link( $link, $title = null, $target = null, $return_as_tag = true ) {
|
219 |
-
if ( empty( $link ) )
|
220 |
-
$link = get_site_url();
|
221 |
-
|
222 |
-
if ( preg_match( '#^\d+$#', $link ) ) {
|
223 |
-
$permalink = get_permalink( $link );
|
224 |
-
$tag_title = get_the_title( $link );
|
225 |
-
if ( empty( $title ) )
|
226 |
-
$title = $tag_title;
|
227 |
-
|
228 |
-
$tag = '<a href="';
|
229 |
-
$tag .= $permalink;
|
230 |
-
$tag .= '" title="';
|
231 |
-
$tag .= $tag_title;
|
232 |
-
$tag .= '">';
|
233 |
-
$tag .= $title;
|
234 |
-
$tag .= '</a>';
|
235 |
-
} else {
|
236 |
-
$orig_link = empty( $title ) ? $link : $title;
|
237 |
-
$do_http = true;
|
238 |
-
|
239 |
-
if ( 0 === strpos( $link, '/' ) )
|
240 |
-
$do_http = false;
|
241 |
-
|
242 |
-
if ( $do_http && 0 === preg_match( '#https?://#', $link ) )
|
243 |
-
$link = 'http://' . $link;
|
244 |
-
|
245 |
-
$permalink = $link;
|
246 |
-
|
247 |
-
$tag = '<a href="';
|
248 |
-
$tag .= $permalink;
|
249 |
-
$tag .= '">';
|
250 |
-
$tag .= $orig_link;
|
251 |
-
$tag .= '</a>';
|
252 |
-
}
|
253 |
-
|
254 |
-
if ( ! empty( $target ) && is_string( $target ) )
|
255 |
-
$tag = links_add_target( $tag, $target );
|
256 |
-
|
257 |
-
if ( $return_as_tag )
|
258 |
-
return $tag;
|
259 |
-
else
|
260 |
-
return array(
|
261 |
-
'link' => $permalink,
|
262 |
-
'tag' => $tag,
|
263 |
-
);
|
264 |
-
}
|
265 |
-
|
266 |
-
|
267 |
-
public static function add_media( $post_id, $media_src, $media_name = null, $featured_image = true ) {
|
268 |
-
require_once ABSPATH . 'wp-admin/includes/image.php';
|
269 |
-
|
270 |
-
if ( empty( $media_name ) )
|
271 |
-
$media_name = basename( $media_src );
|
272 |
-
|
273 |
-
$wp_filetype = wp_check_filetype( $media_name, null );
|
274 |
-
$attachment = array(
|
275 |
-
'post_mime_type' => $wp_filetype['type'],
|
276 |
-
'post_status' => 'inherit',
|
277 |
-
'post_title' => $media_name,
|
278 |
-
);
|
279 |
-
|
280 |
-
$file_move = wp_upload_bits( $media_name, null, self::file_get_contents_curl( $media_src ) );
|
281 |
-
$file_name = $file_move['file'];
|
282 |
-
|
283 |
-
$image_id = wp_insert_attachment( $attachment, $file_name, $post_id );
|
284 |
-
$metadata = wp_generate_attachment_metadata( $image_id, $file_name );
|
285 |
-
wp_update_attachment_metadata( $image_id, $metadata );
|
286 |
-
|
287 |
-
if ( $featured_image )
|
288 |
-
update_post_meta( $post_id, '_thumbnail_id', $image_id );
|
289 |
-
|
290 |
-
return $image_id;
|
291 |
-
}
|
292 |
-
|
293 |
-
|
294 |
-
/**
|
295 |
-
* Thank you Tobylewis
|
296 |
-
*
|
297 |
-
* file_get_contents support on some shared systems is turned off
|
298 |
-
*
|
299 |
-
* @ref http://wordpress.org/support/topic/plugin-flickr-shortcode-importer-file_get_contents-with-url-isp-does-not-support?replies=2#post-2878241
|
300 |
-
*/
|
301 |
-
public static function file_get_contents_curl( $url ) {
|
302 |
-
$ch = curl_init();
|
303 |
-
|
304 |
-
curl_setopt( $ch, CURLOPT_AUTOREFERER, true );
|
305 |
-
curl_setopt( $ch, CURLOPT_HEADER, 0 );
|
306 |
-
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
|
307 |
-
curl_setopt( $ch, CURLOPT_URL, $url );
|
308 |
-
curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, true );
|
309 |
-
|
310 |
-
$data = curl_exec( $ch );
|
311 |
-
curl_close( $ch );
|
312 |
-
|
313 |
-
return $data;
|
314 |
-
}
|
315 |
-
|
316 |
-
|
317 |
-
public static function get_image_src( $image, $strip_protocol = true ) {
|
318 |
-
$doc = new DOMDocument();
|
319 |
-
$doc->loadHTML( $image );
|
320 |
-
$xpath = new DOMXPath( $doc );
|
321 |
-
$src = $xpath->evaluate( 'string(//img/@src)' );
|
322 |
-
|
323 |
-
if ( $strip_protocol )
|
324 |
-
$src = self::strip_protocol( $src );
|
325 |
-
|
326 |
-
return $src;
|
327 |
-
}
|
328 |
-
|
329 |
-
|
330 |
-
public static function clean_string( $string ) {
|
331 |
-
if ( ! is_string( $string ) )
|
332 |
-
return $string;
|
333 |
-
|
334 |
-
return trim( strip_shortcodes( strip_tags( $string ) ) );
|
335 |
-
}
|
336 |
-
|
337 |
-
|
338 |
-
/**
|
339 |
-
* Truncate HTML, close opened tags. UTF-8 aware, and aware of unpaired tags
|
340 |
-
* (which don't need a matching closing tag)
|
341 |
-
*
|
342 |
-
* @param string $html
|
343 |
-
* @param int $max_length Maximum length of the characters of the string
|
344 |
-
* @param string $indicator Suffix to use if string was truncated.
|
345 |
-
* @param boolean $force_indicator Suffix to use if string was truncated.
|
346 |
-
* @return string
|
347 |
-
*
|
348 |
-
* @ref http://pastie.org/3084080
|
349 |
-
*/
|
350 |
-
public static function truncate( $html, $max_length, $indicator = '…', $force_indicator = false ) {
|
351 |
-
$output_length = 0; // number of counted characters stored so far in $output
|
352 |
-
$position = 0; // character offset within input string after last tag/entity
|
353 |
-
$tag_stack = array(); // stack of tags we've encountered but not closed
|
354 |
-
$output = '';
|
355 |
-
$truncated = false;
|
356 |
-
|
357 |
-
/**
|
358 |
-
* these tags don't have matching closing elements, in HTML (in XHTML they
|
359 |
-
* theoretically need a closing /> )
|
360 |
-
*
|
361 |
-
* @see http://www.netstrider.com/tutorials/HTMLRef/a_d.html
|
362 |
-
* @see http://www.w3schools.com/tags/default.asp
|
363 |
-
* @see http://stackoverflow.com/questions/3741896/what-do-you-call-tags-that-need-no-ending-tag
|
364 |
-
*/
|
365 |
-
$unpaired_tags = array(
|
366 |
-
'doctype',
|
367 |
-
'!doctype',
|
368 |
-
'area',
|
369 |
-
'base',
|
370 |
-
'basefont',
|
371 |
-
'bgsound',
|
372 |
-
'br',
|
373 |
-
'col',
|
374 |
-
'embed',
|
375 |
-
'frame',
|
376 |
-
'hr',
|
377 |
-
'img',
|
378 |
-
'input',
|
379 |
-
'link',
|
380 |
-
'meta',
|
381 |
-
'param',
|
382 |
-
'sound',
|
383 |
-
'spacer',
|
384 |
-
'wbr',
|
385 |
-
);
|
386 |
-
|
387 |
-
$func_strcut = function_exists( 'mb_strcut' ) ? 'mb_strcut' : 'substr';
|
388 |
-
$func_strlen = function_exists( 'mb_strlen' ) ? 'mb_strlen' : 'strlen';
|
389 |
-
|
390 |
-
// loop through, splitting at HTML entities or tags
|
391 |
-
while ( $output_length < $max_length && preg_match( '{</?([a-z]+)[^>]*>|&#?[a-zA-Z0-9]+;}', $html, $match, PREG_OFFSET_CAPTURE, $position ) ) {
|
392 |
-
list( $tag, $tag_position ) = $match[0];
|
393 |
-
|
394 |
-
// get text leading up to the tag, and store it – up to max_length
|
395 |
-
$text = $func_strcut( $html, $position, $tag_position - $position );
|
396 |
-
if ( $output_length + $func_strlen( $text ) > $max_length ) {
|
397 |
-
$output .= $func_strcut( $text, 0, $max_length - $output_length );
|
398 |
-
$truncated = true;
|
399 |
-
$output_length = $max_length;
|
400 |
-
break;
|
401 |
-
}
|
402 |
-
|
403 |
-
// store everything, it wasn't too long
|
404 |
-
$output .= $text;
|
405 |
-
$output_length += $func_strlen( $text );
|
406 |
-
|
407 |
-
if ( $tag[0] == '&' ) {
|
408 |
-
// Handle HTML entity by copying straight through
|
409 |
-
$output .= $tag;
|
410 |
-
$output_length++; // only counted as one character
|
411 |
-
} else {
|
412 |
-
// Handle HTML tag
|
413 |
-
$tag_inner = $match[1][0];
|
414 |
-
if ( $tag[1] == '/' ) {
|
415 |
-
// This is a closing tag.
|
416 |
-
$output .= $tag;
|
417 |
-
// If input tags aren't balanced, we leave the popped tag
|
418 |
-
// on the stack so hopefully we're not introducing more
|
419 |
-
// problems.
|
420 |
-
|
421 |
-
if ( end( $tag_stack ) == $tag_inner )
|
422 |
-
array_pop( $tag_stack );
|
423 |
-
} elseif ( $tag[$func_strlen( $tag ) - 2] == '/' || in_array( strtolower( $tag_inner ), $unpaired_tags ) ) {
|
424 |
-
// Self-closing or unpaired tag
|
425 |
-
$output .= $tag;
|
426 |
-
} else {
|
427 |
-
// Opening tag.
|
428 |
-
$output .= $tag;
|
429 |
-
$tag_stack[] = $tag_inner; // push tag onto the stack
|
430 |
-
}
|
431 |
-
}
|
432 |
-
|
433 |
-
// Continue after the tag we just found
|
434 |
-
$position = $tag_position + $func_strlen( $tag );
|
435 |
-
}
|
436 |
-
|
437 |
-
// Print any remaining text after the last tag, if there's room
|
438 |
-
|
439 |
-
if ( $output_length < $max_length && $position < $func_strlen( $html ) )
|
440 |
-
$output .= $func_strcut( $html, $position, $max_length - $output_length );
|
441 |
-
|
442 |
-
$truncated = $func_strlen( $html ) - $position > $max_length - $output_length;
|
443 |
-
|
444 |
-
// add terminator if it was truncated in loop or just above here
|
445 |
-
if ( $truncated || $force_indicator )
|
446 |
-
$output .= $indicator;
|
447 |
-
|
448 |
-
// Close any open tags
|
449 |
-
while ( ! empty( $tag_stack ) )
|
450 |
-
$output .= '</'.array_pop( $tag_stack ).'>';
|
451 |
-
|
452 |
-
return $output;
|
453 |
-
}
|
454 |
-
|
455 |
-
|
456 |
-
public static function strip_protocol( $link ) {
|
457 |
-
if ( ! empty( $link ) ) {
|
458 |
-
$link = preg_replace( '#https?:#', '', $link );
|
459 |
-
}
|
460 |
-
|
461 |
-
return $link;
|
462 |
-
}
|
463 |
-
|
464 |
-
|
465 |
-
}
|
466 |
-
|
467 |
-
|
468 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trunk/includes/libraries/aihrus-framework/includes/class-aihrus-licensing.php
DELETED
@@ -1,188 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
3 |
-
Copyright 2014 Michael Cannon (email: mc@aihr.us)
|
4 |
-
|
5 |
-
This program is free software; you can redistribute it and/or modify
|
6 |
-
it under the terms of the GNU General Public License, version 2, as
|
7 |
-
published by the Free Software Foundation.
|
8 |
-
|
9 |
-
This program is distributed in the hope that it will be useful,
|
10 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12 |
-
GNU General Public License for more details.
|
13 |
-
|
14 |
-
You should have received a copy of the GNU General Public License
|
15 |
-
along with this program; if not, write to the Free Software
|
16 |
-
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
17 |
-
*/
|
18 |
-
|
19 |
-
if ( class_exists( 'Aihrus_Licensing' ) )
|
20 |
-
return;
|
21 |
-
|
22 |
-
require_once 'interface-aihrus-licensing.php';
|
23 |
-
|
24 |
-
|
25 |
-
abstract class Aihrus_Licensing implements Aihrus_Licensing_Interface {
|
26 |
-
public $author;
|
27 |
-
public $item_name;
|
28 |
-
public $slug;
|
29 |
-
public $store_url;
|
30 |
-
|
31 |
-
|
32 |
-
public function __construct( $slug, $item_name, $author = 'Michael Cannon', $store_url = 'http://aihr.us' ) {
|
33 |
-
$this->author = $author;
|
34 |
-
$this->item_name = urlencode( $item_name );
|
35 |
-
$this->slug = $slug;
|
36 |
-
$this->store_url = $store_url;
|
37 |
-
}
|
38 |
-
|
39 |
-
|
40 |
-
public function license_key() {
|
41 |
-
$key = $this->slug . 'license_key';
|
42 |
-
|
43 |
-
return $key;
|
44 |
-
}
|
45 |
-
|
46 |
-
|
47 |
-
public function get_license() {
|
48 |
-
$key = $this->license_key();
|
49 |
-
$license = get_transient( $key );
|
50 |
-
|
51 |
-
return $license;
|
52 |
-
}
|
53 |
-
|
54 |
-
|
55 |
-
public function update_license( $value = null ) {
|
56 |
-
$license = $this->get_license();
|
57 |
-
if ( $license === $value )
|
58 |
-
return $value;
|
59 |
-
|
60 |
-
if ( $this->valid_hash( $value ) ) {
|
61 |
-
$this->set_license( $value );
|
62 |
-
$value = $this->activate_license();
|
63 |
-
$this->set_license( $value );
|
64 |
-
|
65 |
-
return $value;
|
66 |
-
} else {
|
67 |
-
$this->deactivate_license();
|
68 |
-
$this->delete_license();
|
69 |
-
|
70 |
-
return '';
|
71 |
-
}
|
72 |
-
}
|
73 |
-
|
74 |
-
|
75 |
-
public function set_license( $value = null ) {
|
76 |
-
$key = $this->license_key();
|
77 |
-
|
78 |
-
delete_transient( $key );
|
79 |
-
|
80 |
-
if ( ! is_null( $value ) )
|
81 |
-
set_transient( $key, $value, 2 * YEAR_IN_SECONDS );
|
82 |
-
}
|
83 |
-
|
84 |
-
|
85 |
-
public function valid_license() {
|
86 |
-
$license = $this->get_license();
|
87 |
-
if ( $this->valid_hash( $license ) )
|
88 |
-
return true;
|
89 |
-
else
|
90 |
-
return false;
|
91 |
-
}
|
92 |
-
|
93 |
-
|
94 |
-
public function get_api_call( $action ) {
|
95 |
-
$license = $this->get_license();
|
96 |
-
$api_params = array(
|
97 |
-
'edd_action' => $action,
|
98 |
-
'item_name' => $this->item_name,
|
99 |
-
'license' => $license,
|
100 |
-
);
|
101 |
-
|
102 |
-
$api_call = add_query_arg(
|
103 |
-
$api_params,
|
104 |
-
$this->store_url
|
105 |
-
);
|
106 |
-
|
107 |
-
return $api_call;
|
108 |
-
}
|
109 |
-
|
110 |
-
|
111 |
-
public function get_remote_get( $api_call ) {
|
112 |
-
$response = wp_remote_get(
|
113 |
-
$api_call,
|
114 |
-
array(
|
115 |
-
'timeout' => 10,
|
116 |
-
'sslverify' => false,
|
117 |
-
)
|
118 |
-
);
|
119 |
-
|
120 |
-
return $response;
|
121 |
-
}
|
122 |
-
|
123 |
-
|
124 |
-
public function activate_license() {
|
125 |
-
$license_data = $this->get_license_data( 'activate_license' );
|
126 |
-
if ( false !== $license_data ) {
|
127 |
-
if ( 'valid' == $license_data->license ) {
|
128 |
-
$license = $this->get_license();
|
129 |
-
|
130 |
-
return $license;
|
131 |
-
}
|
132 |
-
|
133 |
-
return $license_data->license;
|
134 |
-
}
|
135 |
-
|
136 |
-
return false;
|
137 |
-
}
|
138 |
-
|
139 |
-
|
140 |
-
public function get_license_data( $action = 'check_license' ) {
|
141 |
-
$api_call = $this->get_api_call( $action );
|
142 |
-
$response = $this->get_remote_get( $api_call );
|
143 |
-
if ( is_wp_error( $response ) )
|
144 |
-
return false;
|
145 |
-
|
146 |
-
$license_data = json_decode( wp_remote_retrieve_body( $response ) );
|
147 |
-
|
148 |
-
return $license_data;
|
149 |
-
}
|
150 |
-
|
151 |
-
|
152 |
-
public function deactivate_license() {
|
153 |
-
$license_data = $this->get_license_data( 'deactivate_license' );
|
154 |
-
if ( false !== $license_data ) {
|
155 |
-
if ( 'deactivated' == $license_data->license )
|
156 |
-
return true;
|
157 |
-
|
158 |
-
return $license_data->license;
|
159 |
-
}
|
160 |
-
|
161 |
-
return false;
|
162 |
-
}
|
163 |
-
|
164 |
-
|
165 |
-
public function delete_license() {
|
166 |
-
$this->set_license();
|
167 |
-
}
|
168 |
-
|
169 |
-
|
170 |
-
public function license_notice() {
|
171 |
-
$result = '<p><em>' . esc_html( 'Premium features require licensing to function.' ) . '</em></p>';
|
172 |
-
|
173 |
-
return $result;
|
174 |
-
}
|
175 |
-
|
176 |
-
|
177 |
-
public function valid_hash( $value = null ) {
|
178 |
-
if ( is_string( $value ) && preg_match( '#^[0-9a-f]{32}$#i', $value ) )
|
179 |
-
return true;
|
180 |
-
|
181 |
-
return false;
|
182 |
-
}
|
183 |
-
|
184 |
-
|
185 |
-
}
|
186 |
-
|
187 |
-
|
188 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trunk/includes/libraries/aihrus-framework/includes/class-aihrus-settings.php
DELETED
@@ -1,784 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
3 |
-
Copyright 2014 Michael Cannon (email: mc@aihr.us)
|
4 |
-
|
5 |
-
This program is free software; you can redistribute it and/or modify
|
6 |
-
it under the terms of the GNU General Public License, version 2, as
|
7 |
-
published by the Free Software Foundation.
|
8 |
-
|
9 |
-
This program is distributed in the hope that it will be useful,
|
10 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12 |
-
GNU General Public License for more details.
|
13 |
-
|
14 |
-
You should have received a copy of the GNU General Public License
|
15 |
-
along with this program; if not, write to the Free Software
|
16 |
-
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
17 |
-
*/
|
18 |
-
|
19 |
-
/**
|
20 |
-
* Aihrus Framework settings helper class
|
21 |
-
*
|
22 |
-
* Based upon http://alisothegeek.com/2011/01/wordpress-settings-api-tutorial-1/
|
23 |
-
*/
|
24 |
-
|
25 |
-
require_once ABSPATH . 'wp-admin/includes/template.php';
|
26 |
-
|
27 |
-
if ( class_exists( 'Aihrus_Settings' ) )
|
28 |
-
return;
|
29 |
-
|
30 |
-
|
31 |
-
abstract class Aihrus_Settings {
|
32 |
-
public static $default = array(
|
33 |
-
'backwards' => array(
|
34 |
-
'version' => null, // below this version number, use std
|
35 |
-
'std' => null,
|
36 |
-
),
|
37 |
-
'choices' => array(), // key => value
|
38 |
-
'class' => null, // warning, etc.
|
39 |
-
'desc' => null,
|
40 |
-
'id' => null,
|
41 |
-
'section' => 'general',
|
42 |
-
'show_code' => false,
|
43 |
-
'std' => null, // default key or value
|
44 |
-
'suggest' => false, // attempt for auto-suggest on inputs
|
45 |
-
'title' => null,
|
46 |
-
'type' => 'text', // textarea, checkbox, radio, select, hidden, heading, password, expand_begin, expand_end
|
47 |
-
'validate' => null, // required, term, slug, slugs, ids, order, single paramater PHP functions
|
48 |
-
'widget' => 1, // show in widget options, 0 off
|
49 |
-
);
|
50 |
-
|
51 |
-
|
52 |
-
public function __construct() {}
|
53 |
-
|
54 |
-
|
55 |
-
public static function load_options() {
|
56 |
-
static::sections();
|
57 |
-
static::settings();
|
58 |
-
}
|
59 |
-
|
60 |
-
|
61 |
-
public static function sections() {
|
62 |
-
static::$sections['reset'] = esc_html__( 'Reset' );
|
63 |
-
static::$sections['about'] = esc_html__( 'About' );
|
64 |
-
}
|
65 |
-
|
66 |
-
|
67 |
-
/**
|
68 |
-
*
|
69 |
-
*
|
70 |
-
* @SuppressWarnings(PHPMD.Superglobals)
|
71 |
-
*/
|
72 |
-
public static function settings() {
|
73 |
-
// Reset section defaults
|
74 |
-
$options = get_option( static::ID );
|
75 |
-
if ( ! empty( $options ) ) {
|
76 |
-
$serialized_options = serialize( $options );
|
77 |
-
$_SESSION['export'] = $serialized_options;
|
78 |
-
|
79 |
-
static::$settings['export'] = array(
|
80 |
-
'section' => 'reset',
|
81 |
-
'title' => esc_html__( 'Export Settings' ),
|
82 |
-
'type' => 'readonly',
|
83 |
-
'desc' => esc_html__( 'These are your current settings in a serialized format. Copy the contents to make a backup of your settings.' ),
|
84 |
-
'std' => $serialized_options,
|
85 |
-
'widget' => 0,
|
86 |
-
);
|
87 |
-
}
|
88 |
-
|
89 |
-
static::$settings['import'] = array(
|
90 |
-
'section' => 'reset',
|
91 |
-
'title' => esc_html__( 'Import Settings' ),
|
92 |
-
'type' => 'textarea',
|
93 |
-
'desc' => esc_html__( 'Paste new serialized settings here to overwrite your current configuration.' ),
|
94 |
-
'widget' => 0,
|
95 |
-
);
|
96 |
-
|
97 |
-
$desc = esc_html__( 'Delete all %s data and options from database on plugin deletion. Even if this option isn\'t checked, WordPress will still give a data deletion warning.' );
|
98 |
-
|
99 |
-
static::$settings['delete_data'] = array(
|
100 |
-
'section' => 'reset',
|
101 |
-
'title' => esc_html__( 'Remove Plugin Data on Deletion?' ),
|
102 |
-
'type' => 'checkbox',
|
103 |
-
'class' => 'warning',
|
104 |
-
'desc' => sprintf( $desc, static::NAME ),
|
105 |
-
'widget' => 0,
|
106 |
-
);
|
107 |
-
|
108 |
-
static::$settings['reset_defaults'] = array(
|
109 |
-
'section' => 'reset',
|
110 |
-
'title' => esc_html__( 'Reset to Defaults?' ),
|
111 |
-
'type' => 'checkbox',
|
112 |
-
'class' => 'warning',
|
113 |
-
'desc' => esc_html__( 'Check this box to reset options to their defaults' ),
|
114 |
-
);
|
115 |
-
}
|
116 |
-
|
117 |
-
|
118 |
-
public static function get_defaults( $mode = null, $old_version = null ) {
|
119 |
-
if ( empty( static::$defaults ) )
|
120 |
-
static::settings();
|
121 |
-
|
122 |
-
$do_backwards = false;
|
123 |
-
if ( 'backwards' == $mode ) {
|
124 |
-
if ( ! empty( $old_version ) )
|
125 |
-
$do_backwards = true;
|
126 |
-
}
|
127 |
-
|
128 |
-
foreach ( static::$settings as $id => $parts ) {
|
129 |
-
$std = isset( $parts['std'] ) ? $parts['std'] : '';
|
130 |
-
if ( $do_backwards ) {
|
131 |
-
$version = ! empty( $parts['backwards']['version'] ) ? $parts['backwards']['version'] : false;
|
132 |
-
if ( ! empty( $version ) ) {
|
133 |
-
if ( $old_version < $version )
|
134 |
-
$std = $parts['backwards']['std'];
|
135 |
-
}
|
136 |
-
}
|
137 |
-
|
138 |
-
static::$defaults[ $id ] = $std;
|
139 |
-
}
|
140 |
-
|
141 |
-
return static::$defaults;
|
142 |
-
}
|
143 |
-
|
144 |
-
|
145 |
-
public static function get_settings() {
|
146 |
-
if ( empty( static::$settings ) )
|
147 |
-
static::settings();
|
148 |
-
|
149 |
-
return static::$settings;
|
150 |
-
}
|
151 |
-
|
152 |
-
|
153 |
-
public static function initialize_settings( $version = null ) {
|
154 |
-
$defaults = static::get_defaults( 'backwards' );
|
155 |
-
$current = get_option( static::ID );
|
156 |
-
$current = wp_parse_args( $current, $defaults );
|
157 |
-
|
158 |
-
$current['admin_notices'] = $version;
|
159 |
-
$current['version'] = static::$version;
|
160 |
-
|
161 |
-
update_option( static::ID, $current );
|
162 |
-
}
|
163 |
-
|
164 |
-
|
165 |
-
/**
|
166 |
-
*
|
167 |
-
*
|
168 |
-
* @SuppressWarnings(PHPMD.UnusedLocalVariable)
|
169 |
-
*/
|
170 |
-
public static function create_setting( $args = array() ) {
|
171 |
-
extract( $args );
|
172 |
-
|
173 |
-
if ( preg_match( '#(_expand_begin|_expand_end)#', $id ) )
|
174 |
-
return;
|
175 |
-
|
176 |
-
$field_args = array(
|
177 |
-
'choices' => $choices,
|
178 |
-
'class' => $class,
|
179 |
-
'desc' => $desc,
|
180 |
-
'id' => $id,
|
181 |
-
'label_for' => $id,
|
182 |
-
'show_code' => $show_code,
|
183 |
-
'std' => $std,
|
184 |
-
'suggest' => $suggest,
|
185 |
-
'type' => $type,
|
186 |
-
);
|
187 |
-
|
188 |
-
static::$defaults[$id] = $std;
|
189 |
-
|
190 |
-
add_settings_field( $id, $title, array( static::$class, 'display_setting' ), static::ID, $section, $field_args );
|
191 |
-
}
|
192 |
-
|
193 |
-
|
194 |
-
public static function section_scripts() {
|
195 |
-
echo '
|
196 |
-
<script type="text/javascript">
|
197 |
-
jQuery(document).ready(function($) {
|
198 |
-
$( "#' . static::ID . '" ).tabs();
|
199 |
-
// This will make the "warning" checkbox class really stand out when checked.
|
200 |
-
$(".warning").change(function() {
|
201 |
-
if ($(this).is(":checked"))
|
202 |
-
$(this).parent().css("background", "#c00").css("color", "#fff").css("fontWeight", "bold");
|
203 |
-
else
|
204 |
-
$(this).parent().css("background", "inherit").css("color", "inherit").css("fontWeight", "inherit");
|
205 |
-
});
|
206 |
-
});
|
207 |
-
</script>
|
208 |
-
';
|
209 |
-
}
|
210 |
-
|
211 |
-
|
212 |
-
public static function do_settings_sections( $page ) {
|
213 |
-
global $wp_settings_sections, $wp_settings_fields;
|
214 |
-
|
215 |
-
if ( ! isset( $wp_settings_sections ) || ! isset( $wp_settings_sections[$page] ) )
|
216 |
-
return;
|
217 |
-
|
218 |
-
foreach ( (array) $wp_settings_sections[$page] as $section ) {
|
219 |
-
if ( $section['callback'] )
|
220 |
-
call_user_func( $section['callback'], $section );
|
221 |
-
|
222 |
-
if ( ! isset( $wp_settings_fields ) || ! isset( $wp_settings_fields[$page] ) || ! isset( $wp_settings_fields[$page][$section['id']] ) )
|
223 |
-
continue;
|
224 |
-
|
225 |
-
echo '<table id=' . $section['id'] . ' class="form-table">';
|
226 |
-
do_settings_fields( $page, $section['id'] );
|
227 |
-
echo '</table>';
|
228 |
-
}
|
229 |
-
}
|
230 |
-
|
231 |
-
|
232 |
-
public static function display_section() {}
|
233 |
-
|
234 |
-
|
235 |
-
public static function display_about() {
|
236 |
-
$name = str_replace( ' Settings', '', static::NAME );
|
237 |
-
$text = __( '<img class="alignright size-medium" src="%1$simages/michael-cannon-red-square-300x2251.jpg" alt="Michael in Red Square, Moscow, Russia" width="300" height="225" /><a href="%2$s">%3$s</a> is by <a href="%4$s">Michael Cannon</a>. He\'s <a href="%5$s">Peichi’s</a> smiling man, an adventurous <a href="%6$s" target="_blank">water-rat</a>, <a href="%7$s">chief people officer</a>, <a href="%8$s">cyclist</a>, <a href="%9$s">full stack developer</a>, <a href="%10$s">poet</a>, <a href="%11$s">WWOOF’er</a> and <a href="%12$s">world traveler</a>.' );
|
238 |
-
|
239 |
-
echo '<div id="about" style="width: 70%; min-height: 225px;"><p>';
|
240 |
-
echo sprintf(
|
241 |
-
$text,
|
242 |
-
static::$plugin_assets,
|
243 |
-
esc_url( static::$plugin_url ),
|
244 |
-
$name,
|
245 |
-
esc_url( 'http://aihr.us/resume/' ),
|
246 |
-
esc_url( 'http://peimic.com/t/peichi-liu/' ),
|
247 |
-
esc_url( 'http://www.chinesehoroscope.org/chinese_zodiac/rat/' ),
|
248 |
-
esc_url( 'http://axelerant.com/who-we-are' ),
|
249 |
-
esc_url( 'http://peimic.com/c/biking/' ),
|
250 |
-
esc_url( 'http://aihr.us/about-aihrus/' ),
|
251 |
-
esc_url( 'http://peimic.com/t/poetry/' ),
|
252 |
-
esc_url( 'http://peimic.com/t/WWOOF/' ),
|
253 |
-
esc_url( 'http://peimic.com/c/travel/' )
|
254 |
-
);
|
255 |
-
echo '</p></div>';
|
256 |
-
}
|
257 |
-
|
258 |
-
|
259 |
-
public static function display_page( $disable_donate = false ) {
|
260 |
-
echo '<div class="wrap">
|
261 |
-
<div class="icon32" id="icon-options-general"></div>
|
262 |
-
<h2>' . static::NAME . '</h2>';
|
263 |
-
|
264 |
-
echo '<form action="options.php" method="post">';
|
265 |
-
|
266 |
-
settings_errors( static::ID );
|
267 |
-
settings_fields( static::ID );
|
268 |
-
|
269 |
-
echo '<div id="' . static::ID . '">
|
270 |
-
<ul>';
|
271 |
-
|
272 |
-
foreach ( static::$sections as $section_slug => $section )
|
273 |
-
echo '<li><a href="#' . $section_slug . '">' . $section . '</a></li>';
|
274 |
-
|
275 |
-
echo '</ul>';
|
276 |
-
|
277 |
-
self::do_settings_sections( static::ID );
|
278 |
-
|
279 |
-
echo '
|
280 |
-
<p class="submit"><input name="Submit" type="submit" class="button-primary" value="' . esc_html__( 'Save Changes' ) . '" /></p>
|
281 |
-
</form>
|
282 |
-
</div>
|
283 |
-
';
|
284 |
-
|
285 |
-
if ( ! $disable_donate ) {
|
286 |
-
echo '<p>' .
|
287 |
-
sprintf(
|
288 |
-
__( 'If you like this plugin, please <a href="%1$s" title="Donate for Good Karma"><img src="%2$s" border="0" alt="Donate for Good Karma" /></a> or <a href="%3$s" title="purchase premium WordPress plugins from Aihrus ">purchase the Premium version</a> to help fund further development and <a href="%4$s" title="Support forums">support</a>.' ),
|
289 |
-
esc_url( 'http://aihr.us/about-aihrus/donate/' ),
|
290 |
-
esc_url( 'https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif' ),
|
291 |
-
esc_url( 'http://aihr.us/store/' ),
|
292 |
-
esc_url( 'https://aihrus.zendesk.com/home' )
|
293 |
-
) .
|
294 |
-
'</p>';
|
295 |
-
}
|
296 |
-
|
297 |
-
echo '<p class="copyright">' .
|
298 |
-
sprintf(
|
299 |
-
__( 'Copyright ©%1$s <a href="%2$s">Aihrus</a>.' ),
|
300 |
-
date( 'Y' ),
|
301 |
-
esc_url( 'http://aihr.us' )
|
302 |
-
) .
|
303 |
-
'</p>';
|
304 |
-
|
305 |
-
echo '</div>';
|
306 |
-
|
307 |
-
add_action( 'admin_footer', array( static::$class, 'section_scripts' ) );
|
308 |
-
}
|
309 |
-
|
310 |
-
|
311 |
-
public static function display_setting( $args = array(), $do_echo = true, $input = null ) {
|
312 |
-
$content = '';
|
313 |
-
|
314 |
-
extract( $args );
|
315 |
-
|
316 |
-
if ( is_null( $input ) )
|
317 |
-
$options = get_option( static::ID );
|
318 |
-
else {
|
319 |
-
$options = array();
|
320 |
-
$options[$id] = $input;
|
321 |
-
}
|
322 |
-
|
323 |
-
if ( ! isset( $options[$id] ) && $type != 'checkbox' )
|
324 |
-
$options[$id] = $std;
|
325 |
-
elseif ( ! isset( $options[$id] ) )
|
326 |
-
$options[$id] = 0;
|
327 |
-
|
328 |
-
$field_class = '';
|
329 |
-
if ( ! empty( $class ) )
|
330 |
-
$field_class = ' ' . $class;
|
331 |
-
|
332 |
-
// desc isn't escaped because it's might contain allowed html
|
333 |
-
$choices = array_map( 'esc_attr', $choices );
|
334 |
-
$field_class = esc_attr( $field_class );
|
335 |
-
$id = esc_attr( $id );
|
336 |
-
$field_value = esc_attr( $options[$id] );
|
337 |
-
$std = esc_attr( $std );
|
338 |
-
|
339 |
-
switch ( $type ) {
|
340 |
-
case 'checkbox':
|
341 |
-
$content .= '<input class="checkbox' . $field_class . '" type="checkbox" id="' . $id . '" name="' . static::ID . '[' . $id . ']" value="1" ' . checked( $field_value, 1, false ) . ' /> ';
|
342 |
-
|
343 |
-
if ( ! empty( $desc ) )
|
344 |
-
$content .= '<label for="' . $id . '"><span class="description">' . $desc . '</span></label>';
|
345 |
-
|
346 |
-
if ( $show_code )
|
347 |
-
$content .= '<br /><code>' . $id . '</code>';
|
348 |
-
break;
|
349 |
-
|
350 |
-
case 'file':
|
351 |
-
$content .= '<input class="regular-text' . $field_class . '" type="file" id="' . $id . '" name="' . static::ID . '[' . $id . ']" />';
|
352 |
-
|
353 |
-
if ( ! empty( $desc ) )
|
354 |
-
$content .= '<br /><span class="description">' . $desc . '</span>';
|
355 |
-
|
356 |
-
break;
|
357 |
-
|
358 |
-
case 'heading':
|
359 |
-
$content .= '</td></tr><tr valign="top"><td colspan="2"><h4>' . $desc . '</h4>';
|
360 |
-
break;
|
361 |
-
|
362 |
-
case 'hidden':
|
363 |
-
$content .= '<input type="hidden" id="' . $id . '" name="' . static::ID . '[' . $id . ']" value="' . $field_value . '" />';
|
364 |
-
|
365 |
-
break;
|
366 |
-
|
367 |
-
case 'password':
|
368 |
-
$content .= '<input class="regular-text' . $field_class . '" type="password" id="' . $id . '" name="' . static::ID . '[' . $id . ']" value="' . $field_value . '" />';
|
369 |
-
|
370 |
-
if ( ! empty( $desc ) )
|
371 |
-
$content .= '<br /><span class="description">' . $desc . '</span>';
|
372 |
-
|
373 |
-
break;
|
374 |
-
|
375 |
-
case 'radio':
|
376 |
-
$i = 1;
|
377 |
-
$count_choices = count( $choices );
|
378 |
-
foreach ( $choices as $value => $label ) {
|
379 |
-
$content .= '<input class="radio' . $field_class . '" type="radio" name="' . static::ID . '[' . $id . ']" id="' . $id . $i . '" value="' . $value . '" ' . checked( $field_value, $value, false ) . '> <label for="' . $id . $i . '">' . $label . '</label>';
|
380 |
-
|
381 |
-
if ( $i < $count_choices )
|
382 |
-
$content .= '<br />';
|
383 |
-
|
384 |
-
$i++;
|
385 |
-
}
|
386 |
-
|
387 |
-
if ( ! empty( $desc ) )
|
388 |
-
$content .= '<br /><span class="description">' . $desc . '</span>';
|
389 |
-
|
390 |
-
if ( $show_code )
|
391 |
-
$content .= '<br /><code>' . $id . '</code>';
|
392 |
-
break;
|
393 |
-
|
394 |
-
case 'readonly':
|
395 |
-
$content .= '<input class="regular-text' . $field_class . '" type="text" id="' . $id . '" name="' . static::ID . '[' . $id . ']" value="' . $field_value . '" readonly="readonly" />';
|
396 |
-
|
397 |
-
if ( ! empty( $desc ) )
|
398 |
-
$content .= '<br /><span class="description">' . $desc . '</span>';
|
399 |
-
break;
|
400 |
-
|
401 |
-
case 'rich_editor':
|
402 |
-
global $wp_version;
|
403 |
-
|
404 |
-
$field_value = $options[$id];
|
405 |
-
|
406 |
-
if ( $wp_version >= 3.3 && function_exists( 'wp_editor' ) ) {
|
407 |
-
ob_start();
|
408 |
-
wp_editor( $field_value, static::ID . '[' . $id . ']', array( 'textarea_name' => static::ID . '[' . $id . ']' ) );
|
409 |
-
$content = ob_get_clean();
|
410 |
-
} else {
|
411 |
-
$content = '<textarea class="large-text" rows="10" id="' . static::ID . '[' . $id . ']" name="' . static::ID . '[' . $id . ']">' . esc_textarea( $field_value ) . '</textarea>';
|
412 |
-
}
|
413 |
-
|
414 |
-
if ( ! empty( $desc ) )
|
415 |
-
$content .= '<br /><span class="description">' . $desc . '</span>';
|
416 |
-
|
417 |
-
if ( $show_code )
|
418 |
-
$content .= '<br /><code>' . $id . '</code>';
|
419 |
-
break;
|
420 |
-
|
421 |
-
case 'select':
|
422 |
-
$content .= '<select class="select' . $field_class . '" id="' . $id . '" name="' . static::ID . '[' . $id . ']">';
|
423 |
-
|
424 |
-
foreach ( $choices as $value => $label )
|
425 |
-
$content .= '<option value="' . $value . '"' . selected( $field_value, $value, false ) . '>' . $label . '</option>';
|
426 |
-
|
427 |
-
$content .= '</select>';
|
428 |
-
|
429 |
-
if ( ! empty( $desc ) )
|
430 |
-
$content .= '<br /><span class="description">' . $desc . '</span>';
|
431 |
-
|
432 |
-
if ( $show_code )
|
433 |
-
$content .= '<br /><code>' . $id . '</code>';
|
434 |
-
break;
|
435 |
-
|
436 |
-
case 'text':
|
437 |
-
$content .= '<input class="regular-text' . $field_class . '" type="text" id="' . $id . '" name="' . static::ID . '[' . $id . ']" placeholder="' . $std . '" value="' . $field_value . '" />';
|
438 |
-
|
439 |
-
if ( ! empty( $desc ) )
|
440 |
-
$content .= '<br /><span class="description">' . $desc . '</span>';
|
441 |
-
|
442 |
-
if ( $show_code )
|
443 |
-
$content .= '<br /><code>' . $id . '</code>';
|
444 |
-
break;
|
445 |
-
|
446 |
-
case 'textarea':
|
447 |
-
$content .= '<textarea class="' . $field_class . '" id="' . $id . '" name="' . static::ID . '[' . $id . ']" placeholder="' . $std . '" rows="5" cols="30">' . $field_value . '</textarea>';
|
448 |
-
|
449 |
-
if ( ! empty( $desc ) )
|
450 |
-
$content .= '<br /><span class="description">' . $desc . '</span>';
|
451 |
-
|
452 |
-
if ( $show_code )
|
453 |
-
$content .= '<br /><code>' . $id . '</code>';
|
454 |
-
break;
|
455 |
-
|
456 |
-
default:
|
457 |
-
break;
|
458 |
-
}
|
459 |
-
|
460 |
-
if ( ! $do_echo )
|
461 |
-
return $content;
|
462 |
-
|
463 |
-
echo $content;
|
464 |
-
}
|
465 |
-
|
466 |
-
|
467 |
-
public static function register_settings() {
|
468 |
-
register_setting( static::ID, static::ID, array( static::$class, 'validate_settings' ) );
|
469 |
-
|
470 |
-
foreach ( static::$sections as $slug => $title ) {
|
471 |
-
if ( $slug == 'about' )
|
472 |
-
add_settings_section( $slug, $title, array( static::$class, 'display_about' ), static::ID );
|
473 |
-
else
|
474 |
-
add_settings_section( $slug, $title, array( static::$class, 'display_section' ), static::ID );
|
475 |
-
}
|
476 |
-
|
477 |
-
foreach ( static::$settings as $id => $setting ) {
|
478 |
-
$setting['id'] = $id;
|
479 |
-
static::create_setting( $setting );
|
480 |
-
}
|
481 |
-
}
|
482 |
-
|
483 |
-
|
484 |
-
public static function scripts() {
|
485 |
-
wp_enqueue_script( 'jquery-ui-tabs' );
|
486 |
-
}
|
487 |
-
|
488 |
-
|
489 |
-
public static function styles() {
|
490 |
-
wp_register_style( 'jquery-style', '//ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/smoothness/jquery-ui.css' );
|
491 |
-
wp_enqueue_style( 'jquery-style' );
|
492 |
-
}
|
493 |
-
|
494 |
-
|
495 |
-
/**
|
496 |
-
*
|
497 |
-
*
|
498 |
-
* @SuppressWarnings(PHPMD.Superglobals)
|
499 |
-
*/
|
500 |
-
public static function validate_settings( $input, $options = null, $do_errors = false ) {
|
501 |
-
$errors = array();
|
502 |
-
|
503 |
-
$null_options = false;
|
504 |
-
if ( is_null( $options ) ) {
|
505 |
-
$null_options = true;
|
506 |
-
|
507 |
-
$defaults = static::get_defaults();
|
508 |
-
$options = self::get_settings();
|
509 |
-
|
510 |
-
if ( is_admin() ) {
|
511 |
-
if ( ! empty( $input['reset_defaults'] ) ) {
|
512 |
-
foreach ( $defaults as $id => $std )
|
513 |
-
$input[$id] = $std;
|
514 |
-
|
515 |
-
unset( $input['reset_defaults'] );
|
516 |
-
|
517 |
-
$input['resetted'] = true;
|
518 |
-
}
|
519 |
-
|
520 |
-
if ( ! empty( $input['import'] ) && $_SESSION['export'] != $input['import'] ) {
|
521 |
-
$import = $input['import'];
|
522 |
-
$unserialized = unserialize( $import );
|
523 |
-
if ( is_array( $unserialized ) ) {
|
524 |
-
foreach ( $unserialized as $id => $std )
|
525 |
-
$input[$id] = $std;
|
526 |
-
}
|
527 |
-
}
|
528 |
-
}
|
529 |
-
}
|
530 |
-
|
531 |
-
foreach ( $options as $id => $parts ) {
|
532 |
-
$default = $parts['std'];
|
533 |
-
$type = $parts['type'];
|
534 |
-
$validations = ! empty( $parts['validate'] ) ? $parts['validate'] : array();
|
535 |
-
if ( ! empty( $validations ) )
|
536 |
-
$validations = explode( ',', $validations );
|
537 |
-
|
538 |
-
if ( ! isset( $input[ $id ] ) ) {
|
539 |
-
if ( 'checkbox' != $type ) {
|
540 |
-
$input[ $id ] = $default;
|
541 |
-
} else {
|
542 |
-
$input[ $id ] = 0;
|
543 |
-
}
|
544 |
-
}
|
545 |
-
|
546 |
-
if ( $default == $input[ $id ] && ! in_array( 'required', $validations ) )
|
547 |
-
continue;
|
548 |
-
|
549 |
-
if ( 'checkbox' == $type ) {
|
550 |
-
if ( self::is_true( $input[ $id ] ) )
|
551 |
-
$input[ $id ] = 1;
|
552 |
-
else
|
553 |
-
$input[ $id ] = 0;
|
554 |
-
} elseif ( in_array( $type, array( 'radio', 'select' ) ) ) {
|
555 |
-
// single choices only
|
556 |
-
$keys = array_keys( $parts['choices'] );
|
557 |
-
|
558 |
-
if ( ! in_array( $input[ $id ], $keys ) ) {
|
559 |
-
if ( self::is_true( $input[ $id ] ) )
|
560 |
-
$input[ $id ] = 1;
|
561 |
-
else
|
562 |
-
$input[ $id ] = 0;
|
563 |
-
}
|
564 |
-
}
|
565 |
-
|
566 |
-
if ( ! empty( $validations ) ) {
|
567 |
-
foreach ( $validations as $validate )
|
568 |
-
self::validators( $validate, $id, $input, $default, $errors );
|
569 |
-
}
|
570 |
-
}
|
571 |
-
|
572 |
-
unset( $input['export'] );
|
573 |
-
unset( $input['import'] );
|
574 |
-
|
575 |
-
$hide_update_notice = false;
|
576 |
-
if ( isset( static::$hide_update_notice ) && ! empty( static::$hide_update_notice ) ) {
|
577 |
-
$hide_update_notice = true;
|
578 |
-
}
|
579 |
-
|
580 |
-
if ( $null_options && empty( $errors ) && ! $hide_update_notice ) {
|
581 |
-
add_settings_error( static::ID, 'settings_updated', esc_html__( 'Settings saved.' ), 'updated' );
|
582 |
-
set_transient( 'settings_errors', get_settings_errors(), 30 );
|
583 |
-
}
|
584 |
-
|
585 |
-
if ( empty( $do_errors ) ) {
|
586 |
-
$validated = $input;
|
587 |
-
} else {
|
588 |
-
$validated = array(
|
589 |
-
'input' => $input,
|
590 |
-
'errors' => $errors,
|
591 |
-
);
|
592 |
-
}
|
593 |
-
|
594 |
-
return $validated;
|
595 |
-
}
|
596 |
-
|
597 |
-
|
598 |
-
public static function validators( $validate, $id, &$input, $default, &$errors ) {
|
599 |
-
switch ( $validate ) {
|
600 |
-
case 'absint':
|
601 |
-
case 'intval':
|
602 |
-
if ( '' !== $input[ $id ] )
|
603 |
-
$input[ $id ] = $validate( $input[ $id ] );
|
604 |
-
else
|
605 |
-
$input[ $id ] = $default;
|
606 |
-
break;
|
607 |
-
|
608 |
-
case 'email':
|
609 |
-
$input[ $id ] = self::validate_email( $input[ $id ], $default );
|
610 |
-
break;
|
611 |
-
|
612 |
-
case 'ids':
|
613 |
-
$input[ $id ] = self::validate_ids( $input[ $id ], $default );
|
614 |
-
break;
|
615 |
-
|
616 |
-
case 'is_true':
|
617 |
-
$input[ $id ] = self::is_true( $input[ $id ] );
|
618 |
-
break;
|
619 |
-
|
620 |
-
case 'min1':
|
621 |
-
$input[ $id ] = intval( $input[ $id ] );
|
622 |
-
if ( 0 >= $input[ $id ] )
|
623 |
-
$input[ $id ] = $default;
|
624 |
-
break;
|
625 |
-
|
626 |
-
case 'nozero':
|
627 |
-
$input[ $id ] = intval( $input[ $id ] );
|
628 |
-
if ( 0 === $input[ $id ] )
|
629 |
-
$input[ $id ] = $default;
|
630 |
-
break;
|
631 |
-
|
632 |
-
case 'order':
|
633 |
-
$input[ $id ] = self::validate_order( $input[ $id ], $default );
|
634 |
-
break;
|
635 |
-
|
636 |
-
case 'required':
|
637 |
-
if ( empty( $input[ $id ] ) )
|
638 |
-
$errors[ $id ] = esc_html__( 'Required' );
|
639 |
-
break;
|
640 |
-
|
641 |
-
case 'slash_sanitize_title':
|
642 |
-
$temp = explode( '/', $input[ $id ] );
|
643 |
-
$temp = array_map( 'sanitize_title', $temp );
|
644 |
-
$temp = implode( '/', $temp );
|
645 |
-
|
646 |
-
$input[ $id ] = $temp;
|
647 |
-
break;
|
648 |
-
|
649 |
-
case 'slug':
|
650 |
-
$input[ $id ] = self::validate_slug( $input[ $id ], $default );
|
651 |
-
$input[ $id ] = strtolower( $input[ $id ] );
|
652 |
-
break;
|
653 |
-
|
654 |
-
case 'slugs':
|
655 |
-
$input[ $id ] = self::validate_slugs( $input[ $id ], $default );
|
656 |
-
$input[ $id ] = strtolower( $input[ $id ] );
|
657 |
-
break;
|
658 |
-
|
659 |
-
case 'term':
|
660 |
-
$input[ $id ] = self::validate_term( $input[ $id ], $default );
|
661 |
-
$input[ $id ] = strtolower( $input[ $id ] );
|
662 |
-
break;
|
663 |
-
|
664 |
-
case 'terms':
|
665 |
-
$input[ $id ] = self::validate_terms( $input[ $id ], $default );
|
666 |
-
break;
|
667 |
-
|
668 |
-
case 'trim':
|
669 |
-
$options = explode( "\n", $input[ $id ] );
|
670 |
-
foreach ( $options as $key => $value )
|
671 |
-
$options[ $key ] = trim( $value );
|
672 |
-
|
673 |
-
$input[ $id ] = implode( "\n", $options );
|
674 |
-
break;
|
675 |
-
|
676 |
-
case 'url':
|
677 |
-
$input[ $id ] = self::validate_url( $input[ $id ], $default );
|
678 |
-
break;
|
679 |
-
|
680 |
-
default:
|
681 |
-
$input[ $id ] = $validate( $input[ $id ] );
|
682 |
-
break;
|
683 |
-
}
|
684 |
-
}
|
685 |
-
|
686 |
-
|
687 |
-
public static function validate_ids( $input, $default = false ) {
|
688 |
-
if ( preg_match( '#^\d+(,\s?\d+)*$#', $input ) )
|
689 |
-
return preg_replace( '#\s#', '', $input );
|
690 |
-
|
691 |
-
return $default;
|
692 |
-
}
|
693 |
-
|
694 |
-
|
695 |
-
public static function validate_order( $input, $default = false ) {
|
696 |
-
if ( preg_match( '#^desc|asc$#i', $input ) )
|
697 |
-
return $input;
|
698 |
-
|
699 |
-
return $default;
|
700 |
-
}
|
701 |
-
|
702 |
-
|
703 |
-
public static function validate_slugs( $input, $default = false ) {
|
704 |
-
if ( preg_match( '#^[\w-]+(,\s?[\w-]+)*$#', $input ) )
|
705 |
-
return preg_replace( '#\s#', '', $input );
|
706 |
-
|
707 |
-
return $default;
|
708 |
-
}
|
709 |
-
|
710 |
-
|
711 |
-
public static function validate_slug( $input, $default = false ) {
|
712 |
-
if ( preg_match( '#^[\w-]+$#', $input ) )
|
713 |
-
return $input;
|
714 |
-
|
715 |
-
return $default;
|
716 |
-
}
|
717 |
-
|
718 |
-
|
719 |
-
public static function validate_term( $input, $default = false ) {
|
720 |
-
if ( preg_match( '#^\w+$#', $input ) )
|
721 |
-
return $input;
|
722 |
-
|
723 |
-
return $default;
|
724 |
-
}
|
725 |
-
|
726 |
-
|
727 |
-
/**
|
728 |
-
* Let values like true, 'true', 1, 'on', and 'yes' to be true. Else, false
|
729 |
-
*/
|
730 |
-
public static function is_true( $value = null, $return_boolean = true ) {
|
731 |
-
if ( true === $value || 'true' == strtolower( $value ) || 1 == $value || 'on' == strtolower( $value ) || 'yes' == strtolower( $value ) ) {
|
732 |
-
if ( $return_boolean )
|
733 |
-
return true;
|
734 |
-
else
|
735 |
-
return 1;
|
736 |
-
} else {
|
737 |
-
if ( $return_boolean )
|
738 |
-
return false;
|
739 |
-
else
|
740 |
-
return 0;
|
741 |
-
}
|
742 |
-
}
|
743 |
-
|
744 |
-
|
745 |
-
public static function validate_email( $input, $default = false ) {
|
746 |
-
if ( filter_var( $input, FILTER_VALIDATE_EMAIL ) )
|
747 |
-
return $input;
|
748 |
-
|
749 |
-
return $default;
|
750 |
-
}
|
751 |
-
|
752 |
-
|
753 |
-
public static function validate_terms( $input, $default = false ) {
|
754 |
-
if ( preg_match( '#^(([\w- ]+)(,\s?)?)+$#', $input ) )
|
755 |
-
return preg_replace( '#,\s*$#', '', $input );
|
756 |
-
|
757 |
-
return $default;
|
758 |
-
}
|
759 |
-
|
760 |
-
|
761 |
-
public static function validate_url( $input, $default = false ) {
|
762 |
-
if ( filter_var( $input, FILTER_VALIDATE_URL ) )
|
763 |
-
return $input;
|
764 |
-
|
765 |
-
return $default;
|
766 |
-
}
|
767 |
-
|
768 |
-
|
769 |
-
public static function get_scripts() {
|
770 |
-
foreach ( static::$scripts as $script )
|
771 |
-
echo $script;
|
772 |
-
}
|
773 |
-
|
774 |
-
|
775 |
-
public static function get_styles() {
|
776 |
-
foreach ( static::$styles as $style )
|
777 |
-
echo $style;
|
778 |
-
}
|
779 |
-
|
780 |
-
|
781 |
-
}
|
782 |
-
|
783 |
-
|
784 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
trunk/includes/libraries/aihrus-framework/includes/class-aihrus-widget.php
DELETED
@@ -1,254 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
3 |
-
Copyright 2014 Michael Cannon (email: mc@aihr.us)
|
4 |
-
|
5 |
-
This program is free software; you can redistribute it and/or modify
|
6 |
-
it under the terms of the GNU General Public License, version 2, as
|
7 |
-
published by the Free Software Foundation.
|
8 |
-
|
9 |
-
This program is distributed in the hope that it will be useful,
|
10 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12 |
-
GNU General Public License for more details.
|
13 |
-
|
14 |
-
You should have received a copy of the GNU General Public License
|
15 |
-
along with this program; if not, write to the Free Software
|
16 |
-
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
17 |
-
*/
|
18 |
-
|
19 |
-
if ( class_exists( 'Aihrus_Widget' ) )
|
20 |
-
return;
|
21 |
-
|
22 |
-
require_once 'interface-aihrus-widget.php';
|
23 |
-
|
24 |
-
|
25 |
-
abstract class Aihrus_Widget extends WP_Widget implements Aihrus_Widget_Interface {
|
26 |
-
public static $suggest_id = 0;
|
27 |
-
|
28 |
-
|
29 |
-
public function __construct( $classname, $description, $id_base, $title ) {
|
30 |
-
// Widget settings
|
31 |
-
$widget_ops = array(
|
32 |
-
'classname' => $classname,
|
33 |
-
'description' => $description,
|
34 |
-
);
|
35 |
-
|
36 |
-
// Widget control settings
|
37 |
-
$control_ops = array(
|
38 |
-
'id_base' => $id_base,
|
39 |
-
);
|
40 |
-
|
41 |
-
// Create the widget
|
42 |
-
$this->WP_Widget(
|
43 |
-
static::ID,
|
44 |
-
$title,
|
45 |
-
$widget_ops,
|
46 |
-
$control_ops
|
47 |
-
);
|
48 |
-
}
|
49 |
-
|
50 |
-
|
51 |
-
public function widget( $args, $instance ) {
|
52 |
-
global $before_widget, $before_title, $after_title, $after_widget;
|
53 |
-
|
54 |
-
$args = wp_parse_args( $args, static::get_defaults() );
|
55 |
-
extract( $args );
|
56 |
-
|
57 |
-
// Our variables from the widget settings
|
58 |
-
$title = apply_filters( 'widget_title', $instance['title'], null );
|
59 |
-
$content = static::get_content( $instance, $this->number );
|
60 |
-
|
61 |
-
// Before widget (defined by themes)
|
62 |
-
echo $before_widget;
|
63 |
-
|
64 |
-
if ( ! empty( $instance['title_link'] ) ) {
|
65 |
-
$target = ! empty( $instance['target'] ) ? $instance['target'] : null;
|
66 |
-
$title = Aihrus_Common::create_link( $instance['title_link'], $title, $target );
|
67 |
-
}
|
68 |
-
|
69 |
-
// Display the widget title if one was input (before and after defined by themes)
|
70 |
-
if ( ! empty( $title ) )
|
71 |
-
echo $before_title . $title . $after_title;
|
72 |
-
|
73 |
-
// Display Widget
|
74 |
-
echo $content;
|
75 |
-
|
76 |
-
// After widget (defined by themes)
|
77 |
-
echo $after_widget;
|
78 |
-
}
|
79 |
-
|
80 |
-
|
81 |
-
/**
|
82 |
-
*
|
83 |
-
*
|
84 |
-
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
85 |
-
*/
|
86 |
-
|
87 |
-
|
88 |
-
public function update( $new_instance, $old_instance ) {
|
89 |
-
$instance = static::validate_settings( $new_instance );
|
90 |
-
|
91 |
-
return $instance;
|
92 |
-
}
|
93 |
-
|
94 |
-
|
95 |
-
public function form( $instance ) {
|
96 |
-
$instance = static::form_instance( $instance );
|
97 |
-
$defaults = static::get_defaults();
|
98 |
-
$instance = wp_parse_args( $instance, $defaults );
|
99 |
-
|
100 |
-
$form_parts = static::form_parts( $instance, $this->number );
|
101 |
-
foreach ( $form_parts as $key => $part ) {
|
102 |
-
$part[ 'id' ] = $key;
|
103 |
-
$this->display_setting( $part, $instance );
|
104 |
-
}
|
105 |
-
}
|
106 |
-
|
107 |
-
|
108 |
-
/**
|
109 |
-
*
|
110 |
-
*
|
111 |
-
* @SuppressWarnings(PHPMD.UnusedLocalVariable)
|
112 |
-
*/
|
113 |
-
public function display_setting( $args = array(), $options ) {
|
114 |
-
extract( $args );
|
115 |
-
|
116 |
-
if ( empty( $widget ) ) {
|
117 |
-
echo '<div style="display:none;">';
|
118 |
-
}
|
119 |
-
|
120 |
-
$do_return = false;
|
121 |
-
switch ( $type ) {
|
122 |
-
case 'heading':
|
123 |
-
if ( ! empty( $desc ) )
|
124 |
-
echo '<h3>' . $desc . '</h3>';
|
125 |
-
|
126 |
-
$do_return = true;
|
127 |
-
break;
|
128 |
-
|
129 |
-
case 'expand_all':
|
130 |
-
if ( ! empty( $desc ) )
|
131 |
-
echo '<h3>' . $desc . '</h3>';
|
132 |
-
|
133 |
-
echo '<a id="' . $this->get_field_id( $id ) . '" style="cursor:pointer;" onclick="jQuery( \'.tw-collapsible-control\' ) . slideToggle(); jQuery( \'.tw-collapsible\' ) . slideToggle();">' . esc_html__( 'Expand/Collapse All Options' ) . ' »</a>';
|
134 |
-
|
135 |
-
$do_return = true;
|
136 |
-
break;
|
137 |
-
|
138 |
-
case 'expand_begin':
|
139 |
-
if ( ! empty( $desc ) )
|
140 |
-
echo '<h3>' . $desc . '</h3>';
|
141 |
-
|
142 |
-
echo '<a id="' . $this->get_field_id( $id ) . '" style="cursor:pointer;" onclick="jQuery( \'div#' . $this->get_field_id( $id ) . '\' ) . slideToggle();" class="tw-collapsible-control">' . esc_html__( 'Expand/Collapse' ) . ' »</a>';
|
143 |
-
echo '<div id="' . $this->get_field_id( $id ) . '" style="display:none" class="tw-collapsible">';
|
144 |
-
|
145 |
-
$do_return = true;
|
146 |
-
break;
|
147 |
-
|
148 |
-
case 'expand_end':
|
149 |
-
echo '</div>';
|
150 |
-
|
151 |
-
$do_return = true;
|
152 |
-
break;
|
153 |
-
|
154 |
-
default:
|
155 |
-
break;
|
156 |
-
}
|
157 |
-
|
158 |
-
if ( $do_return ) {
|
159 |
-
if ( empty( $widget ) ) {
|
160 |
-
echo '</div>';
|
161 |
-
}
|
162 |
-
|
163 |
-
return;
|
164 |
-
}
|
165 |
-
|
166 |
-
if ( ! isset( $options[$id] ) && $type != 'checkbox' )
|
167 |
-
$options[$id] = $std;
|
168 |
-
elseif ( ! isset( $options[$id] ) )
|
169 |
-
$options[$id] = 0;
|
170 |
-
|
171 |
-
$field_class = '';
|
172 |
-
if ( ! empty( $class ) )
|
173 |
-
$field_class = ' ' . $class;
|
174 |
-
|
175 |
-
echo '<p>';
|
176 |
-
|
177 |
-
switch ( $type ) {
|
178 |
-
case 'checkbox':
|
179 |
-
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 ) . ' /> ';
|
180 |
-
|
181 |
-
echo '<label for="' . $this->get_field_id( $id ) . '">' . $title . '</label>';
|
182 |
-
break;
|
183 |
-
|
184 |
-
case 'select':
|
185 |
-
echo '<label for="' . $this->get_field_id( $id ) . '">' . $title . '</label>';
|
186 |
-
echo '<select id="' . $this->get_field_id( $id ) . '"class="select' . $field_class . '" name="' . $this->get_field_name( $id ) . '">';
|
187 |
-
|
188 |
-
foreach ( $choices as $value => $label )
|
189 |
-
echo '<option value="' . esc_attr( $value ) . '"' . selected( $options[$id], $value, false ) . '>' . $label . '</option>';
|
190 |
-
|
191 |
-
echo '</select>';
|
192 |
-
break;
|
193 |
-
|
194 |
-
case 'radio':
|
195 |
-
$i = 0;
|
196 |
-
$count_options = count( $options ) - 1;
|
197 |
-
|
198 |
-
foreach ( $choices as $value => $label ) {
|
199 |
-
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>';
|
200 |
-
if ( $i < $count_options )
|
201 |
-
echo '<br />';
|
202 |
-
$i++;
|
203 |
-
}
|
204 |
-
|
205 |
-
echo '<label for="' . $this->get_field_id( $id ) . '">' . $title . '</label>';
|
206 |
-
break;
|
207 |
-
|
208 |
-
case 'textarea':
|
209 |
-
echo '<label for="' . $this->get_field_id( $id ) . '">' . $title . '</label>';
|
210 |
-
|
211 |
-
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>';
|
212 |
-
break;
|
213 |
-
|
214 |
-
case 'password':
|
215 |
-
echo '<label for="' . $this->get_field_id( $id ) . '">' . $title . '</label>';
|
216 |
-
|
217 |
-
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] ) . '" />';
|
218 |
-
break;
|
219 |
-
|
220 |
-
case 'readonly':
|
221 |
-
echo '<label for="' . $this->get_field_id( $id ) . '">' . $title . '</label>';
|
222 |
-
|
223 |
-
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" />';
|
224 |
-
break;
|
225 |
-
|
226 |
-
case 'text':
|
227 |
-
echo '<label for="' . $this->get_field_id( $id ) . '">' . $title . '</label>';
|
228 |
-
|
229 |
-
$suggest_id = 'suggest_' . self::$suggest_id++;
|
230 |
-
echo '<input class="widefat' . $field_class . ' ' . $suggest_id . '" type="text" id="' . $this->get_field_id( $id ) . '" name="' . $this->get_field_name( $id ) . '" placeholder="' . $std . '" value="' . esc_attr( $options[$id] ) . '" />';
|
231 |
-
|
232 |
-
if ( $suggest )
|
233 |
-
echo static::get_suggest( $id, $suggest_id );
|
234 |
-
break;
|
235 |
-
|
236 |
-
default:
|
237 |
-
break;
|
238 |
-
}
|
239 |
-
|
240 |
-
if ( ! empty( $desc ) )
|
241 |
-
echo '<br /><span class="setting-description"><small>' . $desc . '</small></span>';
|
242 |
-
|
243 |
-
echo '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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trunk/includes/libraries/aihrus-framework/includes/interface-aihrus-common.php
DELETED
@@ -1,27 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
3 |
-
Copyright 2014 Michael Cannon (email: mc@aihr.us)
|
4 |
-
|
5 |
-
This program is free software; you can redistribute it and/or modify
|
6 |
-
it under the terms of the GNU General Public License, version 2, as
|
7 |
-
published by the Free Software Foundation.
|
8 |
-
|
9 |
-
This program is distributed in the hope that it will be useful,
|
10 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12 |
-
GNU General Public License for more details.
|
13 |
-
|
14 |
-
You should have received a copy of the GNU General Public License
|
15 |
-
along with this program; if not, write to the Free Software
|
16 |
-
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
17 |
-
*/
|
18 |
-
|
19 |
-
if ( class_exists( 'Aihrus_Common_Interface' ) )
|
20 |
-
return;
|
21 |
-
|
22 |
-
|
23 |
-
interface Aihrus_Common_Interface {
|
24 |
-
}
|
25 |
-
|
26 |
-
|
27 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trunk/includes/libraries/aihrus-framework/includes/interface-aihrus-licensing.php
DELETED
@@ -1,28 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
3 |
-
Copyright 2014 Michael Cannon (email: mc@aihr.us)
|
4 |
-
|
5 |
-
This program is free software; you can redistribute it and/or modify
|
6 |
-
it under the terms of the GNU General Public License, version 2, as
|
7 |
-
published by the Free Software Foundation.
|
8 |
-
|
9 |
-
This program is distributed in the hope that it will be useful,
|
10 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12 |
-
GNU General Public License for more details.
|
13 |
-
|
14 |
-
You should have received a copy of the GNU General Public License
|
15 |
-
along with this program; if not, write to the Free Software
|
16 |
-
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
17 |
-
*/
|
18 |
-
|
19 |
-
if ( class_exists( 'Aihrus_Licensing_Interface' ) )
|
20 |
-
return;
|
21 |
-
|
22 |
-
|
23 |
-
interface Aihrus_Licensing_Interface {
|
24 |
-
public function settings( $settings );
|
25 |
-
}
|
26 |
-
|
27 |
-
|
28 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trunk/includes/libraries/aihrus-framework/includes/interface-aihrus-widget.php
DELETED
@@ -1,33 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
3 |
-
Copyright 2014 Michael Cannon (email: mc@aihr.us)
|
4 |
-
|
5 |
-
This program is free software; you can redistribute it and/or modify
|
6 |
-
it under the terms of the GNU General Public License, version 2, as
|
7 |
-
published by the Free Software Foundation.
|
8 |
-
|
9 |
-
This program is distributed in the hope that it will be useful,
|
10 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12 |
-
GNU General Public License for more details.
|
13 |
-
|
14 |
-
You should have received a copy of the GNU General Public License
|
15 |
-
along with this program; if not, write to the Free Software
|
16 |
-
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
17 |
-
*/
|
18 |
-
|
19 |
-
if ( class_exists( 'Aihrus_Widget_Interface' ) )
|
20 |
-
return;
|
21 |
-
|
22 |
-
|
23 |
-
interface Aihrus_Widget_Interface {
|
24 |
-
public static function form_instance( $instance );
|
25 |
-
public static function form_parts( $instance, $number );
|
26 |
-
public static function get_content( $instance, $widget_number );
|
27 |
-
public static function get_defaults();
|
28 |
-
public static function get_suggest( $id, $suggest_id );
|
29 |
-
public static function validate_settings( $instance );
|
30 |
-
}
|
31 |
-
|
32 |
-
|
33 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trunk/includes/libraries/aihrus-framework/includes/libraries/class-redrokk-metabox-class.php
DELETED
@@ -1,1470 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
*
|
4 |
-
*
|
5 |
-
* @Author Anonymous
|
6 |
-
* @link http://www.redrokk.com
|
7 |
-
* @Package Wordpress
|
8 |
-
* @SubPackage RedRokk Library
|
9 |
-
*
|
10 |
-
* @version 2.0
|
11 |
-
*/
|
12 |
-
|
13 |
-
|
14 |
-
//security
|
15 |
-
defined( 'ABSPATH' ) or die( 'You\'re not supposed to be here.' );
|
16 |
-
|
17 |
-
/**
|
18 |
-
*
|
19 |
-
*
|
20 |
-
* @author Anonymous
|
21 |
-
* @example
|
22 |
-
* $gallery = redrokk_metabox_class::getInstance('gallery');
|
23 |
-
*/
|
24 |
-
if ( !class_exists( 'redrokk_metabox_class' ) ):
|
25 |
-
class redrokk_metabox_class {
|
26 |
-
|
27 |
-
/**
|
28 |
-
* HTML 'id' attribute of the edit screen section
|
29 |
-
*
|
30 |
-
* @var string
|
31 |
-
*/
|
32 |
-
var $_id;
|
33 |
-
|
34 |
-
/**
|
35 |
-
* Save the form fields here that will be displayed to the user
|
36 |
-
*
|
37 |
-
* @var array
|
38 |
-
*/
|
39 |
-
var $_fields;
|
40 |
-
|
41 |
-
/**
|
42 |
-
* Title of the edit screen section, visible to user
|
43 |
-
* Default: None
|
44 |
-
*
|
45 |
-
* @var string
|
46 |
-
*/
|
47 |
-
var $title;
|
48 |
-
|
49 |
-
/**
|
50 |
-
* Function that prints out the HTML for the edit screen section. Pass
|
51 |
-
* function name as a string. Within a class, you can instead pass an
|
52 |
-
* array to call one of the class's methods. See the second example under
|
53 |
-
* Example below.
|
54 |
-
* Default: None
|
55 |
-
*
|
56 |
-
* @var callback
|
57 |
-
*/
|
58 |
-
var $callback = null;
|
59 |
-
|
60 |
-
/**
|
61 |
-
* The part of the page where the edit screen section should be shown
|
62 |
-
* ('normal', 'advanced', or 'side'). (Note that 'side' doesn't exist before 2.7)
|
63 |
-
* Default: 'advanced'
|
64 |
-
*
|
65 |
-
* @var string
|
66 |
-
*/
|
67 |
-
var $context = 'normal';
|
68 |
-
|
69 |
-
/**
|
70 |
-
* The priority within the context where the boxes should show
|
71 |
-
* ('high', 'core', 'default' or 'low')
|
72 |
-
* Default: 'default'
|
73 |
-
*
|
74 |
-
* @var string
|
75 |
-
*/
|
76 |
-
var $priority = 'default';
|
77 |
-
|
78 |
-
/**
|
79 |
-
* Arguments to pass into your callback function. The callback will receive the
|
80 |
-
* $post object and whatever parameters are passed through this variable.
|
81 |
-
* Default: null
|
82 |
-
*
|
83 |
-
* @var array
|
84 |
-
*/
|
85 |
-
var $callback_args;
|
86 |
-
|
87 |
-
/**
|
88 |
-
* Prebuilt metaboxes can be activated by using this type
|
89 |
-
* Default: default
|
90 |
-
*
|
91 |
-
* (options:)
|
92 |
-
* default
|
93 |
-
* images
|
94 |
-
*
|
95 |
-
* @var string
|
96 |
-
*/
|
97 |
-
var $_type;
|
98 |
-
|
99 |
-
/**
|
100 |
-
*
|
101 |
-
*
|
102 |
-
* @var unknown_type
|
103 |
-
*/
|
104 |
-
var $_category_name;
|
105 |
-
|
106 |
-
/**
|
107 |
-
* The type of Write screen on which to show the edit screen section
|
108 |
-
* ('post', 'page', 'link', or 'custom_post_type' where custom_post_type
|
109 |
-
* is the custom post type slug)
|
110 |
-
* Default: None
|
111 |
-
*
|
112 |
-
* @var array
|
113 |
-
*/
|
114 |
-
var $_object_types = array();
|
115 |
-
|
116 |
-
/**
|
117 |
-
* Whether or not to make the fields available as wp-options
|
118 |
-
*
|
119 |
-
* @var bool
|
120 |
-
*/
|
121 |
-
var $_isAdminPage = false;
|
122 |
-
|
123 |
-
|
124 |
-
/**
|
125 |
-
* Constructor.
|
126 |
-
*
|
127 |
-
*/
|
128 |
-
function __construct( $options = array() ) {
|
129 |
-
//initializing
|
130 |
-
$this->setProperties( $options );
|
131 |
-
$this->setOptionHooks();
|
132 |
-
|
133 |
-
if ( !$this->callback ) {
|
134 |
-
$this->callback = array( $this, 'show' );
|
135 |
-
}
|
136 |
-
if ( !$this->title ) {
|
137 |
-
$this->title = ucfirst( $this->_id );
|
138 |
-
}
|
139 |
-
|
140 |
-
//registering this metabox
|
141 |
-
add_action( 'add_meta_boxes', array( $this, '_register' ) );
|
142 |
-
|
143 |
-
// backwards compatible (before WP 3.0)
|
144 |
-
// add_action( 'admin_init', array($this, '_register'), 1 );
|
145 |
-
|
146 |
-
add_action( 'save_post', array( $this, '_save' ) );
|
147 |
-
add_filter( 'wp_redirect', array( $this, '_redirectIntervention' ), 40, 1 );
|
148 |
-
}
|
149 |
-
|
150 |
-
|
151 |
-
/**
|
152 |
-
* Method properly inturprets the given parameter and sets it accordingly
|
153 |
-
*
|
154 |
-
* @param string|object $value
|
155 |
-
*/
|
156 |
-
function setObjectTypes( $value ) {
|
157 |
-
if ( is_a( $value, 'redrokk_post_class' ) ) {
|
158 |
-
$value = $value->_post_type;
|
159 |
-
}
|
160 |
-
if ( is_a( $value, 'redrokk_admin_class' ) ) {
|
161 |
-
$value = $value->id;
|
162 |
-
$this->_isAdminPage = $value;
|
163 |
-
}
|
164 |
-
if ( is_array( $value ) ) {
|
165 |
-
foreach ( $value as $v )
|
166 |
-
$this->_object_types[] = $v;
|
167 |
-
return $this;
|
168 |
-
}
|
169 |
-
|
170 |
-
$this->_object_types[] = $value;
|
171 |
-
return $this;
|
172 |
-
}
|
173 |
-
|
174 |
-
|
175 |
-
/**
|
176 |
-
* Method is designed to return the currently visible post type
|
177 |
-
*/
|
178 |
-
function getCurrentPostType() {
|
179 |
-
$post_type = false;
|
180 |
-
if ( isset( $_REQUEST['post_type'] ) ) {
|
181 |
-
$post_type = $_REQUEST['post_type'];
|
182 |
-
}
|
183 |
-
elseif ( isset( $_REQUEST['post'] ) ) {
|
184 |
-
$post = get_post( $_REQUEST['post'] );
|
185 |
-
$post_type = $post->post_type;
|
186 |
-
}
|
187 |
-
elseif ( isset( $_REQUEST['page'] ) ) {
|
188 |
-
$post_type = $_REQUEST['page'];
|
189 |
-
}
|
190 |
-
|
191 |
-
return $post_type;
|
192 |
-
}
|
193 |
-
|
194 |
-
|
195 |
-
/**
|
196 |
-
* Method properly prepares the metabox type by binding the necessary hooks
|
197 |
-
*
|
198 |
-
* @param mixed $value
|
199 |
-
*/
|
200 |
-
function settype( $value = 'default' ) {
|
201 |
-
$this->_type = $value;
|
202 |
-
|
203 |
-
switch ( $this->_type ) {
|
204 |
-
default:
|
205 |
-
case 'default':
|
206 |
-
add_action( 'metabox-show-'.$this->_id, array( $this, '_renderForm' ), 20, 1 );
|
207 |
-
add_action( 'metabox-save-'.$this->_id, array( $this, 'saveAsPostMeta' ), 10, 2 );
|
208 |
-
break;
|
209 |
-
case 'image':
|
210 |
-
case 'images':
|
211 |
-
$this->_fields = array(
|
212 |
-
array(
|
213 |
-
'name' => 'New Image',
|
214 |
-
'type' => 'title',
|
215 |
-
),
|
216 |
-
array(
|
217 |
-
'name' => 'Image Title',
|
218 |
-
'id' => $this->_id.'_post_title',
|
219 |
-
'type' => 'text',
|
220 |
-
),
|
221 |
-
array(
|
222 |
-
'name' => 'Description',
|
223 |
-
'id' => $this->_id.'_post_content',
|
224 |
-
'type' => 'textarea',
|
225 |
-
),
|
226 |
-
array(
|
227 |
-
'name' => 'Image File',
|
228 |
-
'id' => $this->_id.'_image',
|
229 |
-
'type' => 'image',
|
230 |
-
),
|
231 |
-
array(
|
232 |
-
'name' => 'Save Image',
|
233 |
-
'type' => 'submit',
|
234 |
-
),
|
235 |
-
);
|
236 |
-
add_action( 'metabox-show-'.$this->_id, array( $this, '_renderListImageAttachments' ), 20, 1 );
|
237 |
-
add_action( 'metabox-show-'.$this->_id, array( $this, '_renderForm' ), 20, 1 );
|
238 |
-
add_action( 'metabox-save-'.$this->_id, array( $this, 'saveAsAttachment' ), 1, 2 );
|
239 |
-
break;
|
240 |
-
case 'video':
|
241 |
-
case 'videos':
|
242 |
-
$this->_fields = array(
|
243 |
-
array(
|
244 |
-
'name' => 'New Video',
|
245 |
-
'type' => 'title',
|
246 |
-
),
|
247 |
-
array(
|
248 |
-
'name' => 'Video Title',
|
249 |
-
'id' => $this->_id.'_post_title',
|
250 |
-
'type' => 'text',
|
251 |
-
),
|
252 |
-
array(
|
253 |
-
'name' => 'Description',
|
254 |
-
'id' => $this->_id.'_post_content',
|
255 |
-
'type' => 'textarea',
|
256 |
-
),
|
257 |
-
array(
|
258 |
-
'name' => 'Video File',
|
259 |
-
'id' => $this->_id.'_image',
|
260 |
-
'type' => 'image',
|
261 |
-
),
|
262 |
-
array(
|
263 |
-
'name' => 'Video Link',
|
264 |
-
'id' => $this->_id.'_link',
|
265 |
-
'type' => 'text',
|
266 |
-
),
|
267 |
-
array(
|
268 |
-
'name' => '_videocat',
|
269 |
-
'id' => $this->_id.'_videocat',
|
270 |
-
'default'=>$this->getCategory(),
|
271 |
-
'type' => 'hidden',
|
272 |
-
),
|
273 |
-
array(
|
274 |
-
'name' => '_metaid',
|
275 |
-
'id' => $this->_id.'_metaid',
|
276 |
-
'type' => 'hidden',
|
277 |
-
),
|
278 |
-
array(
|
279 |
-
'name' => 'Save Video',
|
280 |
-
'type' => 'submit',
|
281 |
-
),
|
282 |
-
);
|
283 |
-
add_action( 'metabox-show-'.$this->_id, array( $this, '_renderListAttachments' ), 20, 1 );
|
284 |
-
add_action( 'metabox-show-'.$this->_id, array( $this, '_renderListVideoAttachments' ), 20, 1 );
|
285 |
-
add_action( 'metabox-show-'.$this->_id, array( $this, '_renderForm' ), 20, 1 );
|
286 |
-
add_action( 'metabox-save-'.$this->_id, array( $this, 'saveAsPostMeta' ), 1, 2 );
|
287 |
-
break;
|
288 |
-
}
|
289 |
-
}
|
290 |
-
|
291 |
-
|
292 |
-
/**
|
293 |
-
* Returns the category to use
|
294 |
-
*/
|
295 |
-
function getCategory() {
|
296 |
-
return isset( $this->_category_name )
|
297 |
-
? $this->_category_name
|
298 |
-
: '_videocat';
|
299 |
-
}
|
300 |
-
|
301 |
-
|
302 |
-
/**
|
303 |
-
* Method will save the posted content as an image attachment
|
304 |
-
*
|
305 |
-
*/
|
306 |
-
function saveAsAttachment( $source, $post_id ) {
|
307 |
-
if ( empty( $_FILES ) || !isset( $_REQUEST[$this->_id.'files'] ) ) return $source;
|
308 |
-
|
309 |
-
// initializing
|
310 |
-
$property = $_REQUEST[$this->_id.'files'];
|
311 |
-
$post_data = array();
|
312 |
-
|
313 |
-
if ( isset( $source[$this->_id.'_post_title'] ) && $source[$this->_id.'_post_title'] ) {
|
314 |
-
$post_data['post_title'] = $source[$this->_id.'_post_title'];
|
315 |
-
}
|
316 |
-
|
317 |
-
if ( isset( $source[$this->_id.'_post_content'] ) && $source[$this->_id.'_post_content'] ) {
|
318 |
-
$post_data['post_content'] = $source[$this->_id.'_post_content'];
|
319 |
-
}
|
320 |
-
|
321 |
-
$id = media_handle_upload( $property, $post_id, $post_data );
|
322 |
-
$source[$property] = $id;
|
323 |
-
|
324 |
-
$type = 'post';
|
325 |
-
if ( $this->getCurrentPostType() ) {
|
326 |
-
$type = $this->getCurrentPostType();
|
327 |
-
}
|
328 |
-
|
329 |
-
//saving the attachment ID to the taxonomy
|
330 |
-
if ( !in_array( $type, get_post_types( array( 'public' => false ) ) ) ) {
|
331 |
-
$old = get_metadata( $type, $post_id, $property, true );
|
332 |
-
if ( $id && $id != $old ) {
|
333 |
-
wp_delete_attachment( $old, true );
|
334 |
-
update_metadata( $type, $post_id, $property, $id );
|
335 |
-
}
|
336 |
-
}
|
337 |
-
|
338 |
-
foreach ( (array)$source as $property => $new ) {
|
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 |
-
/**
|
360 |
-
* Method saves the data provided as post meta values
|
361 |
-
*
|
362 |
-
* @param array $source
|
363 |
-
* @param integer $post_id
|
364 |
-
*/
|
365 |
-
function saveAsPostMeta( $source, $post_id ) {
|
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 |
-
//skip everything but the specially prefixed
|
389 |
-
if ( strpos( $property, $this->_id ) !== 0 ) continue;
|
390 |
-
|
391 |
-
//each meta set has it's own ID
|
392 |
-
$property = str_replace( $this->_id, $this->_category_name.'_'.$id, $property );
|
393 |
-
|
394 |
-
$old = get_metadata( $type, $post_id, $property, true );
|
395 |
-
if ( $new && $new != $old ) {
|
396 |
-
update_metadata( $type, $post_id, $property, $new );
|
397 |
-
}
|
398 |
-
elseif ( !$new ) {
|
399 |
-
delete_metadata( $type, $post_id, $property, $old );
|
400 |
-
}
|
401 |
-
}
|
402 |
-
|
403 |
-
// maybe there's a last id
|
404 |
-
if ( !$id ) {
|
405 |
-
if ( !$id = get_metadata( $type, $post_id, '_metaidlast', true ) ) {
|
406 |
-
$id = 0;
|
407 |
-
}
|
408 |
-
$id++;
|
409 |
-
update_metadata( $type, $post_id, '_metaidlast', $id );
|
410 |
-
}
|
411 |
-
|
412 |
-
// saving all of the standard items
|
413 |
-
foreach ( (array)$source as $property => $new ) {
|
414 |
-
//skip special properties that are prefixed with the id
|
415 |
-
if ( strpos( $property, $this->_id ) === 0 ) continue;
|
416 |
-
|
417 |
-
$old = get_metadata( $type, $post_id, $property, true );
|
418 |
-
update_metadata( $type, $post_id, $property, $new );
|
419 |
-
|
420 |
-
// if ($new && $new != $old) {
|
421 |
-
// update_metadata($type, $post_id, $property, $new);
|
422 |
-
// }
|
423 |
-
// elseif (!$new) {
|
424 |
-
// delete_metadata($type, $post_id, $property, $old);
|
425 |
-
// }
|
426 |
-
|
427 |
-
}
|
428 |
-
|
429 |
-
return true;
|
430 |
-
}
|
431 |
-
|
432 |
-
|
433 |
-
/**
|
434 |
-
* Do something with the data entered
|
435 |
-
*
|
436 |
-
* @param integer $post_id
|
437 |
-
*/
|
438 |
-
function _save( $post_id ) {
|
439 |
-
//initializing
|
440 |
-
$post = get_post( $post_id );
|
441 |
-
|
442 |
-
// verify if this is an auto save routine.
|
443 |
-
// If it is our form has not been submitted, so we dont want to do anything
|
444 |
-
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
|
445 |
-
return;
|
446 |
-
|
447 |
-
// verify this came from the our screen and with proper authorization,
|
448 |
-
// because save_post can be triggered at other times
|
449 |
-
if ( !isset( $_REQUEST[ get_class().$this->_id ] ) )
|
450 |
-
return;
|
451 |
-
|
452 |
-
if ( !wp_verify_nonce( $_REQUEST[ get_class().$this->_id ], plugin_basename( __FILE__ ) ) )
|
453 |
-
return;
|
454 |
-
|
455 |
-
// this metabox is to be displayed for a certain object type only
|
456 |
-
if ( !in_array( $post->post_type, $this->_object_types ) )
|
457 |
-
return;
|
458 |
-
|
459 |
-
// Check permissions
|
460 |
-
if ( 'page' == $post->post_type ) {
|
461 |
-
if ( !current_user_can( 'edit_page', $post->ID ) )
|
462 |
-
return;
|
463 |
-
}
|
464 |
-
else {
|
465 |
-
if ( !current_user_can( 'edit_post', $post->ID ) )
|
466 |
-
return;
|
467 |
-
}
|
468 |
-
|
469 |
-
//saving the request data
|
470 |
-
if ( !$this->_type ) $this->setType();
|
471 |
-
do_action( 'metabox-save-'.$this->_id, $this->getRequestPostMetas(), $post->ID, $this );
|
472 |
-
return true;
|
473 |
-
}
|
474 |
-
|
475 |
-
|
476 |
-
/**
|
477 |
-
* Method returns the post meta
|
478 |
-
*
|
479 |
-
*/
|
480 |
-
function getRequestPostMetas() {
|
481 |
-
$ignores = array( 'post_title', 'post_name', 'post_content', 'post_excerpt', 'post',
|
482 |
-
'post_status', 'post_type', 'post_author', 'ping_status', 'post_parent', 'message',
|
483 |
-
'post_category', 'comment_status', 'menu_order', 'to_ping', 'pinged', 'post_password',
|
484 |
-
'guid', 'post_content_filtered', 'import_id', 'post_date', 'post_date_gmt', 'tags_input',
|
485 |
-
'action' );
|
486 |
-
|
487 |
-
$fields = array();
|
488 |
-
foreach ( (array)$this->_fields as $field ) {
|
489 |
-
if ( !array_key_exists( 'id', $field ) ) continue;
|
490 |
-
$fields[] = $field['id'];
|
491 |
-
}
|
492 |
-
|
493 |
-
$requests = $_REQUEST;
|
494 |
-
foreach ( (array)$requests as $k => $request ) {
|
495 |
-
if ( ( !empty( $fields ) && !in_array( $k, $fields ) )
|
496 |
-
|| ( in_array( $k, $ignores ) || strpos( $k, 'nounce' ) !== false ) ) {
|
497 |
-
unset( $requests[$k] );
|
498 |
-
}
|
499 |
-
}
|
500 |
-
|
501 |
-
return apply_filters( 'metabox-requests-'.$this->_id, $requests );
|
502 |
-
}
|
503 |
-
|
504 |
-
|
505 |
-
/**
|
506 |
-
* Display the inner contents of the metabox
|
507 |
-
*
|
508 |
-
* @param object $post
|
509 |
-
*/
|
510 |
-
function show( $post ) {
|
511 |
-
// Use nonce for verification
|
512 |
-
wp_nonce_field( plugin_basename( __FILE__ ), get_class().$this->_id );
|
513 |
-
do_action( 'metabox-show-'.$this->_id, $this->_fields, $this );
|
514 |
-
}
|
515 |
-
|
516 |
-
|
517 |
-
/**
|
518 |
-
* Method displays a list of attached images
|
519 |
-
*
|
520 |
-
*/
|
521 |
-
function _renderListImageAttachments() {
|
522 |
-
global $post, $current_screen;
|
523 |
-
$images = get_children( "post_parent=$post->ID&post_type=attachment&post_mime_type=image" );
|
524 |
-
|
525 |
-
// no images to render
|
526 |
-
if ( empty( $images ) ) {
|
527 |
-
?><p>No images have been saved.</p><?php
|
528 |
-
|
529 |
-
// rendering the images
|
530 |
-
} else {
|
531 |
-
|
532 |
-
?>
|
533 |
-
<table class="wp-list-table form-table widefat" style="border:none;">
|
534 |
-
<?php foreach ( (array)$images as $post_id => $image ): ?>
|
535 |
-
<?php $image_attributes = wp_get_attachment_image_src( $image->ID, 'thumbnail' ); ?>
|
536 |
-
<tbody id="the-list">
|
537 |
-
<tr>
|
538 |
-
<th scope="row" style="width: 140px">
|
539 |
-
<div style="padding:10px;background:whiteSmoke;">
|
540 |
-
<img src="<?php echo wp_get_attachment_thumb_url( $image->ID ); ?>" /></div>
|
541 |
-
</th>
|
542 |
-
<td>
|
543 |
-
<b><?php echo $image->post_title; ?></b>
|
544 |
-
<p><?php echo get_the_content( $image->ID ); ?></p>
|
545 |
-
|
546 |
-
<div class="row-actions">
|
547 |
-
<span class="inline">
|
548 |
-
<a href="<?php echo wp_nonce_url(
|
549 |
-
"media.php?attachment_id=$image->ID"
|
550 |
-
."&action=edit&_redirect="
|
551 |
-
.urlencode( $this->_currentPageURL() )
|
552 |
-
); ?>">
|
553 |
-
Edit</a> |
|
554 |
-
</span>
|
555 |
-
<span class="trash">
|
556 |
-
<a class="submitdelete"
|
557 |
-
onclick="return showNotice.warn();"
|
558 |
-
href="<?php echo wp_nonce_url(
|
559 |
-
"post.php?action=delete&_redirect="
|
560 |
-
.urlencode( $this->_currentPageURL() )
|
561 |
-
."&post=$image->ID",
|
562 |
-
'delete-attachment_' . $image->ID ); ?>">
|
563 |
-
Delete Permanently</a> |
|
564 |
-
</span>
|
565 |
-
<span class="inline">
|
566 |
-
<a target="_blank"
|
567 |
-
href="<?php echo get_attachment_link( $image->ID ); ?>">
|
568 |
-
View</a>
|
569 |
-
</span>
|
570 |
-
</div>
|
571 |
-
</td>
|
572 |
-
</tr>
|
573 |
-
</tbody>
|
574 |
-
<?php endforeach; ?>
|
575 |
-
</table>
|
576 |
-
<?php
|
577 |
-
}
|
578 |
-
return;
|
579 |
-
}
|
580 |
-
|
581 |
-
|
582 |
-
/**
|
583 |
-
* Return a clean list of meta listings created by this system
|
584 |
-
*
|
585 |
-
* @param string $category
|
586 |
-
* $param object $post
|
587 |
-
*/
|
588 |
-
public static function getMetaListings( $category, $post = null ) {
|
589 |
-
// initializing
|
590 |
-
if ( $post === NULL ) {
|
591 |
-
global $post;
|
592 |
-
}
|
593 |
-
$custom = get_post_custom( $post->ID );
|
594 |
-
$return = array();
|
595 |
-
|
596 |
-
//looping all values to build our return array
|
597 |
-
foreach ( (array)$custom as $property => $value ) {
|
598 |
-
$parts = explode( '_', $property );
|
599 |
-
if ( !isset( $parts[0] ) || !isset( $parts[1] ) || !isset( $parts[2] ) ) continue;
|
600 |
-
if ( $parts[0] != $category ) continue;
|
601 |
-
|
602 |
-
$pro = str_replace( $parts[0].'_'.$parts[1].'_', '', $property );
|
603 |
-
$return[$parts[1]][$pro] = $value;
|
604 |
-
}
|
605 |
-
|
606 |
-
return $return;
|
607 |
-
}
|
608 |
-
|
609 |
-
|
610 |
-
/**
|
611 |
-
* Function removes a specific category meta
|
612 |
-
*
|
613 |
-
* @param string $category
|
614 |
-
* $param string $meta_id
|
615 |
-
* $param object $post
|
616 |
-
*/
|
617 |
-
public static function deleteMetaListing( $category, $meta_id, $post = null ) {
|
618 |
-
// initializing
|
619 |
-
if ( $post === NULL ) {
|
620 |
-
global $post;
|
621 |
-
}
|
622 |
-
$listings = redrokk_metabox_class::getMetaListings( $category, $post );
|
623 |
-
if ( !isset( $listings[$meta_id] ) ) return false;
|
624 |
-
|
625 |
-
$type = 'post';
|
626 |
-
|
627 |
-
foreach ( (array)$listings[$meta_id] as $property => $value ) {
|
628 |
-
$pro = $category.'_'.$meta_id.'_'.$property;
|
629 |
-
delete_metadata( $type, $post->ID, $pro, $value[0] );
|
630 |
-
}
|
631 |
-
return true;
|
632 |
-
}
|
633 |
-
|
634 |
-
|
635 |
-
/**
|
636 |
-
* Method displays a list of meta attachments
|
637 |
-
*
|
638 |
-
*/
|
639 |
-
function _renderListAttachments() {
|
640 |
-
global $post;
|
641 |
-
|
642 |
-
//delete action prior to pulling new listings
|
643 |
-
if ( isset( $_REQUEST['redrokkdelete'] ) && $_REQUEST['redrokkdelete'] ) {
|
644 |
-
redrokk_metabox_class::deleteMetaListing( $this->_category_name, $_REQUEST['redrokkdelete'], $post );
|
645 |
-
}
|
646 |
-
|
647 |
-
//pull new listings
|
648 |
-
$metaListings = redrokk_metabox_class::getMetaListings( $this->_category_name, $post );
|
649 |
-
|
650 |
-
if ( !empty( $metaListings ) ) {
|
651 |
-
?>
|
652 |
-
<table class="wp-list-table form-table widefat" style="border:none;">
|
653 |
-
<tbody id="the-list">
|
654 |
-
<?php foreach ( (array)$metaListings as $meta_id => $video ): ?>
|
655 |
-
<?php $video = apply_filters( 'redrokk_metabox_class::_renderListAttachments', $video, $meta_id );?>
|
656 |
-
|
657 |
-
<tr id="<?php echo $this->_category_name; ?>_<?php echo $meta_id; ?>">
|
658 |
-
<th scope="row" style="width: 140px">
|
659 |
-
<div style="padding:10px;background:whiteSmoke;">
|
660 |
-
<?php if ( isset( $video['link'] ) ) echo apply_filters( 'the_content', $video['link'][0] ); ?>
|
661 |
-
</div>
|
662 |
-
</th>
|
663 |
-
<td>
|
664 |
-
<b><?php if ( isset( $video['post_title'] ) ) echo $video['post_title'][0]; ?></b>
|
665 |
-
<p><?php if ( isset( $video['post_content'] ) ) echo $video['post_content'][0]; ?></p>
|
666 |
-
|
667 |
-
<div class="row-actions">
|
668 |
-
<span class="inline">
|
669 |
-
<a href="#" id="edit_<?php echo $this->_category_name; ?>_<?php echo $meta_id; ?>">
|
670 |
-
Edit</a> |
|
671 |
-
</span>
|
672 |
-
<span class="trash">
|
673 |
-
<a class="submitdelete"
|
674 |
-
onclick="return showNotice.warn();"
|
675 |
-
href="<?php echo site_url( "wp-admin/post.php?post={$post->ID}"
|
676 |
-
."&action=edit"
|
677 |
-
."&redrokkdelete=$meta_id"
|
678 |
-
); ?>">
|
679 |
-
Delete Permanently</a>
|
680 |
-
</span>
|
681 |
-
</div>
|
682 |
-
<script>
|
683 |
-
jQuery('#edit_<?php echo $this->_category_name; ?>_<?php echo $meta_id; ?>').click(function(){
|
684 |
-
var data = {
|
685 |
-
<?php
|
686 |
-
$data = array();
|
687 |
-
|
688 |
-
//making sure all fields will be cleared
|
689 |
-
foreach ( (array)$this->_fields as $field ) {
|
690 |
-
if ( !isset( $field['id'] ) || !isset( $field['type'] ) ) continue;
|
691 |
-
if ( !in_array( $field['type'], array( 'text', 'file', 'image', 'textarea', 'hidden' ) ) )
|
692 |
-
continue;
|
693 |
-
|
694 |
-
$id = str_replace( $this->_id.'_', '', $field['id'] );
|
695 |
-
$data[$id] = "'$id':''";
|
696 |
-
}
|
697 |
-
|
698 |
-
//adding our values to the array
|
699 |
-
foreach ( (array)$video as $vp => $vv ) {
|
700 |
-
if ( isset( $vv[0] ) ) $vv = $vv[0];
|
701 |
-
$data[$vp] = "'$vp':'$vv'";
|
702 |
-
}
|
703 |
-
|
704 |
-
//adding the meta ID to the array
|
705 |
-
$data[$id] = "'metaid':'$meta_id'";
|
706 |
-
|
707 |
-
echo implode( ',', $data );
|
708 |
-
?>
|
709 |
-
};
|
710 |
-
|
711 |
-
jQuery.each(data, function(key, value){
|
712 |
-
jQuery('#<?php echo $this->_id; ?>_'+key).val( value );
|
713 |
-
});
|
714 |
-
return false;
|
715 |
-
});
|
716 |
-
</script>
|
717 |
-
</td>
|
718 |
-
<?php do_action( 'redrokk_metabox_class::_renderListAttachments::rows', $video, $meta_id, $this ); ?>
|
719 |
-
</tr>
|
720 |
-
<?php endforeach; ?>
|
721 |
-
</tbody>
|
722 |
-
</table>
|
723 |
-
<?php
|
724 |
-
}
|
725 |
-
|
726 |
-
}
|
727 |
-
|
728 |
-
|
729 |
-
/**
|
730 |
-
* Method displays a list of attached videos
|
731 |
-
*
|
732 |
-
*/
|
733 |
-
function _renderListVideoAttachments() {
|
734 |
-
global $post;
|
735 |
-
|
736 |
-
//pull new listings
|
737 |
-
$videos = get_children( "post_parent=$post->ID&post_type=attachment&post_mime_type=video/mp4" );
|
738 |
-
|
739 |
-
// no images to render
|
740 |
-
if ( !empty( $videos ) ) {
|
741 |
-
?>
|
742 |
-
<table class="wp-list-table form-table widefat" style="border:none;">
|
743 |
-
<tbody id="the-list">
|
744 |
-
<?php foreach ( (array)$videos as $post_id => $video ): ?>
|
745 |
-
<?php $image_attributes = wp_get_attachment_link( $video->ID ); ?>
|
746 |
-
<tr>
|
747 |
-
<th scope="row" style="width: 140px">
|
748 |
-
<div style="padding:10px;background:whiteSmoke;">
|
749 |
-
<?php echo $image_attributes; ?>
|
750 |
-
</div>
|
751 |
-
</th>
|
752 |
-
<td>
|
753 |
-
<b><?php echo $video->post_title; ?></b>
|
754 |
-
<p><?php echo get_the_content( $video->ID ); ?></p>
|
755 |
-
|
756 |
-
<div class="row-actions">
|
757 |
-
<span class="inline">
|
758 |
-
<a href="<?php echo wp_nonce_url(
|
759 |
-
"media.php?attachment_id=$meta_id"
|
760 |
-
."&action=edit&_redirect="
|
761 |
-
.urlencode( $this->_currentPageURL() )
|
762 |
-
); ?>">
|
763 |
-
Edit</a> |
|
764 |
-
</span>
|
765 |
-
<span class="trash">
|
766 |
-
<a class="submitdelete"
|
767 |
-
onclick="return showNotice.warn();"
|
768 |
-
href="<?php echo wp_nonce_url(
|
769 |
-
"post.php?action=delete&_redirect="
|
770 |
-
.urlencode( $this->_currentPageURL() )
|
771 |
-
."&post=$video->ID",
|
772 |
-
'delete-attachment_' . $video->ID ); ?>">
|
773 |
-
Delete Permanently</a>
|
774 |
-
</span>
|
775 |
-
</div>
|
776 |
-
</td>
|
777 |
-
</tr>
|
778 |
-
<?php endforeach; ?>
|
779 |
-
</tbody>
|
780 |
-
</table>
|
781 |
-
<?php
|
782 |
-
}
|
783 |
-
}
|
784 |
-
|
785 |
-
|
786 |
-
/**
|
787 |
-
* Method renders the form from any source
|
788 |
-
*
|
789 |
-
* @param array $fields
|
790 |
-
*/
|
791 |
-
function _renderForm( $fields = array() ) {
|
792 |
-
//initializing
|
793 |
-
global $post;
|
794 |
-
$defaults = array(
|
795 |
-
'name' => '',
|
796 |
-
'desc' => '',
|
797 |
-
'id' => '',
|
798 |
-
'type' => 'text',
|
799 |
-
'options' => array(),
|
800 |
-
'default' => '',
|
801 |
-
'value' => '',
|
802 |
-
'class' => '',
|
803 |
-
'multiple' => '',
|
804 |
-
'args' => array(
|
805 |
-
'hide_empty' => 0,
|
806 |
-
'name' => 'element_name',
|
807 |
-
'hierarchical' => true
|
808 |
-
),
|
809 |
-
'attributes' => ''
|
810 |
-
);
|
811 |
-
|
812 |
-
// no fields to render
|
813 |
-
if ( empty( $fields ) ) {
|
814 |
-
?>
|
815 |
-
<p>No form fields have been defined. Use <pre>
|
816 |
-
$metabox->set('_fields', array(
|
817 |
-
array(
|
818 |
-
'name' => 'Title',
|
819 |
-
'type' => 'title',
|
820 |
-
),
|
821 |
-
array(
|
822 |
-
'name' => 'Title',
|
823 |
-
'desc' => '',
|
824 |
-
'id' => 'title',
|
825 |
-
'type' => 'text',
|
826 |
-
'std' => ''
|
827 |
-
),
|
828 |
-
array(
|
829 |
-
'name' => 'image',
|
830 |
-
'desc' => '',
|
831 |
-
'id' => 'imagefile',
|
832 |
-
'type' => 'image',
|
833 |
-
'std' => ''
|
834 |
-
),
|
835 |
-
array(
|
836 |
-
'name' => 'Textarea',
|
837 |
-
'desc' => 'Enter big text here',
|
838 |
-
'id' => 'textarea_id',
|
839 |
-
'type' => 'textarea',
|
840 |
-
'std' => 'Default value 2'
|
841 |
-
),
|
842 |
-
array(
|
843 |
-
'name' => 'Select box',
|
844 |
-
'id' => 'select_id',
|
845 |
-
'type' => 'select',
|
846 |
-
'options'=> array(
|
847 |
-
'value1' => 'Value 1',
|
848 |
-
'value2' => 'Value 2',
|
849 |
-
'value3' => 'Value 3',
|
850 |
-
'value4' => 'Value 4',
|
851 |
-
)
|
852 |
-
),
|
853 |
-
array(
|
854 |
-
'name' => 'Radio',
|
855 |
-
'id' => 'radio_id',
|
856 |
-
'type' => 'radio',
|
857 |
-
'value' => 'test',
|
858 |
-
'desc' => 'Check this box if you want its value saved',
|
859 |
-
),
|
860 |
-
array(
|
861 |
-
'name' => '',
|
862 |
-
'id' => 'radio_id',
|
863 |
-
'type' => 'radio',
|
864 |
-
'value' => 'test2',
|
865 |
-
'desc' => 'Check this box if you want its value saved',
|
866 |
-
),
|
867 |
-
array(
|
868 |
-
'name' => 'Checkbox',
|
869 |
-
'id' => 'checkbox_id',
|
870 |
-
'type' => 'checkbox',
|
871 |
-
'desc' => 'Check this box if you want its value saved',
|
872 |
-
),
|
873 |
-
));</pre>
|
874 |
-
</p>
|
875 |
-
<?php
|
876 |
-
|
877 |
-
// rendering the fields
|
878 |
-
} else {
|
879 |
-
?>
|
880 |
-
<table class="form-table">
|
881 |
-
<?php
|
882 |
-
// do_action("{$this->_class}_before");
|
883 |
-
$custom = get_post_custom( $this->_id );
|
884 |
-
|
885 |
-
foreach ( (array)$fields as $field ):
|
886 |
-
$field = wp_parse_args( $field, $defaults );
|
887 |
-
$field['args'] = wp_parse_args( $field['args'], $defaults['args'] );
|
888 |
-
|
889 |
-
extract( $field );
|
890 |
-
$field['args']['name'] = $element_name = $id;
|
891 |
-
|
892 |
-
// grabbing the meta value
|
893 |
-
if ( array_key_exists( $id, $custom ) ) {
|
894 |
-
if ( isset( $custom[$id][0] ) )
|
895 |
-
$meta = esc_attr( $custom[$id][0] );
|
896 |
-
else
|
897 |
-
$meta = esc_attr( $custom[$id] );
|
898 |
-
} else {
|
899 |
-
$meta = $default;
|
900 |
-
}
|
901 |
-
|
902 |
-
$id = sanitize_title( $id );
|
903 |
-
|
904 |
-
if ( array_key_exists( 'deleteattachment', $_GET )
|
905 |
-
&& $id == $_GET['fileproperty']
|
906 |
-
&& $meta == $_GET['deleteattachment'] ) {
|
907 |
-
wp_delete_attachment( $_GET['deleteattachment'], $force_delete = true );
|
908 |
-
update_post_meta( $post->ID, $id, '' );
|
909 |
-
}
|
910 |
-
?>
|
911 |
-
<?php switch ( $type ) { default: ?>
|
912 |
-
<?php if ( is_callable( $type ) && function_exists( $type ) ) : ?>
|
913 |
-
<tr>
|
914 |
-
<th scope="row" style="width: 140px">
|
915 |
-
<label for="<?php echo $id; ?>"><?php echo $name; ?></label>
|
916 |
-
</th>
|
917 |
-
<td>
|
918 |
-
<?php call_user_func( $type, $args, $field, $custom[ $id ] ); ?>
|
919 |
-
<span class="description"><?php echo $desc; ?></span>
|
920 |
-
</td>
|
921 |
-
</tr>
|
922 |
-
<?php break; endif; ?>
|
923 |
-
<?php case 'text': ?>
|
924 |
-
<tr>
|
925 |
-
<th scope="row" style="width: 140px">
|
926 |
-
<label for="<?php echo $id; ?>"><?php echo $name; ?></label>
|
927 |
-
</th>
|
928 |
-
<td>
|
929 |
-
<input <?php echo $attributes ?>
|
930 |
-
id="<?php echo $id; ?>"
|
931 |
-
value="<?php echo $meta; ?>"
|
932 |
-
type="<?php echo $type; ?>"
|
933 |
-
name="<?php echo $id; ?>"
|
934 |
-
class="text large-text <?php echo $class; ?>" />
|
935 |
-
<span class="description"><?php echo $desc; ?></span>
|
936 |
-
</td>
|
937 |
-
</tr>
|
938 |
-
<?php break; ?>
|
939 |
-
<?php case 'submit': ?>
|
940 |
-
<?php case 'button': ?>
|
941 |
-
<tr>
|
942 |
-
<td colspan="2">
|
943 |
-
<input <?php echo $attributes ?>
|
944 |
-
id="<?php echo $id; ?>"
|
945 |
-
value="<?php echo $name; ?>"
|
946 |
-
type="submit"
|
947 |
-
name="submit"
|
948 |
-
class="button-primary <?php echo $class; ?>" />
|
949 |
-
<span class="description"><?php echo $desc; ?></span>
|
950 |
-
</td>
|
951 |
-
</tr>
|
952 |
-
<?php break; ?>
|
953 |
-
<?php case 'file': ?>
|
954 |
-
<?php case 'image': ?>
|
955 |
-
<tr>
|
956 |
-
<th scope="row" style="width: 140px">
|
957 |
-
<label for="<?php echo $id; ?>"><?php echo $name; ?></label>
|
958 |
-
</th>
|
959 |
-
<td>
|
960 |
-
<?php if ( $meta && wp_get_attachment_url( $meta ) ): ?>
|
961 |
-
<?php echo wp_get_attachment_image( $meta ); ?>
|
962 |
-
<span><a href="<?php echo add_query_arg( 'fileproperty', $id, add_query_arg( 'deleteattachment', $meta, $this->_currentPageURL() ) ); ?>">Delete Image</a></span>
|
963 |
-
<?php else: ?>
|
964 |
-
<input type="hidden" name="<?php echo $this->_id; ?>files" value="<?php echo $id; ?>" />
|
965 |
-
<!-- first hidden input forces this item to be submitted when it is not checked -->
|
966 |
-
<input <?php echo $attributes ?>
|
967 |
-
id="<?php echo $id; ?>"
|
968 |
-
type="file"
|
969 |
-
name="<?php echo $id; ?>"
|
970 |
-
onChange="jQuery(this).closest('form').attr('enctype', 'multipart/form-data');"
|
971 |
-
class="<?php echo $class; ?>" />
|
972 |
-
<?php endif; ?>
|
973 |
-
<span class="description"><?php echo $desc; ?></span>
|
974 |
-
</td>
|
975 |
-
</tr>
|
976 |
-
<?php break; ?>
|
977 |
-
<?php case 'title': ?>
|
978 |
-
<tr>
|
979 |
-
<th colspan="2" scope="row">
|
980 |
-
<h3 <?php echo $attributes ?> style="border: 1px solid #ddd;
|
981 |
-
padding: 10px;
|
982 |
-
background: #eee;
|
983 |
-
border-radius: 2px;
|
984 |
-
color: #666;
|
985 |
-
margin: 0;"><?php echo $name; ?>
|
986 |
-
</h3>
|
987 |
-
</th>
|
988 |
-
</tr>
|
989 |
-
<?php break; ?>
|
990 |
-
<?php case 'checkbox': ?>
|
991 |
-
<tr>
|
992 |
-
<th scope="row" style="width: 140px">
|
993 |
-
<label for="<?php echo $id; ?>"><?php echo $name; ?></label>
|
994 |
-
</th>
|
995 |
-
<td>
|
996 |
-
<input type="hidden" name="<?php echo $id; ?>" value="" />
|
997 |
-
<!-- first hidden input forces this item to be submitted when it is not checked -->
|
998 |
-
|
999 |
-
<?php foreach ( (array)$options as $_value => $_name ): ?>
|
1000 |
-
<input value="<?php echo $_value; ?>" type="checkbox" <?php echo $attributes ?>
|
1001 |
-
name="<?php echo $element_name; ?>" id="<?php echo $id; ?>"
|
1002 |
-
<?php echo $meta == $_value? 'checked="checked"' :''; ?>
|
1003 |
-
class="<?php echo $class; ?>" />
|
1004 |
-
<?php echo $_name; ?>
|
1005 |
-
<?php endforeach; ?>
|
1006 |
-
<span class="description"><?php echo $desc; ?></span>
|
1007 |
-
</td>
|
1008 |
-
</tr>
|
1009 |
-
<?php break; ?>
|
1010 |
-
<?php case 'radio': ?>
|
1011 |
-
<tr>
|
1012 |
-
<th scope="row" style="width: 140px">
|
1013 |
-
<label for="<?php echo $id; ?>"><?php echo $name; ?></label>
|
1014 |
-
</th>
|
1015 |
-
<td>
|
1016 |
-
<?php foreach ( (array)$options as $_value => $_name ): ?>
|
1017 |
-
<input name="<?php echo $element_name; ?>" id="<?php echo $id; ?>"
|
1018 |
-
value="<?php echo $_value; ?>" type="<?php echo $type; ?>"
|
1019 |
-
<?php echo $meta == $_value?'checked="checked"' :''; ?>
|
1020 |
-
<?php echo $attributes ?> class="<?php echo $class; ?>" />
|
1021 |
-
<?php echo $_name; ?>
|
1022 |
-
<?php endforeach; ?>
|
1023 |
-
<span class="description"><?php echo $desc; ?></span>
|
1024 |
-
</td>
|
1025 |
-
</tr>
|
1026 |
-
<?php break; ?>
|
1027 |
-
<?php case 'textarea': ?>
|
1028 |
-
<tr>
|
1029 |
-
<th scope="row" style="width: 140px">
|
1030 |
-
<label for="<?php echo $id; ?>"><?php echo $name; ?></label>
|
1031 |
-
</th>
|
1032 |
-
<td>
|
1033 |
-
<textarea <?php echo $attributes ?>
|
1034 |
-
id="<?php echo $id; ?>"
|
1035 |
-
name="<?php echo $id; ?>"
|
1036 |
-
class="large-text <?php echo $class; ?>"
|
1037 |
-
><?php echo $meta; ?></textarea>
|
1038 |
-
<span class="description"><?php echo $desc; ?></span>
|
1039 |
-
</td>
|
1040 |
-
</tr>
|
1041 |
-
<?php break; ?>
|
1042 |
-
<?php case 'wpeditor': ?>
|
1043 |
-
<tr>
|
1044 |
-
<th scope="row" style="width: 140px">
|
1045 |
-
<label for="<?php echo $id; ?>"><?php echo $name; ?></label>
|
1046 |
-
</th>
|
1047 |
-
<td>
|
1048 |
-
<?php wp_editor( $meta, $id, $settings = array() ); ?>
|
1049 |
-
<span class="description"><?php echo $desc; ?></span>
|
1050 |
-
</td>
|
1051 |
-
</tr>
|
1052 |
-
<?php break; ?>
|
1053 |
-
<?php case 'select_capabilities': ?>
|
1054 |
-
<?php $options = $type=='select_capabilities' ?$this->get_options_capabilities()+$options :$options; ?>
|
1055 |
-
|
1056 |
-
<?php case 'select_roles': ?>
|
1057 |
-
<?php $options = $type=='select_roles' ?$this->get_options_roles()+$options :$options; ?>
|
1058 |
-
|
1059 |
-
<?php case 'select_menu': ?>
|
1060 |
-
<?php $options = $type=='select_menu' ?$this->get_options_menus()+$options :$options; ?>
|
1061 |
-
|
1062 |
-
<?php case 'select_pages': ?>
|
1063 |
-
<?php $options = $type=='select_pages' ?$this->get_options_pages()+$options :$options; ?>
|
1064 |
-
|
1065 |
-
<?php case 'select_users': ?>
|
1066 |
-
<?php $options = $type=='select_users' ?$this->get_options_users()+$options :$options; ?>
|
1067 |
-
|
1068 |
-
<?php case 'select_categories': ?>
|
1069 |
-
<?php case 'select': ?>
|
1070 |
-
<tr>
|
1071 |
-
<th scope="row" style="width: 140px">
|
1072 |
-
<label for="<?php echo $id; ?>"><?php echo $name; ?></label>
|
1073 |
-
</th>
|
1074 |
-
<td>
|
1075 |
-
<?php if ( $type == 'select_categories' ): ?>
|
1076 |
-
<?php wp_dropdown_categories( $args ); ?>
|
1077 |
-
|
1078 |
-
<?php else: ?>
|
1079 |
-
|
1080 |
-
<select <?php echo $attributes ?>
|
1081 |
-
id="<?php echo $id; ?>"
|
1082 |
-
name="<?php echo $id; ?>"
|
1083 |
-
class="<?php echo $class; ?>"
|
1084 |
-
<?php echo $multiple ?"MULTIPLE SIZE='$multiple'" :''; ?>
|
1085 |
-
><?php foreach ( (array)$options as $_value => $_name ): ?>
|
1086 |
-
|
1087 |
-
<option
|
1088 |
-
value="<?php echo $_value; ?>"
|
1089 |
-
<?php echo $meta == $_value ?' selected="selected"' :''; ?>
|
1090 |
-
><?php echo $_name; ?></option>
|
1091 |
-
|
1092 |
-
<?php endforeach; ?></select>
|
1093 |
-
<?php endif; ?>
|
1094 |
-
<span class="description"><?php echo $desc; ?></span>
|
1095 |
-
</td>
|
1096 |
-
</tr>
|
1097 |
-
<?php break; ?>
|
1098 |
-
<?php case 'hidden': ?>
|
1099 |
-
<tr>
|
1100 |
-
<td colspan="2">
|
1101 |
-
<input <?php echo $attributes ?>
|
1102 |
-
id="<?php echo $id; ?>"
|
1103 |
-
value="<?php echo $meta ?$meta :$default; ?>"
|
1104 |
-
type="<?php echo $type; ?>"
|
1105 |
-
name="<?php echo $id; ?>"
|
1106 |
-
style="visibility:hidden;" />
|
1107 |
-
</td>
|
1108 |
-
</tr>
|
1109 |
-
<?php break; ?>
|
1110 |
-
<?php case 'custom': ?>
|
1111 |
-
<tr>
|
1112 |
-
<td colspan="2">
|
1113 |
-
<?php echo $desc.$default; ?>
|
1114 |
-
</td>
|
1115 |
-
</tr>
|
1116 |
-
<?php case 'date': ?>
|
1117 |
-
<tr>
|
1118 |
-
<th scope="row" style="width: 140px">
|
1119 |
-
<label for="<?php echo $id; ?>"><?php echo $name; ?></label>
|
1120 |
-
</th>
|
1121 |
-
<td>
|
1122 |
-
<?php echo mysql2date( get_option( 'date_format' ), $meta ); ?>
|
1123 |
-
<span class="description"><?php echo $desc; ?></span>
|
1124 |
-
</td>
|
1125 |
-
</tr>
|
1126 |
-
<?php break; ?>
|
1127 |
-
<?php case 'time': ?>
|
1128 |
-
<tr>
|
1129 |
-
<th scope="row" style="width: 140px">
|
1130 |
-
<label for="<?php echo $id; ?>"><?php echo $name; ?></label>
|
1131 |
-
</th>
|
1132 |
-
<td>
|
1133 |
-
<?php echo mysql2date( get_option( 'time_format' ), $meta ); ?>
|
1134 |
-
<span class="description"><?php echo $desc; ?></span>
|
1135 |
-
</td>
|
1136 |
-
</tr>
|
1137 |
-
<?php break; ?>
|
1138 |
-
<?php case 'datetime': ?>
|
1139 |
-
<tr>
|
1140 |
-
<th scope="row" style="width: 140px">
|
1141 |
-
<label for="<?php echo $id; ?>"><?php echo $name; ?></label>
|
1142 |
-
</th>
|
1143 |
-
<td>
|
1144 |
-
<?php echo mysql2date( get_option( 'date_format' ), $meta ); ?>
|
1145 |
-
<?php echo mysql2date( get_option( 'time_format' ), $meta ); ?>
|
1146 |
-
<span class="description"><?php echo $desc; ?></span>
|
1147 |
-
</td>
|
1148 |
-
</tr>
|
1149 |
-
<?php break; ?>
|
1150 |
-
<?php } ?>
|
1151 |
-
<?php endforeach; ?>
|
1152 |
-
</table>
|
1153 |
-
<?php
|
1154 |
-
}
|
1155 |
-
return $this;
|
1156 |
-
}
|
1157 |
-
|
1158 |
-
|
1159 |
-
/**
|
1160 |
-
* Returns an options list of menus
|
1161 |
-
*/
|
1162 |
-
function get_options_pages() {
|
1163 |
-
// initializing
|
1164 |
-
$options = array( '0'=>' -- ' );
|
1165 |
-
$pages = get_pages( array( 'post_type' => 'page', 'post_status' => 'publish' ) );
|
1166 |
-
|
1167 |
-
foreach ( $pages as $page ) {
|
1168 |
-
$options[$page->ID] = $page->post_title;
|
1169 |
-
}
|
1170 |
-
|
1171 |
-
return $options;
|
1172 |
-
}
|
1173 |
-
|
1174 |
-
|
1175 |
-
/**
|
1176 |
-
* Returns an options list of menus
|
1177 |
-
*/
|
1178 |
-
function get_options_menus() {
|
1179 |
-
// initializing
|
1180 |
-
$options = array( '0'=>' -- ' );
|
1181 |
-
$menus = get_terms( 'nav_menu', array(
|
1182 |
-
'hide_empty' => 0
|
1183 |
-
) );
|
1184 |
-
|
1185 |
-
foreach ( $menus as $menu ) {
|
1186 |
-
$options[$menu->slug] = $menu->name;
|
1187 |
-
}
|
1188 |
-
|
1189 |
-
return $options;
|
1190 |
-
}
|
1191 |
-
|
1192 |
-
|
1193 |
-
/**
|
1194 |
-
* Returns an options list of users
|
1195 |
-
*/
|
1196 |
-
function get_options_users() {
|
1197 |
-
// initializing
|
1198 |
-
global $wpdb;
|
1199 |
-
|
1200 |
-
$options = array( '0'=>' -- ' );
|
1201 |
-
$query = $wpdb->prepare( "SELECT $wpdb->users.ID, $wpdb->users.display_name FROM $wpdb->users", null );
|
1202 |
-
$results = $wpdb->get_results( $query );
|
1203 |
-
|
1204 |
-
foreach ( (array)$results as $result ) {
|
1205 |
-
$options[$result->ID] = $result->display_name;
|
1206 |
-
}
|
1207 |
-
|
1208 |
-
return $options;
|
1209 |
-
}
|
1210 |
-
|
1211 |
-
|
1212 |
-
/**
|
1213 |
-
* Returns an options list of capabilities
|
1214 |
-
*/
|
1215 |
-
function get_options_capabilities() {
|
1216 |
-
// initializing
|
1217 |
-
global $wpdb;
|
1218 |
-
|
1219 |
-
$options = array();
|
1220 |
-
$roles = get_option( $wpdb->prefix . 'user_roles' );
|
1221 |
-
|
1222 |
-
foreach ( (array)$roles as $role ) {
|
1223 |
-
if ( !isset( $role['capabilities'] ) ) continue;
|
1224 |
-
foreach ( (array)$role['capabilities'] as $cap => $v ) {
|
1225 |
-
$options[$role['name']."::$cap"] = $role['name']."::$cap";
|
1226 |
-
}
|
1227 |
-
}
|
1228 |
-
|
1229 |
-
return $options;
|
1230 |
-
}
|
1231 |
-
|
1232 |
-
|
1233 |
-
/**
|
1234 |
-
* Returns an options list of roles
|
1235 |
-
*/
|
1236 |
-
function get_options_roles() {
|
1237 |
-
// initializing
|
1238 |
-
global $wpdb;
|
1239 |
-
|
1240 |
-
$options = array(
|
1241 |
-
'read' => 'Public'
|
1242 |
-
);
|
1243 |
-
$roles = get_option( $wpdb->prefix . 'user_roles' );
|
1244 |
-
|
1245 |
-
foreach ( (array)$roles as $role ) {
|
1246 |
-
$options[strtolower( $role['name'] )] = $role['name'];
|
1247 |
-
}
|
1248 |
-
|
1249 |
-
return $options;
|
1250 |
-
}
|
1251 |
-
|
1252 |
-
|
1253 |
-
/**
|
1254 |
-
* Adds a box to the main column on the Post and Page edit screens
|
1255 |
-
*
|
1256 |
-
*/
|
1257 |
-
function _register() {
|
1258 |
-
// this metabox is to be displayed for a certain object type only
|
1259 |
-
if ( !empty( $this->_object_types ) && !in_array( $this->getCurrentPostType(), $this->_object_types ) )
|
1260 |
-
return;
|
1261 |
-
|
1262 |
-
if ( !$this->callback_args ) {
|
1263 |
-
$this->callback_args = $this;
|
1264 |
-
}
|
1265 |
-
|
1266 |
-
// if the user has not already set the type of this metabox,
|
1267 |
-
// then we need to do that now
|
1268 |
-
if ( !$this->_type ) {
|
1269 |
-
$this->setType();
|
1270 |
-
}
|
1271 |
-
|
1272 |
-
add_meta_box(
|
1273 |
-
$this->_id,
|
1274 |
-
$this->title,
|
1275 |
-
$this->callback,
|
1276 |
-
$this->getCurrentPostType(),
|
1277 |
-
$this->context,
|
1278 |
-
$this->priority,
|
1279 |
-
$this->callback_args
|
1280 |
-
);
|
1281 |
-
}
|
1282 |
-
|
1283 |
-
|
1284 |
-
/**
|
1285 |
-
* Method set's the hooks for the options creted by this metabox
|
1286 |
-
*
|
1287 |
-
*/
|
1288 |
-
function setOptionHooks() {
|
1289 |
-
foreach ( (array)$this->_fields as $field ) {
|
1290 |
-
if ( !isset( $field['id'] ) ) continue;
|
1291 |
-
|
1292 |
-
//creating the callback for the admin page
|
1293 |
-
$function = create_function( '$default', '
|
1294 |
-
return redrokk_admin_class::getInstance("'.$this->_isAdminPage.'")
|
1295 |
-
->getOption("'.$field['id'].'", $default, true);
|
1296 |
-
' );
|
1297 |
-
add_filter( "pre_option_{$field['id']}", $function, 20, 2 );
|
1298 |
-
}
|
1299 |
-
}
|
1300 |
-
|
1301 |
-
|
1302 |
-
/**
|
1303 |
-
* Method redirects the user if we have added a request redirect
|
1304 |
-
* in the url
|
1305 |
-
*
|
1306 |
-
* @param string $location
|
1307 |
-
*/
|
1308 |
-
function _redirectIntervention( $location ) {
|
1309 |
-
if ( isset( $_GET['_redirect'] ) ) {
|
1310 |
-
$location = urldecode( $_GET['_redirect'] );
|
1311 |
-
}
|
1312 |
-
return $location;
|
1313 |
-
}
|
1314 |
-
|
1315 |
-
|
1316 |
-
/**
|
1317 |
-
* Get the current page url
|
1318 |
-
*/
|
1319 |
-
function _currentPageURL() {
|
1320 |
-
$pageURL = 'http';
|
1321 |
-
if ( isset( $_SERVER["HTTPS"] ) && $_SERVER["HTTPS"] == "on" ) {$pageURL .= "s";}
|
1322 |
-
$pageURL .= "://";
|
1323 |
-
if ( $_SERVER["SERVER_PORT"] != "80" ) {
|
1324 |
-
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
|
1325 |
-
} else {
|
1326 |
-
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
|
1327 |
-
}
|
1328 |
-
return $pageURL;
|
1329 |
-
}
|
1330 |
-
|
1331 |
-
|
1332 |
-
/**
|
1333 |
-
* Method to bind an associative array or object to the JTable instance.This
|
1334 |
-
* method only binds properties that are publicly accessible and optionally
|
1335 |
-
* takes an array of properties to ignore when binding.
|
1336 |
-
*
|
1337 |
-
* @param mixed $src An associative array or object to bind to the JTable instance.
|
1338 |
-
* @param mixed $ignore An optional array or space separated list of properties to ignore while binding.
|
1339 |
-
*
|
1340 |
-
* @return boolean True on success.
|
1341 |
-
*
|
1342 |
-
* @link http://docs.joomla.org/JTable/bind
|
1343 |
-
* @since 11.1
|
1344 |
-
*/
|
1345 |
-
public function bind( $src, $ignore = array() ) {
|
1346 |
-
// If the source value is not an array or object return false.
|
1347 |
-
if ( !is_object( $src ) && !is_array( $src ) ) {
|
1348 |
-
trigger_error( 'Bind failed as the provided source is not an array.' );
|
1349 |
-
return false;
|
1350 |
-
}
|
1351 |
-
|
1352 |
-
// If the source value is an object, get its accessible properties.
|
1353 |
-
if ( is_object( $src ) ) {
|
1354 |
-
$src = get_object_vars( $src );
|
1355 |
-
}
|
1356 |
-
|
1357 |
-
// If the ignore value is a string, explode it over spaces.
|
1358 |
-
if ( !is_array( $ignore ) ) {
|
1359 |
-
$ignore = explode( ' ', $ignore );
|
1360 |
-
}
|
1361 |
-
|
1362 |
-
// Bind the source value, excluding the ignored fields.
|
1363 |
-
foreach ( $this->getProperties() as $k => $v ) {
|
1364 |
-
// Only process fields not in the ignore array.
|
1365 |
-
if ( !in_array( $k, $ignore ) ) {
|
1366 |
-
if ( isset( $src[$k] ) ) {
|
1367 |
-
$this->$k = $src[$k];
|
1368 |
-
}
|
1369 |
-
}
|
1370 |
-
}
|
1371 |
-
|
1372 |
-
return true;
|
1373 |
-
}
|
1374 |
-
|
1375 |
-
|
1376 |
-
/**
|
1377 |
-
* Set the object properties based on a named array/hash.
|
1378 |
-
*
|
1379 |
-
* @param mixed $properties Either an associative array or another object.
|
1380 |
-
*
|
1381 |
-
* @return boolean
|
1382 |
-
*
|
1383 |
-
* @since 11.1
|
1384 |
-
*
|
1385 |
-
* @see set()
|
1386 |
-
*/
|
1387 |
-
public function setProperties( $properties ) {
|
1388 |
-
if ( is_array( $properties ) || is_object( $properties ) ) {
|
1389 |
-
foreach ( (array) $properties as $k => $v ) {
|
1390 |
-
// Use the set function which might be overridden.
|
1391 |
-
$this->set( $k, $v );
|
1392 |
-
}
|
1393 |
-
return true;
|
1394 |
-
}
|
1395 |
-
|
1396 |
-
return false;
|
1397 |
-
}
|
1398 |
-
|
1399 |
-
|
1400 |
-
/**
|
1401 |
-
* Modifies a property of the object, creating it if it does not already exist.
|
1402 |
-
*
|
1403 |
-
* @param string $property The name of the property.
|
1404 |
-
* @param mixed $value The value of the property to set.
|
1405 |
-
*
|
1406 |
-
* @return mixed Previous value of the property.
|
1407 |
-
*
|
1408 |
-
* @since 11.1
|
1409 |
-
*/
|
1410 |
-
public function set( $property, $value = null ) {
|
1411 |
-
$_property = 'set'.str_replace( ' ', '', ucwords( str_replace( '_', ' ', $property ) ) );
|
1412 |
-
if ( method_exists( $this, $_property ) ) {
|
1413 |
-
return $this->$_property( $value );
|
1414 |
-
}
|
1415 |
-
|
1416 |
-
$previous = isset( $this->$property ) ? $this->$property : null;
|
1417 |
-
$this->$property = $value;
|
1418 |
-
return $previous;
|
1419 |
-
}
|
1420 |
-
|
1421 |
-
|
1422 |
-
/**
|
1423 |
-
* Returns an associative array of object properties.
|
1424 |
-
*
|
1425 |
-
* @param boolean $public If true, returns only the public properties.
|
1426 |
-
*
|
1427 |
-
* @return array
|
1428 |
-
*
|
1429 |
-
* @see get()
|
1430 |
-
*/
|
1431 |
-
public function getProperties( $public = true ) {
|
1432 |
-
$vars = get_object_vars( $this );
|
1433 |
-
if ( $public ) {
|
1434 |
-
foreach ( $vars as $key => $value ) {
|
1435 |
-
if ( '_' == substr( $key, 0, 1 ) ) {
|
1436 |
-
unset( $vars[$key] );
|
1437 |
-
}
|
1438 |
-
}
|
1439 |
-
}
|
1440 |
-
|
1441 |
-
return $vars;
|
1442 |
-
}
|
1443 |
-
|
1444 |
-
|
1445 |
-
/**
|
1446 |
-
* contains the current instance of this class
|
1447 |
-
*
|
1448 |
-
* @var object
|
1449 |
-
*/
|
1450 |
-
static $_instances = null;
|
1451 |
-
|
1452 |
-
/**
|
1453 |
-
* Method is called when we need to instantiate this class
|
1454 |
-
*
|
1455 |
-
* @param array $options
|
1456 |
-
*/
|
1457 |
-
public static function getInstance( $_id, $options = array() ) {
|
1458 |
-
if ( !isset( self::$_instances[$_id] ) ) {
|
1459 |
-
$options['_id'] = $_id;
|
1460 |
-
$class = get_class();
|
1461 |
-
self::$_instances[$_id] = new $class( $options );
|
1462 |
-
}
|
1463 |
-
return self::$_instances[$_id];
|
1464 |
-
}
|
1465 |
-
|
1466 |
-
|
1467 |
-
}
|
1468 |
-
|
1469 |
-
|
1470 |
-
endif;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trunk/includes/libraries/aihrus-framework/includes/libraries/wp_custom_post_status.php
DELETED
@@ -1,230 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
// No, Thanks. Direct file access forbidden.
|
3 |
-
! defined( 'ABSPATH' ) AND exit;
|
4 |
-
/*
|
5 |
-
Plugin Name: Custom Post Status
|
6 |
-
Plugin URI: http://
|
7 |
-
Description: Adds a custom post status for posts, pages or custom post types
|
8 |
-
Author: Franz Josef Kaiser
|
9 |
-
Version: 2012-06-14.1426
|
10 |
-
Author URI: http://unserkaiser.com/
|
11 |
-
License: MIT
|
12 |
-
*/
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
class wp_custom_post_status
|
17 |
-
{
|
18 |
-
/**
|
19 |
-
* Name of the post status
|
20 |
-
* Must be lower case
|
21 |
-
*
|
22 |
-
* @access protected
|
23 |
-
* @var string
|
24 |
-
*/
|
25 |
-
public $post_status;
|
26 |
-
|
27 |
-
|
28 |
-
/**
|
29 |
-
* Post type (slug) where the post status should appear
|
30 |
-
*
|
31 |
-
* @access protected
|
32 |
-
* @var string/array
|
33 |
-
*/
|
34 |
-
public $post_type = array( 'post', 'page' );
|
35 |
-
|
36 |
-
|
37 |
-
/**
|
38 |
-
* Custom Args for the post status
|
39 |
-
*
|
40 |
-
* @access protected
|
41 |
-
* @var string
|
42 |
-
*/
|
43 |
-
public $args;
|
44 |
-
|
45 |
-
|
46 |
-
/**
|
47 |
-
* Track jQuery firing
|
48 |
-
*
|
49 |
-
* @access protected
|
50 |
-
* @var boolean
|
51 |
-
*/
|
52 |
-
private static $jquery_ran = false;
|
53 |
-
|
54 |
-
|
55 |
-
/**
|
56 |
-
* Construct
|
57 |
-
* @return void
|
58 |
-
*/
|
59 |
-
public function __construct()
|
60 |
-
{
|
61 |
-
#echo '<pre>'; print_r( $this ); echo '</pre>';
|
62 |
-
// We need to have at least a post status name
|
63 |
-
if ( ! isset( $this->post_status ) )
|
64 |
-
return;
|
65 |
-
|
66 |
-
add_action( 'init', array( $this, 'add_post_status' ), 0 );
|
67 |
-
|
68 |
-
foreach ( array( 'post', 'post-new' ) as $hook )
|
69 |
-
add_action( "admin_footer-{$hook}.php", array( $this,'extend_submitdiv_post_status' ) );
|
70 |
-
}
|
71 |
-
|
72 |
-
|
73 |
-
/**
|
74 |
-
* Add a new post status of "Unavailable"
|
75 |
-
*
|
76 |
-
* @return void
|
77 |
-
*/
|
78 |
-
public function add_post_status()
|
79 |
-
{
|
80 |
-
$defaults = array(
|
81 |
-
'label_count' => false
|
82 |
-
// defaults to FALSE
|
83 |
-
,'hierarchical' => false
|
84 |
-
// defaults to FALSE
|
85 |
-
,'public' => true
|
86 |
-
// If NULL, then inherits "public"
|
87 |
-
,'publicly_queryable' => null
|
88 |
-
|
89 |
-
// most important switch
|
90 |
-
,'internal' => false
|
91 |
-
// If NULL, inherits from "internal"
|
92 |
-
,'exclude_from_search' => null
|
93 |
-
// If NULL, inherits from "internal"
|
94 |
-
,'show_in_admin_all_list' => null
|
95 |
-
// If NULL, inherits from "internal"
|
96 |
-
,'show_in_admin_status_list' => null
|
97 |
-
|
98 |
-
// If NULL, will be set to FALSE
|
99 |
-
,'protected' => null
|
100 |
-
// If NULL, will be set to FALSE
|
101 |
-
,'private' => null
|
102 |
-
// not set by the core function - defaults to NULL
|
103 |
-
,'show_in_admin_all' => null
|
104 |
-
// defaults to "post"
|
105 |
-
,'capability_type' => 'post'
|
106 |
-
,'single_view_cap' => null
|
107 |
-
// @internal use only - don't touch
|
108 |
-
,'_builtin' => false
|
109 |
-
,'_edit_link' => 'post.php?post=%d'
|
110 |
-
);
|
111 |
-
|
112 |
-
// if FALSE, will take the 1st fn arg
|
113 |
-
$defaults['label'] = __(
|
114 |
-
ucwords( str_replace(
|
115 |
-
array( '_', '-' )
|
116 |
-
,array( ' ', ' ' )
|
117 |
-
,$this->post_status
|
118 |
-
) )
|
119 |
-
,'cps_textdomain'
|
120 |
-
);
|
121 |
-
|
122 |
-
// Care about counters:
|
123 |
-
// If FALSE, will be set to array( $args->label, $args->label ), which is not desired
|
124 |
-
$defaults['label_count'] = _n_noop(
|
125 |
-
"{$defaults['label']} <span class='count'>(%s)</span>"
|
126 |
-
,"{$defaults['label']} <span class='count'>(%s)</span>"
|
127 |
-
,'cps_textdomain'
|
128 |
-
);
|
129 |
-
|
130 |
-
// Register the status: Merge Args with defaults
|
131 |
-
register_post_status(
|
132 |
-
$this->post_status
|
133 |
-
,wp_parse_args(
|
134 |
-
$this->args
|
135 |
-
,$defaults
|
136 |
-
)
|
137 |
-
);
|
138 |
-
}
|
139 |
-
|
140 |
-
|
141 |
-
/**
|
142 |
-
* Adds post status to the "submitdiv" Meta Box and post type WP List Table screens
|
143 |
-
*
|
144 |
-
* @return void
|
145 |
-
*/
|
146 |
-
public function extend_submitdiv_post_status()
|
147 |
-
{
|
148 |
-
if ( self::$jquery_ran )
|
149 |
-
return;
|
150 |
-
else
|
151 |
-
self::$jquery_ran = true;
|
152 |
-
|
153 |
-
// Abort if we're on the wrong post type, but only if we got a restriction
|
154 |
-
if ( empty( $this->post_type ) )
|
155 |
-
return;
|
156 |
-
|
157 |
-
global $post_type;
|
158 |
-
if ( is_array( $this->post_type ) )
|
159 |
-
{
|
160 |
-
if ( in_array( $post_type, $this->post_type ) )
|
161 |
-
return;
|
162 |
-
}
|
163 |
-
elseif ( $this->post_type !== $post_type )
|
164 |
-
{
|
165 |
-
return;
|
166 |
-
}
|
167 |
-
|
168 |
-
// Our post status and post type objects
|
169 |
-
global $wp_post_statuses, $post;
|
170 |
-
|
171 |
-
// Get all non-builtin post status and add them as <option>
|
172 |
-
$options = $display = '';
|
173 |
-
foreach ( $wp_post_statuses as $status )
|
174 |
-
{
|
175 |
-
if ( ! empty( $status->internal ) )
|
176 |
-
continue;
|
177 |
-
|
178 |
-
if ( ! empty( $status->private ) )
|
179 |
-
continue;
|
180 |
-
|
181 |
-
if ( ! empty( $status->protected ) )
|
182 |
-
continue;
|
183 |
-
|
184 |
-
if ( empty( $status->_builtin ) )
|
185 |
-
{
|
186 |
-
if ( ! empty( $status->label_count['domain'] ) && 'cps_textdomain' != $status->label_count['domain'] )
|
187 |
-
continue;
|
188 |
-
|
189 |
-
}
|
190 |
-
|
191 |
-
// Match against the current posts status
|
192 |
-
$selected = selected( $post->post_status, $status->name, false );
|
193 |
-
|
194 |
-
// If we one of our custom post status is selected, remember it
|
195 |
-
$selected AND $display = $status->label;
|
196 |
-
|
197 |
-
// Build the options
|
198 |
-
$options .= "<option{$selected} value='{$status->name}'>{$status->label}</option>";
|
199 |
-
|
200 |
-
}
|
201 |
-
?>
|
202 |
-
<script type="text/javascript">
|
203 |
-
jQuery( document ).ready( function($)
|
204 |
-
{
|
205 |
-
var appended = false;
|
206 |
-
|
207 |
-
<?php
|
208 |
-
// Add the selected post status label to the "Status: [Name] (Edit)"
|
209 |
-
if ( ! empty( $display ) ) :
|
210 |
-
?>
|
211 |
-
$( '#post-status-display' ).html( '<?php echo $display; ?>' )
|
212 |
-
<?php
|
213 |
-
endif;
|
214 |
-
|
215 |
-
// Add the options to the <select> element
|
216 |
-
?>
|
217 |
-
$( '.edit-post-status' ).on( 'click', function()
|
218 |
-
{
|
219 |
-
if ( !appended )
|
220 |
-
{
|
221 |
-
var select = $( '#post-status-select' ).find( 'select' );
|
222 |
-
$( select ).append( "<?php echo $options; ?>" );
|
223 |
-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-aihrus-common.php
DELETED
@@ -1,27 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
3 |
-
Copyright 2014 Michael Cannon (email: mc@aihr.us)
|
4 |
-
|
5 |
-
This program is free software; you can redistribute it and/or modify
|
6 |
-
it under the terms of the GNU General Public License, version 2, as
|
7 |
-
published by the Free Software Foundation.
|
8 |
-
|
9 |
-
This program is distributed in the hope that it will be useful,
|
10 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12 |
-
GNU General Public License for more details.
|
13 |
-
|
14 |
-
You should have received a copy of the GNU General Public License
|
15 |
-
along with this program; if not, write to the Free Software
|
16 |
-
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
17 |
-
*/
|
18 |
-
|
19 |
-
if ( class_exists( 'Aihrus_Common_Interface' ) )
|
20 |
-
return;
|
21 |
-
|
22 |
-
|
23 |
-
interface Aihrus_Common_Interface {
|
24 |
-
}
|
25 |
-
|
26 |
-
|
27 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trunk/includes/libraries/aihrus-framework/interface-aihrus-licensing.php
DELETED
@@ -1,28 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
3 |
-
Copyright 2014 Michael Cannon (email: mc@aihr.us)
|
4 |
-
|
5 |
-
This program is free software; you can redistribute it and/or modify
|
6 |
-
it under the terms of the GNU General Public License, version 2, as
|
7 |
-
published by the Free Software Foundation.
|
8 |
-
|
9 |
-
This program is distributed in the hope that it will be useful,
|
10 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12 |
-
GNU General Public License for more details.
|
13 |
-
|
14 |
-
You should have received a copy of the GNU General Public License
|
15 |
-
along with this program; if not, write to the Free Software
|
16 |
-
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
17 |
-
*/
|
18 |
-
|
19 |
-
if ( class_exists( 'Aihrus_Licensing_Interface' ) )
|
20 |
-
return;
|
21 |
-
|
22 |
-
|
23 |
-
interface Aihrus_Licensing_Interface {
|
24 |
-
public function settings( $settings );
|
25 |
-
}
|
26 |
-
|
27 |
-
|
28 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trunk/includes/libraries/aihrus-framework/interface-aihrus-widget.php
DELETED
@@ -1,33 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
3 |
-
Copyright 2014 Michael Cannon (email: mc@aihr.us)
|
4 |
-
|
5 |
-
This program is free software; you can redistribute it and/or modify
|
6 |
-
it under the terms of the GNU General Public License, version 2, as
|
7 |
-
published by the Free Software Foundation.
|
8 |
-
|
9 |
-
This program is distributed in the hope that it will be useful,
|
10 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12 |
-
GNU General Public License for more details.
|
13 |
-
|
14 |
-
You should have received a copy of the GNU General Public License
|
15 |
-
along with this program; if not, write to the Free Software
|
16 |
-
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
17 |
-
*/
|
18 |
-
|
19 |
-
if ( class_exists( 'Aihrus_Widget_Interface' ) )
|
20 |
-
return;
|
21 |
-
|
22 |
-
|
23 |
-
interface Aihrus_Widget_Interface {
|
24 |
-
public static function form_instance( $instance );
|
25 |
-
public static function form_parts( $instance, $number );
|
26 |
-
public static function get_content( $instance, $widget_number );
|
27 |
-
public static function get_defaults();
|
28 |
-
public static function get_suggest( $id, $suggest_id );
|
29 |
-
public static function validate_settings( $instance );
|
30 |
-
}
|
31 |
-
|
32 |
-
|
33 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trunk/includes/libraries/aihrus-framework/requirements.php
DELETED
@@ -1,270 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
3 |
-
Copyright 2014 Michael Cannon (email: mc@aihr.us)
|
4 |
-
|
5 |
-
This program is free software; you can redistribute it and/or modify
|
6 |
-
it under the terms of the GNU General Public License, version 2, as
|
7 |
-
published by the Free Software Foundation.
|
8 |
-
|
9 |
-
This program is distributed in the hope that it will be useful,
|
10 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12 |
-
GNU General Public License for more details.
|
13 |
-
|
14 |
-
You should have received a copy of the GNU General Public License
|
15 |
-
along with this program; if not, write to the Free Software
|
16 |
-
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
17 |
-
*/
|
18 |
-
|
19 |
-
if ( ! defined( 'AIHR_BASE' ) )
|
20 |
-
define( 'AIHR_BASE', __FILE__ );
|
21 |
-
|
22 |
-
if ( ! defined( 'AIHR_VERSION' ) )
|
23 |
-
define( 'AIHR_VERSION', '1.0.4RC2' );
|
24 |
-
|
25 |
-
require_once ABSPATH . 'wp-admin/includes/plugin.php';
|
26 |
-
|
27 |
-
if ( ! function_exists( 'aihr_check_aihrus_framework' ) ) {
|
28 |
-
function aihr_check_aihrus_framework( $file = null, $name = null, $aihr_min = '1.0.0' ) {
|
29 |
-
if ( is_null( $file ) ) {
|
30 |
-
aihr_notice_error( __( '`aihr_check_aihrus_framework` requires $file argument' ) );
|
31 |
-
|
32 |
-
return false;
|
33 |
-
}
|
34 |
-
|
35 |
-
if ( ! defined( 'AIHR_VERSION' ) ) {
|
36 |
-
$check_okay = false;
|
37 |
-
} else {
|
38 |
-
$check_okay = version_compare( AIHR_VERSION, $aihr_min, '>=' );
|
39 |
-
}
|
40 |
-
|
41 |
-
$file = plugin_basename( $file );
|
42 |
-
if ( ! $check_okay && __FILE__ != $file ) {
|
43 |
-
deactivate_plugins( $file );
|
44 |
-
|
45 |
-
if ( ! defined( 'AIHR_VERSION_FILE' ) ) {
|
46 |
-
define( 'AIHR_VERSION_FILE', $file );
|
47 |
-
}
|
48 |
-
|
49 |
-
if ( ! is_null( $name ) && ! defined( 'AIHR_VERSION_NAME' ) ) {
|
50 |
-
define( 'AIHR_VERSION_NAME', $name );
|
51 |
-
}
|
52 |
-
|
53 |
-
if ( ! defined( 'AIHR_VERSION_MIN' ) ) {
|
54 |
-
define( 'AIHR_VERSION_MIN', $aihr_min );
|
55 |
-
}
|
56 |
-
|
57 |
-
add_action( 'admin_notices', 'aihr_notice_aihrus_framework' );
|
58 |
-
}
|
59 |
-
|
60 |
-
return $check_okay;
|
61 |
-
}
|
62 |
-
}
|
63 |
-
|
64 |
-
if ( ! function_exists( 'aihr_notice_aihrus_framework' ) ) {
|
65 |
-
function aihr_notice_aihrus_framework() {
|
66 |
-
if ( defined( 'AIHR_VERSION_NAME' ) ) {
|
67 |
-
$name = AIHR_VERSION_NAME;
|
68 |
-
} else {
|
69 |
-
$name = basename( dirname( AIHR_VERSION_FILE ) );
|
70 |
-
$name = str_replace( '-', ' ', $name );
|
71 |
-
$name = ucwords( $name );
|
72 |
-
}
|
73 |
-
|
74 |
-
$help_url = esc_url( 'https://aihrus.zendesk.com/entries/35689458' );
|
75 |
-
$help_link = sprintf( __( '<a href="%1$s">Update plugins</a>. <a href="%2$s">More information</a>.' ), self_admin_url( 'update-core.php' ), $help_url );
|
76 |
-
|
77 |
-
$note = '';
|
78 |
-
if ( defined( 'AIHR_BASE' ) ) {
|
79 |
-
$plugin = plugin_basename( AIHR_BASE );
|
80 |
-
$plugin = explode( '/', $plugin );
|
81 |
-
|
82 |
-
$plugin_name = $plugin[0];
|
83 |
-
$plugin_name = str_replace( '-', ' ', $plugin_name );
|
84 |
-
$plugin_name = ucwords( $plugin_name );
|
85 |
-
|
86 |
-
$note = sprintf( esc_html__( 'Plugin "%1$s" is causing the out of date issue.' ), $plugin_name );
|
87 |
-
}
|
88 |
-
|
89 |
-
$aihr_version = defined( 'AIHR_VERSION' ) ? AIHR_VERSION : '0.0.0';
|
90 |
-
|
91 |
-
$text = sprintf( esc_html__( 'Plugin "%1$s" has been deactivated as it requires Aihrus Framework %2$s or newer. You\'re running Aihrus Framework %4$s. Once corrected, "%1$s" can be activated. %5$s %3$s' ), $name, AIHR_VERSION_MIN, $help_link, $aihr_version, $note );
|
92 |
-
|
93 |
-
aihr_notice_error( $text );
|
94 |
-
}
|
95 |
-
}
|
96 |
-
|
97 |
-
if ( ! function_exists( 'aihr_check_php' ) ) {
|
98 |
-
function aihr_check_php( $file = null, $name = null, $php_min = '5.3.0' ) {
|
99 |
-
if ( is_null( $file ) ) {
|
100 |
-
aihr_notice_error( __( '`aihr_check_php` requires $file argument' ) );
|
101 |
-
|
102 |
-
return false;
|
103 |
-
}
|
104 |
-
|
105 |
-
$check_okay = version_compare( PHP_VERSION, $php_min, '>=' );
|
106 |
-
$file = plugin_basename( $file );
|
107 |
-
if ( ! $check_okay && __FILE__ != $file ) {
|
108 |
-
deactivate_plugins( $file );
|
109 |
-
|
110 |
-
if ( ! defined( 'AIHR_PHP_VERSION_FILE' ) ) {
|
111 |
-
define( 'AIHR_PHP_VERSION_FILE', $file );
|
112 |
-
}
|
113 |
-
|
114 |
-
if ( ! is_null( $name ) && ! defined( 'AIHR_PHP_VERSION_NAME' ) ) {
|
115 |
-
define( 'AIHR_PHP_VERSION_NAME', $name );
|
116 |
-
}
|
117 |
-
|
118 |
-
if ( ! defined( 'AIHR_PHP_VERSION_MIN' ) ) {
|
119 |
-
define( 'AIHR_PHP_VERSION_MIN', $php_min );
|
120 |
-
}
|
121 |
-
|
122 |
-
add_action( 'admin_notices', 'aihr_notice_php' );
|
123 |
-
}
|
124 |
-
|
125 |
-
return $check_okay;
|
126 |
-
}
|
127 |
-
}
|
128 |
-
|
129 |
-
if ( ! function_exists( 'aihr_notice_php' ) ) {
|
130 |
-
function aihr_notice_php() {
|
131 |
-
if ( defined( 'AIHR_PHP_VERSION_NAME' ) ) {
|
132 |
-
$name = AIHR_PHP_VERSION_NAME;
|
133 |
-
} else {
|
134 |
-
$name = basename( dirname( AIHR_PHP_VERSION_FILE ) );
|
135 |
-
$name = str_replace( '-', ' ', $name );
|
136 |
-
$name = ucwords( $name );
|
137 |
-
}
|
138 |
-
|
139 |
-
$help_url = esc_url( 'https://aihrus.zendesk.com/entries/30678006' );
|
140 |
-
|
141 |
-
$text = sprintf( __( 'Plugin "%1$s" has been deactivated as it requires PHP %2$s or newer. You\'re running PHP %4$s. Once corrected, "%1$s" can be activated. <a href="%3$s">More information</a>.' ), $name, AIHR_PHP_VERSION_MIN, $help_url, PHP_VERSION );
|
142 |
-
|
143 |
-
aihr_notice_error( $text );
|
144 |
-
}
|
145 |
-
}
|
146 |
-
|
147 |
-
if ( ! function_exists( 'aihr_check_wp' ) ) {
|
148 |
-
function aihr_check_wp( $file = null, $name = null, $wp_min = '3.6' ) {
|
149 |
-
if ( is_null( $file ) ) {
|
150 |
-
aihr_notice_error( __( '`aihr_check_wp` requires $file argument' ) );
|
151 |
-
|
152 |
-
return false;
|
153 |
-
}
|
154 |
-
|
155 |
-
global $wp_version;
|
156 |
-
|
157 |
-
$check_okay = version_compare( $wp_version, $wp_min, '>=' );
|
158 |
-
$file = plugin_basename( $file );
|
159 |
-
if ( ! $check_okay && __FILE__ != $file ) {
|
160 |
-
deactivate_plugins( $file );
|
161 |
-
|
162 |
-
if ( ! defined( 'AIHR_WP_VERSION_FILE' ) ) {
|
163 |
-
define( 'AIHR_WP_VERSION_FILE', $file );
|
164 |
-
}
|
165 |
-
|
166 |
-
if ( ! is_null( $name ) && ! defined( 'AIHR_WP_VERSION_NAME' ) ) {
|
167 |
-
define( 'AIHR_WP_VERSION_NAME', $name );
|
168 |
-
}
|
169 |
-
|
170 |
-
if ( ! defined( 'AIHR_WP_VERSION_MIN' ) ) {
|
171 |
-
define( 'AIHR_WP_VERSION_MIN', $wp_min );
|
172 |
-
}
|
173 |
-
|
174 |
-
add_action( 'admin_notices', 'aihr_notice_wp' );
|
175 |
-
}
|
176 |
-
|
177 |
-
return $check_okay;
|
178 |
-
}
|
179 |
-
}
|
180 |
-
|
181 |
-
if ( ! function_exists( 'aihr_notice_wp' ) ) {
|
182 |
-
function aihr_notice_wp() {
|
183 |
-
global $wp_version;
|
184 |
-
|
185 |
-
if ( defined( 'AIHR_WP_VERSION_NAME' ) ) {
|
186 |
-
$name = AIHR_WP_VERSION_NAME;
|
187 |
-
} else {
|
188 |
-
$name = basename( dirname( AIHR_WP_VERSION_FILE ) );
|
189 |
-
$name = str_replace( '-', ' ', $name );
|
190 |
-
$name = ucwords( $name );
|
191 |
-
}
|
192 |
-
|
193 |
-
$help_url = network_admin_url( 'update-core.php' );
|
194 |
-
|
195 |
-
$text = sprintf( __( 'Plugin "%1$s" has been deactivated as it requires WordPress %2$s or newer. You\'re running WordPress %4$s. Once corrected, "%1$s" can be activated. <a href="%3$s">Update WordPress</a>.' ), $name, AIHR_WP_VERSION_MIN, $help_url, $wp_version );
|
196 |
-
|
197 |
-
aihr_notice_error( $text );
|
198 |
-
}
|
199 |
-
}
|
200 |
-
|
201 |
-
if ( ! function_exists( 'aihr_notice_error' ) ) {
|
202 |
-
function aihr_notice_error( $text ) {
|
203 |
-
aihr_notice_updated( $text, 'error' );
|
204 |
-
}
|
205 |
-
}
|
206 |
-
|
207 |
-
if ( ! function_exists( 'aihr_notice_updated' ) ) {
|
208 |
-
function aihr_notice_updated( $text, $class = 'updated' ) {
|
209 |
-
if ( 'updated' == $class )
|
210 |
-
$class .= ' fade';
|
211 |
-
|
212 |
-
$content = '';
|
213 |
-
$content .= '<div class="' . $class . '"><p>';
|
214 |
-
$content .= $text;
|
215 |
-
$content .= '</p></div>';
|
216 |
-
|
217 |
-
echo $content;
|
218 |
-
}
|
219 |
-
}
|
220 |
-
|
221 |
-
if ( ! function_exists( 'aihr_notice_version' ) ) {
|
222 |
-
function aihr_notice_version( $required_base, $required_name, $required_slug, $required_version, $item_name ) {
|
223 |
-
$is_active = is_plugin_active( $required_base );
|
224 |
-
if ( $is_active )
|
225 |
-
$link = sprintf( __( '<a href="%1$s">update to</a>' ), self_admin_url( 'update-core.php' ) );
|
226 |
-
else {
|
227 |
-
$plugins = get_plugins();
|
228 |
-
if ( empty( $plugins[ $required_base ] ) ) {
|
229 |
-
$install = esc_url( wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=' . $required_slug ), 'install-plugin_' . $required_slug ) );
|
230 |
-
$link = sprintf( __( '<a href="%1$s">install</a>' ), $install );
|
231 |
-
} else {
|
232 |
-
$activate = esc_url( wp_nonce_url( admin_url( 'plugins.php?action=activate&plugin=' . $required_base ), 'activate-plugin_' . $required_base ) );
|
233 |
-
$link = sprintf( __( '<a href="%1$s">activate</a>' ), $activate );
|
234 |
-
}
|
235 |
-
}
|
236 |
-
|
237 |
-
$text = sprintf( __( 'Plugin "%3$s" has been deactivated. Please %1$s "%4$s" version %2$s or newer before activating "%3$s".' ), $link, $required_version, $item_name, $required_name );
|
238 |
-
|
239 |
-
aihr_notice_error( $text );
|
240 |
-
}
|
241 |
-
}
|
242 |
-
|
243 |
-
if ( ! function_exists( 'aihr_notice_license' ) ) {
|
244 |
-
function aihr_notice_license( $post_type, $settings_id, $free_name, $purchase_url, $item_name ) {
|
245 |
-
if ( empty( $post_type ) )
|
246 |
-
$link = get_admin_url() . 'options-general.php?page=' . $settings_id;
|
247 |
-
else
|
248 |
-
$link = get_admin_url() . 'edit.php?post_type=' . $post_type . '&page=' . $settings_id;
|
249 |
-
|
250 |
-
$text = __( '<a href="%1$s">%2$s > Settings</a>, <em>Premium</em> tab, <em>License Key</em> entry' );
|
251 |
-
|
252 |
-
$settings_link = sprintf( $text, $link, $free_name );
|
253 |
-
|
254 |
-
$link = esc_url( 'https://aihrus.zendesk.com/entries/28745227' );
|
255 |
-
$text = __( '<a href="%s">Where\'s my license key?</a>' );
|
256 |
-
|
257 |
-
$faq_link = sprintf( $text, $link );
|
258 |
-
|
259 |
-
$link = esc_url( $purchase_url );
|
260 |
-
$text = __( '<a href="%1$s">%2$s</a>' );
|
261 |
-
|
262 |
-
$buy_link = sprintf( $text, $link, $item_name );
|
263 |
-
|
264 |
-
$text = sprintf( __( 'Plugin "%1$s" requires license activation before updating will work. Please activate the license key through %2$s. No license key? See "%3$s" or purchase "%4$s".' ), $item_name, $settings_link, $faq_link, $buy_link );
|
265 |
-
|
266 |
-
aihr_notice_error( $text );
|
267 |
-
}
|
268 |
-
}
|
269 |
-
|
270 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trunk/includes/libraries/class-redrokk-metabox-class.php
DELETED
@@ -1,1436 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
*
|
4 |
-
*
|
5 |
-
* @Author Anonymous
|
6 |
-
* @link http://www.redrokk.com
|
7 |
-
* @Package Wordpress
|
8 |
-
* @SubPackage RedRokk Library
|
9 |
-
*
|
10 |
-
* @version 2.0
|
11 |
-
*/
|
12 |
-
|
13 |
-
|
14 |
-
//security
|
15 |
-
defined( 'ABSPATH' ) or die( 'You\'re not supposed to be here.' );
|
16 |
-
|
17 |
-
/**
|
18 |
-
*
|
19 |
-
*
|
20 |
-
* @author Anonymous
|
21 |
-
* @example
|
22 |
-
* $gallery = redrokk_metabox_class::getInstance('gallery');
|
23 |
-
*/
|
24 |
-
if ( !class_exists( 'redrokk_metabox_class' ) ):
|
25 |
-
class redrokk_metabox_class {
|
26 |
-
|
27 |
-
/**
|
28 |
-
* HTML 'id' attribute of the edit screen section
|
29 |
-
*
|
30 |
-
* @var string
|
31 |
-
*/
|
32 |
-
var $_id;
|
33 |
-
|
34 |
-
/**
|
35 |
-
* Save the form fields here that will be displayed to the user
|
36 |
-
*
|
37 |
-
* @var array
|
38 |
-
*/
|
39 |
-
var $_fields;
|
40 |
-
|
41 |
-
/**
|
42 |
-
* Title of the edit screen section, visible to user
|
43 |
-
* Default: None
|
44 |
-
*
|
45 |
-
* @var string
|
46 |
-
*/
|
47 |
-
var $title;
|
48 |
-
|
49 |
-
/**
|
50 |
-
* Function that prints out the HTML for the edit screen section. Pass
|
51 |
-
* function name as a string. Within a class, you can instead pass an
|
52 |
-
* array to call one of the class's methods. See the second example under
|
53 |
-
* Example below.
|
54 |
-
* Default: None
|
55 |
-
*
|
56 |
-
* @var callback
|
57 |
-
*/
|
58 |
-
var $callback = null;
|
59 |
-
|
60 |
-
/**
|
61 |
-
* The part of the page where the edit screen section should be shown
|
62 |
-
* ('normal', 'advanced', or 'side'). (Note that 'side' doesn't exist before 2.7)
|
63 |
-
* Default: 'advanced'
|
64 |
-
*
|
65 |
-
* @var string
|
66 |
-
*/
|
67 |
-
var $context = 'normal';
|
68 |
-
|
69 |
-
/**
|
70 |
-
* The priority within the context where the boxes should show
|
71 |
-
* ('high', 'core', 'default' or 'low')
|
72 |
-
* Default: 'default'
|
73 |
-
*
|
74 |
-
* @var string
|
75 |
-
*/
|
76 |
-
var $priority = 'default';
|
77 |
-
|
78 |
-
/**
|
79 |
-
* Arguments to pass into your callback function. The callback will receive the
|
80 |
-
* $post object and whatever parameters are passed through this variable.
|
81 |
-
* Default: null
|
82 |
-
*
|
83 |
-
* @var array
|
84 |
-
*/
|
85 |
-
var $callback_args;
|
86 |
-
|
87 |
-
/**
|
88 |
-
* Prebuilt metaboxes can be activated by using this type
|
89 |
-
* Default: default
|
90 |
-
*
|
91 |
-
* (options:)
|
92 |
-
* default
|
93 |
-
* images
|
94 |
-
*
|
95 |
-
* @var string
|
96 |
-
*/
|
97 |
-
var $_type;
|
98 |
-
|
99 |
-
/**
|
100 |
-
*
|
101 |
-
*
|
102 |
-
* @var unknown_type
|
103 |
-
*/
|
104 |
-
var $_category_name;
|
105 |
-
|
106 |
-
/**
|
107 |
-
* The type of Write screen on which to show the edit screen section
|
108 |
-
* ('post', 'page', 'link', or 'custom_post_type' where custom_post_type
|
109 |
-
* is the custom post type slug)
|
110 |
-
* Default: None
|
111 |
-
*
|
112 |
-
* @var array
|
113 |
-
*/
|
114 |
-
var $_object_types = array();
|
115 |
-
|
116 |
-
/**
|
117 |
-
* Whether or not to make the fields available as wp-options
|
118 |
-
*
|
119 |
-
* @var bool
|
120 |
-
*/
|
121 |
-
var $_isAdminPage = false;
|
122 |
-
|
123 |
-
|
124 |
-
/**
|
125 |
-
* Constructor.
|
126 |
-
*
|
127 |
-
*/
|
128 |
-
function __construct( $options = array() ) {
|
129 |
-
//initializing
|
130 |
-
$this->setProperties( $options );
|
131 |
-
$this->setOptionHooks();
|
132 |
-
|
133 |
-
if ( !$this->callback ) {
|
134 |
-
$this->callback = array( $this, 'show' );
|
135 |
-
}
|
136 |
-
if ( !$this->title ) {
|
137 |
-
$this->title = ucfirst( $this->_id );
|
138 |
-
}
|
139 |
-
|
140 |
-
//registering this metabox
|
141 |
-
add_action( 'add_meta_boxes', array( $this, '_register' ) );
|
142 |
-
|
143 |
-
// backwards compatible (before WP 3.0)
|
144 |
-
// add_action( 'admin_init', array($this, '_register'), 1 );
|
145 |
-
|
146 |
-
add_action( 'save_post', array( $this, '_save' ) );
|
147 |
-
add_filter( 'wp_redirect', array( $this, '_redirectIntervention' ), 40, 1 );
|
148 |
-
}
|
149 |
-
|
150 |
-
|
151 |
-
/**
|
152 |
-
* Method properly inturprets the given parameter and sets it accordingly
|
153 |
-
*
|
154 |
-
* @param string|object $value
|
155 |
-
*/
|
156 |
-
function setObjectTypes( $value ) {
|
157 |
-
if ( is_a( $value, 'redrokk_post_class' ) ) {
|
158 |
-
$value = $value->_post_type;
|
159 |
-
}
|
160 |
-
if ( is_a( $value, 'redrokk_admin_class' ) ) {
|
161 |
-
$value = $value->id;
|
162 |
-
$this->_isAdminPage = $value;
|
163 |
-
}
|
164 |
-
if ( is_array( $value ) ) {
|
165 |
-
foreach ( $value as $v )
|
166 |
-
$this->_object_types[] = $v;
|
167 |
-
return $this;
|
168 |
-
}
|
169 |
-
|
170 |
-
$this->_object_types[] = $value;
|
171 |
-
return $this;
|
172 |
-
}
|
173 |
-
|
174 |
-
|
175 |
-
/**
|
176 |
-
* Method is designed to return the currently visible post type
|
177 |
-
*/
|
178 |
-
function getCurrentPostType() {
|
179 |
-
$post_type = false;
|
180 |
-
if ( isset( $_REQUEST['post_type'] ) ) {
|
181 |
-
$post_type = $_REQUEST['post_type'];
|
182 |
-
}
|
183 |
-
elseif ( isset( $_REQUEST['post'] ) ) {
|
184 |
-
$post = get_post( $_REQUEST['post'] );
|
185 |
-
$post_type = $post->post_type;
|
186 |
-
}
|
187 |
-
elseif ( isset( $_REQUEST['page'] ) ) {
|
188 |
-
$post_type = $_REQUEST['page'];
|
189 |
-
}
|
190 |
-
|
191 |
-
return $post_type;
|
192 |
-
}
|
193 |
-
|
194 |
-
|
195 |
-
/**
|
196 |
-
* Method properly prepares the metabox type by binding the necessary hooks
|
197 |
-
*
|
198 |
-
* @param mixed $value
|
199 |
-
*/
|
200 |
-
function settype( $value = 'default' ) {
|
201 |
-
$this->_type = $value;
|
202 |
-
|
203 |
-
switch ( $this->_type ) {
|
204 |
-
default:
|
205 |
-
case 'default':
|
206 |
-
add_action( 'metabox-show-'.$this->_id, array( $this, '_renderForm' ), 20, 1 );
|
207 |
-
add_action( 'metabox-save-'.$this->_id, array( $this, 'saveAsPostMeta' ), 10, 2 );
|
208 |
-
break;
|
209 |
-
case 'image':
|
210 |
-
case 'images':
|
211 |
-
$this->_fields = array(
|
212 |
-
array(
|
213 |
-
'name' => 'New Image',
|
214 |
-
'type' => 'title',
|
215 |
-
),
|
216 |
-
array(
|
217 |
-
'name' => 'Image Title',
|
218 |
-
'id' => $this->_id.'_post_title',
|
219 |
-
'type' => 'text',
|
220 |
-
),
|
221 |
-
array(
|
222 |
-
'name' => 'Description',
|
223 |
-
'id' => $this->_id.'_post_content',
|
224 |
-
'type' => 'textarea',
|
225 |
-
),
|
226 |
-
array(
|
227 |
-
'name' => 'Image File',
|
228 |
-
'id' => $this->_id.'_image',
|
229 |
-
'type' => 'image',
|
230 |
-
),
|
231 |
-
array(
|
232 |
-
'name' => 'Save Image',
|
233 |
-
'type' => 'submit',
|
234 |
-
),
|
235 |
-
);
|
236 |
-
add_action( 'metabox-show-'.$this->_id, array( $this, '_renderListImageAttachments' ), 20, 1 );
|
237 |
-
add_action( 'metabox-show-'.$this->_id, array( $this, '_renderForm' ), 20, 1 );
|
238 |
-
add_action( 'metabox-save-'.$this->_id, array( $this, 'saveAsAttachment' ), 1, 2 );
|
239 |
-
break;
|
240 |
-
case 'video':
|
241 |
-
case 'videos':
|
242 |
-
$this->_fields = array(
|
243 |
-
array(
|
244 |
-
'name' => 'New Video',
|
245 |
-
'type' => 'title',
|
246 |
-
),
|
247 |
-
array(
|
248 |
-
'name' => 'Video Title',
|
249 |
-
'id' => $this->_id.'_post_title',
|
250 |
-
'type' => 'text',
|
251 |
-
),
|
252 |
-
array(
|
253 |
-
'name' => 'Description',
|
254 |
-
'id' => $this->_id.'_post_content',
|
255 |
-
'type' => 'textarea',
|
256 |
-
),
|
257 |
-
array(
|
258 |
-
'name' => 'Video File',
|
259 |
-
'id' => $this->_id.'_image',
|
260 |
-
'type' => 'image',
|
261 |
-
),
|
262 |
-
array(
|
263 |
-
'name' => 'Video Link',
|
264 |
-
'id' => $this->_id.'_link',
|
265 |
-
'type' => 'text',
|
266 |
-
),
|
267 |
-
array(
|
268 |
-
'name' => '_videocat',
|
269 |
-
'id' => $this->_id.'_videocat',
|
270 |
-
'default'=>$this->getCategory(),
|
271 |
-
'type' => 'hidden',
|
272 |
-
),
|
273 |
-
array(
|
274 |
-
'name' => '_metaid',
|
275 |
-
'id' => $this->_id.'_metaid',
|
276 |
-
'type' => 'hidden',
|
277 |
-
),
|
278 |
-
array(
|
279 |
-
'name' => 'Save Video',
|
280 |
-
'type' => 'submit',
|
281 |
-
),
|
282 |
-
);
|
283 |
-
add_action( 'metabox-show-'.$this->_id, array( $this, '_renderListAttachments' ), 20, 1 );
|
284 |
-
add_action( 'metabox-show-'.$this->_id, array( $this, '_renderListVideoAttachments' ), 20, 1 );
|
285 |
-
add_action( 'metabox-show-'.$this->_id, array( $this, '_renderForm' ), 20, 1 );
|
286 |
-
add_action( 'metabox-save-'.$this->_id, array( $this, 'saveAsPostMeta' ), 1, 2 );
|
287 |
-
break;
|
288 |
-
}
|
289 |
-
}
|
290 |
-
|
291 |
-
|
292 |
-
/**
|
293 |
-
* Returns the category to use
|
294 |
-
*/
|
295 |
-
function getCategory() {
|
296 |
-
return isset( $this->_category_name )
|
297 |
-
? $this->_category_name
|
298 |
-
: '_videocat';
|
299 |
-
}
|
300 |
-
|
301 |
-
|
302 |
-
/**
|
303 |
-
* Method will save the posted content as an image attachment
|
304 |
-
*
|
305 |
-
*/
|
306 |
-
function saveAsAttachment( $source, $post_id ) {
|
307 |
-
if ( empty( $_FILES ) || !isset( $_REQUEST[$this->_id.'files'] ) ) return $source;
|
308 |
-
|
309 |
-
// initializing
|
310 |
-
$property = $_REQUEST[$this->_id.'files'];
|
311 |
-
$post_data = array();
|
312 |
-
|
313 |
-
if ( isset( $source[$this->_id.'_post_title'] ) && $source[$this->_id.'_post_title'] ) {
|
314 |
-
$post_data['post_title'] = $source[$this->_id.'_post_title'];
|
315 |
-
}
|
316 |
-
|
317 |
-
if ( isset( $source[$this->_id.'_post_content'] ) && $source[$this->_id.'_post_content'] ) {
|
318 |
-
$post_data['post_content'] = $source[$this->_id.'_post_content'];
|
319 |
-
}
|
320 |
-
|
321 |
-
$id = media_handle_upload( $property, $post_id, $post_data );
|
322 |
-
$source[$property] = $id;
|
323 |
-
|
324 |
-
$type = 'post';
|
325 |
-
if ( $this->getCurrentPostType() ) {
|
326 |
-
$type = $this->getCurrentPostType();
|
327 |
-
}
|
328 |
-
|
329 |
-
//saving the attachment ID to the taxonomy
|
330 |
-
if ( !in_array( $type, get_post_types( array( 'public' => false ) ) ) ) {
|
331 |
-
$old = get_metadata( $type, $post_id, $property, true );
|
332 |
-
if ( $id && $id != $old ) {
|
333 |
-
wp_delete_attachment( $old, true );
|
334 |
-
update_metadata( $type, $post_id, $property, $id );
|
335 |
-
}
|
336 |
-
}
|
337 |
-
|
338 |
-
foreach ( (array)$source as $property => $new ) {
|
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 |
-
/**
|
360 |
-
* Method saves the data provided as post meta values
|
361 |
-
*
|
362 |
-
* @param array $source
|
363 |
-
* @param integer $post_id
|
364 |
-
*/
|
365 |
-
function saveAsPostMeta( $source, $post_id ) {
|
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 |
-
//skip everything but the specially prefixed
|
389 |
-
if ( strpos( $property, $this->_id ) !== 0 ) continue;
|
390 |
-
|
391 |
-
//each meta set has it's own ID
|
392 |
-
$property = str_replace( $this->_id, $this->_category_name.'_'.$id, $property );
|
393 |
-
|
394 |
-
$old = get_metadata( $type, $post_id, $property, true );
|
395 |
-
if ( $new && $new != $old ) {
|
396 |
-
update_metadata( $type, $post_id, $property, $new );
|
397 |
-
}
|
398 |
-
elseif ( !$new ) {
|
399 |
-
delete_metadata( $type, $post_id, $property, $old );
|
400 |
-
}
|
401 |
-
}
|
402 |
-
|
403 |
-
// maybe there's a last id
|
404 |
-
if ( !$id ) {
|
405 |
-
if ( !$id = get_metadata( $type, $post_id, '_metaidlast', true ) ) {
|
406 |
-
$id = 0;
|
407 |
-
}
|
408 |
-
$id++;
|
409 |
-
update_metadata( $type, $post_id, '_metaidlast', $id );
|
410 |
-
}
|
411 |
-
|
412 |
-
// saving all of the standard items
|
413 |
-
foreach ( (array)$source as $property => $new ) {
|
414 |
-
//skip special properties that are prefixed with the id
|
415 |
-
if ( strpos( $property, $this->_id ) === 0 ) continue;
|
416 |
-
|
417 |
-
$old = get_metadata( $type, $post_id, $property, true );
|
418 |
-
update_metadata( $type, $post_id, $property, $new );
|
419 |
-
|
420 |
-
// if ($new && $new != $old) {
|
421 |
-
// update_metadata($type, $post_id, $property, $new);
|
422 |
-
// }
|
423 |
-
// elseif (!$new) {
|
424 |
-
// delete_metadata($type, $post_id, $property, $old);
|
425 |
-
// }
|
426 |
-
|
427 |
-
}
|
428 |
-
|
429 |
-
return true;
|
430 |
-
}
|
431 |
-
|
432 |
-
|
433 |
-
/**
|
434 |
-
* Do something with the data entered
|
435 |
-
*
|
436 |
-
* @param integer $post_id
|
437 |
-
*/
|
438 |
-
function _save( $post_id ) {
|
439 |
-
//initializing
|
440 |
-
$post = get_post( $post_id );
|
441 |
-
|
442 |
-
// verify if this is an auto save routine.
|
443 |
-
// If it is our form has not been submitted, so we dont want to do anything
|
444 |
-
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
|
445 |
-
return;
|
446 |
-
|
447 |
-
// verify this came from the our screen and with proper authorization,
|
448 |
-
// because save_post can be triggered at other times
|
449 |
-
if ( !isset( $_REQUEST[ get_class().$this->_id ] ) )
|
450 |
-
return;
|
451 |
-
|
452 |
-
if ( !wp_verify_nonce( $_REQUEST[ get_class().$this->_id ], plugin_basename( __FILE__ ) ) )
|
453 |
-
return;
|
454 |
-
|
455 |
-
// this metabox is to be displayed for a certain object type only
|
456 |
-
if ( !in_array( $post->post_type, $this->_object_types ) )
|
457 |
-
return;
|
458 |
-
|
459 |
-
// Check permissions
|
460 |
-
if ( 'page' == $post->post_type ) {
|
461 |
-
if ( !current_user_can( 'edit_page', $post->ID ) )
|
462 |
-
return;
|
463 |
-
}
|
464 |
-
else {
|
465 |
-
if ( !current_user_can( 'edit_post', $post->ID ) )
|
466 |
-
return;
|
467 |
-
}
|
468 |
-
|
469 |
-
//saving the request data
|
470 |
-
if ( !$this->_type ) $this->setType();
|
471 |
-
do_action( 'metabox-save-'.$this->_id, $this->getRequestPostMetas(), $post->ID, $this );
|
472 |
-
return true;
|
473 |
-
}
|
474 |
-
|
475 |
-
|
476 |
-
/**
|
477 |
-
* Method returns the post meta
|
478 |
-
*
|
479 |
-
*/
|
480 |
-
function getRequestPostMetas() {
|
481 |
-
$ignores = array( 'post_title', 'post_name', 'post_content', 'post_excerpt', 'post',
|
482 |
-
'post_status', 'post_type', 'post_author', 'ping_status', 'post_parent', 'message',
|
483 |
-
'post_category', 'comment_status', 'menu_order', 'to_ping', 'pinged', 'post_password',
|
484 |
-
'guid', 'post_content_filtered', 'import_id', 'post_date', 'post_date_gmt', 'tags_input',
|
485 |
-
'action' );
|
486 |
-
|
487 |
-
$fields = array();
|
488 |
-
foreach ( (array)$this->_fields as $field ) {
|
489 |
-
if ( !array_key_exists( 'id', $field ) ) continue;
|
490 |
-
$fields[] = $field['id'];
|
491 |
-
}
|
492 |
-
|
493 |
-
$requests = $_REQUEST;
|
494 |
-
foreach ( (array)$requests as $k => $request ) {
|
495 |
-
if ( ( !empty( $fields ) && !in_array( $k, $fields ) )
|
496 |
-
|| ( in_array( $k, $ignores ) || strpos( $k, 'nounce' ) !== false ) ) {
|
497 |
-
unset( $requests[$k] );
|
498 |
-
}
|
499 |
-
}
|
500 |
-
|
501 |
-
return apply_filters( 'metabox-requests-'.$this->_id, $requests );
|
502 |
-
}
|
503 |
-
|
504 |
-
|
505 |
-
/**
|
506 |
-
* Display the inner contents of the metabox
|
507 |
-
*
|
508 |
-
* @param object $post
|
509 |
-
*/
|
510 |
-
function show( $post ) {
|
511 |
-
// Use nonce for verification
|
512 |
-
wp_nonce_field( plugin_basename( __FILE__ ), get_class().$this->_id );
|
513 |
-
do_action( 'metabox-show-'.$this->_id, $this->_fields, $this );
|
514 |
-
}
|
515 |
-
|
516 |
-
|
517 |
-
/**
|
518 |
-
* Method displays a list of attached images
|
519 |
-
*
|
520 |
-
*/
|
521 |
-
function _renderListImageAttachments() {
|
522 |
-
global $post, $current_screen;
|
523 |
-
$images = get_children( "post_parent=$post->ID&post_type=attachment&post_mime_type=image" );
|
524 |
-
|
525 |
-
// no images to render
|
526 |
-
if ( empty( $images ) ) {
|
527 |
-
?><p>No images have been saved.</p><?php
|
528 |
-
|
529 |
-
// rendering the images
|
530 |
-
} else {
|
531 |
-
|
532 |
-
?>
|
533 |
-
<table class="wp-list-table form-table widefat" style="border:none;">
|
534 |
-
<?php foreach ( (array)$images as $post_id => $image ): ?>
|
535 |
-
<?php $image_attributes = wp_get_attachment_image_src( $image->ID, 'thumbnail' ); ?>
|
536 |
-
<tbody id="the-list">
|
537 |
-
<tr>
|
538 |
-
<th scope="row" style="width: 140px">
|
539 |
-
<div style="padding:10px;background:whiteSmoke;">
|
540 |
-
<img src="<?php echo wp_get_attachment_thumb_url( $image->ID ); ?>" /></div>
|
541 |
-
</th>
|
542 |
-
<td>
|
543 |
-
<b><?php echo $image->post_title; ?></b>
|
544 |
-
<p><?php echo get_the_content( $image->ID ); ?></p>
|
545 |
-
|
546 |
-
<div class="row-actions">
|
547 |
-
<span class="inline">
|
548 |
-
<a href="<?php echo wp_nonce_url(
|
549 |
-
"media.php?attachment_id=$image->ID"
|
550 |
-
."&action=edit&_redirect="
|
551 |
-
.urlencode( $this->_currentPageURL() )
|
552 |
-
); ?>">
|
553 |
-
Edit</a> |
|
554 |
-
</span>
|
555 |
-
<span class="trash">
|
556 |
-
<a class="submitdelete"
|
557 |
-
onclick="return showNotice.warn();"
|
558 |
-
href="<?php echo wp_nonce_url(
|
559 |
-
"post.php?action=delete&_redirect="
|
560 |
-
.urlencode( $this->_currentPageURL() )
|
561 |
-
."&post=$image->ID",
|
562 |
-
'delete-attachment_' . $image->ID ); ?>">
|
563 |
-
Delete Permanently</a> |
|
564 |
-
</span>
|
565 |
-
<span class="inline">
|
566 |
-
<a target="_blank"
|
567 |
-
href="<?php echo get_attachment_link( $image->ID ); ?>">
|
568 |
-
View</a>
|
569 |
-
</span>
|
570 |
-
</div>
|
571 |
-
</td>
|
572 |
-
</tr>
|
573 |
-
</tbody>
|
574 |
-
<?php endforeach; ?>
|
575 |
-
</table>
|
576 |
-
<?php
|
577 |
-
}
|
578 |
-
return;
|
579 |
-
}
|
580 |
-
|
581 |
-
|
582 |
-
/**
|
583 |
-
* Return a clean list of meta listings created by this system
|
584 |
-
*
|
585 |
-
* @param string $category
|
586 |
-
* $param object $post
|
587 |
-
*/
|
588 |
-
public static function getMetaListings( $category, $post = null ) {
|
589 |
-
// initializing
|
590 |
-
if ( $post === NULL ) {
|
591 |
-
global $post;
|
592 |
-
}
|
593 |
-
$custom = get_post_custom( $post->ID );
|
594 |
-
$return = array();
|
595 |
-
|
596 |
-
//looping all values to build our return array
|
597 |
-
foreach ( (array)$custom as $property => $value ) {
|
598 |
-
$parts = explode( '_', $property );
|
599 |
-
if ( !isset( $parts[0] ) || !isset( $parts[1] ) || !isset( $parts[2] ) ) continue;
|
600 |
-
if ( $parts[0] != $category ) continue;
|
601 |
-
|
602 |
-
$pro = str_replace( $parts[0].'_'.$parts[1].'_', '', $property );
|
603 |
-
$return[$parts[1]][$pro] = $value;
|
604 |
-
}
|
605 |
-
|
606 |
-
return $return;
|
607 |
-
}
|
608 |
-
|
609 |
-
|
610 |
-
/**
|
611 |
-
* Function removes a specific category meta
|
612 |
-
*
|
613 |
-
* @param string $category
|
614 |
-
* $param string $meta_id
|
615 |
-
* $param object $post
|
616 |
-
*/
|
617 |
-
public static function deleteMetaListing( $category, $meta_id, $post = null ) {
|
618 |
-
// initializing
|
619 |
-
if ( $post === NULL ) {
|
620 |
-
global $post;
|
621 |
-
}
|
622 |
-
$listings = redrokk_metabox_class::getMetaListings( $category, $post );
|
623 |
-
if ( !isset( $listings[$meta_id] ) ) return false;
|
624 |
-
|
625 |
-
$type = 'post';
|
626 |
-
|
627 |
-
foreach ( (array)$listings[$meta_id] as $property => $value ) {
|
628 |
-
$pro = $category.'_'.$meta_id.'_'.$property;
|
629 |
-
delete_metadata( $type, $post->ID, $pro, $value[0] );
|
630 |
-
}
|
631 |
-
return true;
|
632 |
-
}
|
633 |
-
|
634 |
-
|
635 |
-
/**
|
636 |
-
* Method displays a list of meta attachments
|
637 |
-
*
|
638 |
-
*/
|
639 |
-
function _renderListAttachments() {
|
640 |
-
global $post;
|
641 |
-
|
642 |
-
//delete action prior to pulling new listings
|
643 |
-
if ( isset( $_REQUEST['redrokkdelete'] ) && $_REQUEST['redrokkdelete'] ) {
|
644 |
-
redrokk_metabox_class::deleteMetaListing( $this->_category_name, $_REQUEST['redrokkdelete'], $post );
|
645 |
-
}
|
646 |
-
|
647 |
-
//pull new listings
|
648 |
-
$metaListings = redrokk_metabox_class::getMetaListings( $this->_category_name, $post );
|
649 |
-
|
650 |
-
if ( !empty( $metaListings ) ) {
|
651 |
-
?>
|
652 |
-
<table class="wp-list-table form-table widefat" style="border:none;">
|
653 |
-
<tbody id="the-list">
|
654 |
-
<?php foreach ( (array)$metaListings as $meta_id => $video ): ?>
|
655 |
-
<?php $video = apply_filters( 'redrokk_metabox_class::_renderListAttachments', $video, $meta_id );?>
|
656 |
-
|
657 |
-
<tr id="<?php echo $this->_category_name; ?>_<?php echo $meta_id; ?>">
|
658 |
-
<th scope="row" style="width: 140px">
|
659 |
-
<div style="padding:10px;background:whiteSmoke;">
|
660 |
-
<?php if ( isset( $video['link'] ) ) echo apply_filters( 'the_content', $video['link'][0] ); ?>
|
661 |
-
</div>
|
662 |
-
</th>
|
663 |
-
<td>
|
664 |
-
<b><?php if ( isset( $video['post_title'] ) ) echo $video['post_title'][0]; ?></b>
|
665 |
-
<p><?php if ( isset( $video['post_content'] ) ) echo $video['post_content'][0]; ?></p>
|
666 |
-
|
667 |
-
<div class="row-actions">
|
668 |
-
<span class="inline">
|
669 |
-
<a href="#" id="edit_<?php echo $this->_category_name; ?>_<?php echo $meta_id; ?>">
|
670 |
-
Edit</a> |
|
671 |
-
</span>
|
672 |
-
<span class="trash">
|
673 |
-
<a class="submitdelete"
|
674 |
-
onclick="return showNotice.warn();"
|
675 |
-
href="<?php echo site_url( "wp-admin/post.php?post={$post->ID}"
|
676 |
-
."&action=edit"
|
677 |
-
."&redrokkdelete=$meta_id"
|
678 |
-
); ?>">
|
679 |
-
Delete Permanently</a>
|
680 |
-
</span>
|
681 |
-
</div>
|
682 |
-
<script>
|
683 |
-
jQuery('#edit_<?php echo $this->_category_name; ?>_<?php echo $meta_id; ?>').click(function(){
|
684 |
-
var data = {
|
685 |
-
<?php
|
686 |
-
$data = array();
|
687 |
-
|
688 |
-
//making sure all fields will be cleared
|
689 |
-
foreach ( (array)$this->_fields as $field ) {
|
690 |
-
if ( !isset( $field['id'] ) || !isset( $field['type'] ) ) continue;
|
691 |
-
if ( !in_array( $field['type'], array( 'text', 'file', 'image', 'textarea', 'hidden' ) ) )
|
692 |
-
continue;
|
693 |
-
|
694 |
-
$id = str_replace( $this->_id.'_', '', $field['id'] );
|
695 |
-
$data[$id] = "'$id':''";
|
696 |
-
}
|
697 |
-
|
698 |
-
//adding our values to the array
|
699 |
-
foreach ( (array)$video as $vp => $vv ) {
|
700 |
-
if ( isset( $vv[0] ) ) $vv = $vv[0];
|
701 |
-
$data[$vp] = "'$vp':'$vv'";
|
702 |
-
}
|
703 |
-
|
704 |
-
//adding the meta ID to the array
|
705 |
-
$data[$id] = "'metaid':'$meta_id'";
|
706 |
-
|
707 |
-
echo implode( ',', $data );
|
708 |
-
?>
|
709 |
-
};
|
710 |
-
|
711 |
-
jQuery.each(data, function(key, value){
|
712 |
-
jQuery('#<?php echo $this->_id; ?>_'+key).val( value );
|
713 |
-
});
|
714 |
-
return false;
|
715 |
-
});
|
716 |
-
</script>
|
717 |
-
</td>
|
718 |
-
<?php do_action( 'redrokk_metabox_class::_renderListAttachments::rows', $video, $meta_id, $this ); ?>
|
719 |
-
</tr>
|
720 |
-
<?php endforeach; ?>
|
721 |
-
</tbody>
|
722 |
-
</table>
|
723 |
-
<?php
|
724 |
-
}
|
725 |
-
|
726 |
-
}
|
727 |
-
|
728 |
-
|
729 |
-
/**
|
730 |
-
* Method displays a list of attached videos
|
731 |
-
*
|
732 |
-
*/
|
733 |
-
function _renderListVideoAttachments() {
|
734 |
-
global $post;
|
735 |
-
|
736 |
-
//pull new listings
|
737 |
-
$videos = get_children( "post_parent=$post->ID&post_type=attachment&post_mime_type=video/mp4" );
|
738 |
-
|
739 |
-
// no images to render
|
740 |
-
if ( !empty( $videos ) ) {
|
741 |
-
?>
|
742 |
-
<table class="wp-list-table form-table widefat" style="border:none;">
|
743 |
-
<tbody id="the-list">
|
744 |
-
<?php foreach ( (array)$videos as $post_id => $video ): ?>
|
745 |
-
<?php $image_attributes = wp_get_attachment_link( $video->ID ); ?>
|
746 |
-
<tr>
|
747 |
-
<th scope="row" style="width: 140px">
|
748 |
-
<div style="padding:10px;background:whiteSmoke;">
|
749 |
-
<?php echo $image_attributes; ?>
|
750 |
-
</div>
|
751 |
-
</th>
|
752 |
-
<td>
|
753 |
-
<b><?php echo $video->post_title; ?></b>
|
754 |
-
<p><?php echo get_the_content( $video->ID ); ?></p>
|
755 |
-
|
756 |
-
<div class="row-actions">
|
757 |
-
<span class="inline">
|
758 |
-
<a href="<?php echo wp_nonce_url(
|
759 |
-
"media.php?attachment_id=$meta_id"
|
760 |
-
."&action=edit&_redirect="
|
761 |
-
.urlencode( $this->_currentPageURL() )
|
762 |
-
); ?>">
|
763 |
-
Edit</a> |
|
764 |
-
</span>
|
765 |
-
<span class="trash">
|
766 |
-
<a class="submitdelete"
|
767 |
-
onclick="return showNotice.warn();"
|
768 |
-
href="<?php echo wp_nonce_url(
|
769 |
-
"post.php?action=delete&_redirect="
|
770 |
-
.urlencode( $this->_currentPageURL() )
|
771 |
-
."&post=$video->ID",
|
772 |
-
'delete-attachment_' . $video->ID ); ?>">
|
773 |
-
Delete Permanently</a>
|
774 |
-
</span>
|
775 |
-
</div>
|
776 |
-
</td>
|
777 |
-
</tr>
|
778 |
-
<?php endforeach; ?>
|
779 |
-
</tbody>
|
780 |
-
</table>
|
781 |
-
<?php
|
782 |
-
}
|
783 |
-
}
|
784 |
-
|
785 |
-
|
786 |
-
/**
|
787 |
-
* Method renders the form from any source
|
788 |
-
*
|
789 |
-
* @param array $fields
|
790 |
-
*/
|
791 |
-
function _renderForm( $fields = array() ) {
|
792 |
-
//initializing
|
793 |
-
global $post;
|
794 |
-
$defaults = array(
|
795 |
-
'name' => '',
|
796 |
-
'desc' => '',
|
797 |
-
'id' => '',
|
798 |
-
'type' => 'text',
|
799 |
-
'options' => array(),
|
800 |
-
'default' => '',
|
801 |
-
'value' => '',
|
802 |
-
'class' => '',
|
803 |
-
'multiple' => '',
|
804 |
-
'args' => array(
|
805 |
-
'hide_empty' => 0,
|
806 |
-
'name' => 'element_name',
|
807 |
-
'hierarchical' => true
|
808 |
-
),
|
809 |
-
'attributes' => ''
|
810 |
-
);
|
811 |
-
|
812 |
-
// no fields to render
|
813 |
-
if ( empty( $fields ) ) {
|
814 |
-
?>
|
815 |
-
<p>No form fields have been defined. Use <pre>
|
816 |
-
$metabox->set('_fields', array(
|
817 |
-
array(
|
818 |
-
'name' => 'Title',
|
819 |
-
'type' => 'title',
|
820 |
-
),
|
821 |
-
array(
|
822 |
-
'name' => 'Title',
|
823 |
-
'desc' => '',
|
824 |
-
'id' => 'title',
|
825 |
-
'type' => 'text',
|
826 |
-
'std' => ''
|
827 |
-
),
|
828 |
-
array(
|
829 |
-
'name' => 'image',
|
830 |
-
'desc' => '',
|
831 |
-
'id' => 'imagefile',
|
832 |
-
'type' => 'image',
|
833 |
-
'std' => ''
|
834 |
-
),
|
835 |
-
array(
|
836 |
-
'name' => 'Textarea',
|
837 |
-
'desc' => 'Enter big text here',
|
838 |
-
'id' => 'textarea_id',
|
839 |
-
'type' => 'textarea',
|
840 |
-
'std' => 'Default value 2'
|
841 |
-
),
|
842 |
-
array(
|
843 |
-
'name' => 'Select box',
|
844 |
-
'id' => 'select_id',
|
845 |
-
'type' => 'select',
|
846 |
-
'options'=> array(
|
847 |
-
'value1' => 'Value 1',
|
848 |
-
'value2' => 'Value 2',
|
849 |
-
'value3' => 'Value 3',
|
850 |
-
'value4' => 'Value 4',
|
851 |
-
)
|
852 |
-
),
|
853 |
-
array(
|
854 |
-
'name' => 'Radio',
|
855 |
-
'id' => 'radio_id',
|
856 |
-
'type' => 'radio',
|
857 |
-
'value' => 'test',
|
858 |
-
'desc' => 'Check this box if you want its value saved',
|
859 |
-
),
|
860 |
-
array(
|
861 |
-
'name' => '',
|
862 |
-
'id' => 'radio_id',
|
863 |
-
'type' => 'radio',
|
864 |
-
'value' => 'test2',
|
865 |
-
'desc' => 'Check this box if you want its value saved',
|
866 |
-
),
|
867 |
-
array(
|
868 |
-
'name' => 'Checkbox',
|
869 |
-
'id' => 'checkbox_id',
|
870 |
-
'type' => 'checkbox',
|
871 |
-
'desc' => 'Check this box if you want its value saved',
|
872 |
-
),
|
873 |
-
));</pre>
|
874 |
-
</p>
|
875 |
-
<?php
|
876 |
-
|
877 |
-
// rendering the fields
|
878 |
-
} else {
|
879 |
-
?>
|
880 |
-
<table class="form-table">
|
881 |
-
<?php
|
882 |
-
// do_action("{$this->_class}_before");
|
883 |
-
$custom = get_post_custom( $this->_id );
|
884 |
-
|
885 |
-
foreach ( (array)$fields as $field ):
|
886 |
-
$field = wp_parse_args( $field, $defaults );
|
887 |
-
$field['args'] = wp_parse_args( $field['args'], $defaults['args'] );
|
888 |
-
|
889 |
-
extract( $field );
|
890 |
-
$field['args']['name'] = $element_name = $id;
|
891 |
-
|
892 |
-
// grabbing the meta value
|
893 |
-
if ( array_key_exists( $id, $custom ) ) {
|
894 |
-
if ( isset( $custom[$id][0] ) )
|
895 |
-
$meta = esc_attr( $custom[$id][0] );
|
896 |
-
else
|
897 |
-
$meta = esc_attr( $custom[$id] );
|
898 |
-
} else {
|
899 |
-
$meta = $default;
|
900 |
-
}
|
901 |
-
|
902 |
-
$id = sanitize_title( $id );
|
903 |
-
|
904 |
-
if ( array_key_exists( 'deleteattachment', $_GET )
|
905 |
-
&& $id == $_GET['fileproperty']
|
906 |
-
&& $meta == $_GET['deleteattachment'] ) {
|
907 |
-
wp_delete_attachment( $_GET['deleteattachment'], $force_delete = true );
|
908 |
-
update_post_meta( $post->ID, $id, '' );
|
909 |
-
}
|
910 |
-
?>
|
911 |
-
<?php switch ( $type ) { default: ?>
|
912 |
-
<?php if ( is_callable( $type ) && function_exists( $type ) ) : ?>
|
913 |
-
<tr>
|
914 |
-
<th scope="row" style="width: 140px">
|
915 |
-
<label for="<?php echo $id; ?>"><?php echo $name; ?></label>
|
916 |
-
</th>
|
917 |
-
<td>
|
918 |
-
<?php call_user_func( $type, $args ); ?>
|
919 |
-
<span class="description"><?php echo $desc; ?></span>
|
920 |
-
</td>
|
921 |
-
</tr>
|
922 |
-
<?php break; endif; ?>
|
923 |
-
<?php case 'text': ?>
|
924 |
-
<tr>
|
925 |
-
<th scope="row" style="width: 140px">
|
926 |
-
<label for="<?php echo $id; ?>"><?php echo $name; ?></label>
|
927 |
-
</th>
|
928 |
-
<td>
|
929 |
-
<input <?php echo $attributes ?>
|
930 |
-
id="<?php echo $id; ?>"
|
931 |
-
value="<?php echo $meta; ?>"
|
932 |
-
type="<?php echo $type; ?>"
|
933 |
-
name="<?php echo $id; ?>"
|
934 |
-
class="text large-text <?php echo $class; ?>" />
|
935 |
-
<span class="description"><?php echo $desc; ?></span>
|
936 |
-
</td>
|
937 |
-
</tr>
|
938 |
-
<?php break; ?>
|
939 |
-
<?php case 'submit': ?>
|
940 |
-
<?php case 'button': ?>
|
941 |
-
<tr>
|
942 |
-
<td colspan="2">
|
943 |
-
<input <?php echo $attributes ?>
|
944 |
-
id="<?php echo $id; ?>"
|
945 |
-
value="<?php echo $name; ?>"
|
946 |
-
type="submit"
|
947 |
-
name="submit"
|
948 |
-
class="button-primary <?php echo $class; ?>" />
|
949 |
-
<span class="description"><?php echo $desc; ?></span>
|
950 |
-
</td>
|
951 |
-
</tr>
|
952 |
-
<?php break; ?>
|
953 |
-
<?php case 'file': ?>
|
954 |
-
<?php case 'image': ?>
|
955 |
-
<tr>
|
956 |
-
<th scope="row" style="width: 140px">
|
957 |
-
<label for="<?php echo $id; ?>"><?php echo $name; ?></label>
|
958 |
-
</th>
|
959 |
-
<td>
|
960 |
-
<?php if ( $meta && wp_get_attachment_url( $meta ) ): ?>
|
961 |
-
<?php echo wp_get_attachment_image( $meta ); ?>
|
962 |
-
<span><a href="<?php echo add_query_arg( 'fileproperty', $id, add_query_arg( 'deleteattachment', $meta, $this->_currentPageURL() ) ); ?>">Delete Image</a></span>
|
963 |
-
<?php else: ?>
|
964 |
-
<input type="hidden" name="<?php echo $this->_id; ?>files" value="<?php echo $id; ?>" />
|
965 |
-
<!-- first hidden input forces this item to be submitted when it is not checked -->
|
966 |
-
<input <?php echo $attributes ?>
|
967 |
-
id="<?php echo $id; ?>"
|
968 |
-
type="file"
|
969 |
-
name="<?php echo $id; ?>"
|
970 |
-
onChange="jQuery(this).closest('form').attr('enctype', 'multipart/form-data');"
|
971 |
-
class="<?php echo $class; ?>" />
|
972 |
-
<?php endif; ?>
|
973 |
-
<span class="description"><?php echo $desc; ?></span>
|
974 |
-
</td>
|
975 |
-
</tr>
|
976 |
-
<?php break; ?>
|
977 |
-
<?php case 'title': ?>
|
978 |
-
<tr>
|
979 |
-
<th colspan="2" scope="row">
|
980 |
-
<h3 <?php echo $attributes ?> style="border: 1px solid #ddd;
|
981 |
-
padding: 10px;
|
982 |
-
background: #eee;
|
983 |
-
border-radius: 2px;
|
984 |
-
color: #666;
|
985 |
-
margin: 0;"><?php echo $name; ?>
|
986 |
-
</h3>
|
987 |
-
</th>
|
988 |
-
</tr>
|
989 |
-
<?php break; ?>
|
990 |
-
<?php case 'checkbox': ?>
|
991 |
-
<tr>
|
992 |
-
<th scope="row" style="width: 140px">
|
993 |
-
<label for="<?php echo $id; ?>"><?php echo $name; ?></label>
|
994 |
-
</th>
|
995 |
-
<td>
|
996 |
-
<input type="hidden" name="<?php echo $id; ?>" value="" />
|
997 |
-
<!-- first hidden input forces this item to be submitted when it is not checked -->
|
998 |
-
|
999 |
-
<?php foreach ( (array)$options as $_value => $_name ): ?>
|
1000 |
-
<input value="<?php echo $_value; ?>" type="checkbox" <?php echo $attributes ?>
|
1001 |
-
name="<?php echo $element_name; ?>" id="<?php echo $id; ?>"
|
1002 |
-
<?php echo $meta == $_value? 'checked="checked"' :''; ?>
|
1003 |
-
class="<?php echo $class; ?>" />
|
1004 |
-
<?php echo $_name; ?>
|
1005 |
-
<?php endforeach; ?>
|
1006 |
-
<span class="description"><?php echo $desc; ?></span>
|
1007 |
-
</td>
|
1008 |
-
</tr>
|
1009 |
-
<?php break; ?>
|
1010 |
-
<?php case 'radio': ?>
|
1011 |
-
<tr>
|
1012 |
-
<th scope="row" style="width: 140px">
|
1013 |
-
<label for="<?php echo $id; ?>"><?php echo $name; ?></label>
|
1014 |
-
</th>
|
1015 |
-
<td>
|
1016 |
-
<?php foreach ( (array)$options as $_value => $_name ): ?>
|
1017 |
-
<input name="<?php echo $element_name; ?>" id="<?php echo $id; ?>"
|
1018 |
-
value="<?php echo $_value; ?>" type="<?php echo $type; ?>"
|
1019 |
-
<?php echo $meta == $_value?'checked="checked"' :''; ?>
|
1020 |
-
<?php echo $attributes ?> class="<?php echo $class; ?>" />
|
1021 |
-
<?php echo $_name; ?>
|
1022 |
-
<?php endforeach; ?>
|
1023 |
-
<span class="description"><?php echo $desc; ?></span>
|
1024 |
-
</td>
|
1025 |
-
</tr>
|
1026 |
-
<?php break; ?>
|
1027 |
-
<?php case 'textarea': ?>
|
1028 |
-
<tr>
|
1029 |
-
<th scope="row" style="width: 140px">
|
1030 |
-
<label for="<?php echo $id; ?>"><?php echo $name; ?></label>
|
1031 |
-
</th>
|
1032 |
-
<td>
|
1033 |
-
<textarea <?php echo $attributes ?>
|
1034 |
-
id="<?php echo $id; ?>"
|
1035 |
-
name="<?php echo $id; ?>"
|
1036 |
-
class="large-text <?php echo $class; ?>"
|
1037 |
-
><?php echo $meta; ?></textarea>
|
1038 |
-
<span class="description"><?php echo $desc; ?></span>
|
1039 |
-
</td>
|
1040 |
-
</tr>
|
1041 |
-
<?php break; ?>
|
1042 |
-
<?php case 'wpeditor': ?>
|
1043 |
-
<tr>
|
1044 |
-
<th scope="row" style="width: 140px">
|
1045 |
-
<label for="<?php echo $id; ?>"><?php echo $name; ?></label>
|
1046 |
-
</th>
|
1047 |
-
<td>
|
1048 |
-
<?php wp_editor( $meta, $id, $settings = array() ); ?>
|
1049 |
-
<span class="description"><?php echo $desc; ?></span>
|
1050 |
-
</td>
|
1051 |
-
</tr>
|
1052 |
-
<?php break; ?>
|
1053 |
-
<?php case 'select_capabilities': ?>
|
1054 |
-
<?php $options = $type=='select_capabilities' ?$this->get_options_capabilities()+$options :$options; ?>
|
1055 |
-
|
1056 |
-
<?php case 'select_roles': ?>
|
1057 |
-
<?php $options = $type=='select_roles' ?$this->get_options_roles()+$options :$options; ?>
|
1058 |
-
|
1059 |
-
<?php case 'select_menu': ?>
|
1060 |
-
<?php $options = $type=='select_menu' ?$this->get_options_menus()+$options :$options; ?>
|
1061 |
-
|
1062 |
-
<?php case 'select_pages': ?>
|
1063 |
-
<?php $options = $type=='select_pages' ?$this->get_options_pages()+$options :$options; ?>
|
1064 |
-
|
1065 |
-
<?php case 'select_users': ?>
|
1066 |
-
<?php $options = $type=='select_users' ?$this->get_options_users()+$options :$options; ?>
|
1067 |
-
|
1068 |
-
<?php case 'select_categories': ?>
|
1069 |
-
<?php case 'select': ?>
|
1070 |
-
<tr>
|
1071 |
-
<th scope="row" style="width: 140px">
|
1072 |
-
<label for="<?php echo $id; ?>"><?php echo $name; ?></label>
|
1073 |
-
</th>
|
1074 |
-
<td>
|
1075 |
-
<?php if ( $type == 'select_categories' ): ?>
|
1076 |
-
<?php wp_dropdown_categories( $args ); ?>
|
1077 |
-
|
1078 |
-
<?php else: ?>
|
1079 |
-
|
1080 |
-
<select <?php echo $attributes ?>
|
1081 |
-
id="<?php echo $id; ?>"
|
1082 |
-
name="<?php echo $id; ?>"
|
1083 |
-
class="<?php echo $class; ?>"
|
1084 |
-
<?php echo $multiple ?"MULTIPLE SIZE='$multiple'" :''; ?>
|
1085 |
-
><?php foreach ( (array)$options as $_value => $_name ): ?>
|
1086 |
-
|
1087 |
-
<option
|
1088 |
-
value="<?php echo $_value; ?>"
|
1089 |
-
<?php echo $meta == $_value ?' selected="selected"' :''; ?>
|
1090 |
-
><?php echo $_name; ?></option>
|
1091 |
-
|
1092 |
-
<?php endforeach; ?></select>
|
1093 |
-
<?php endif; ?>
|
1094 |
-
<span class="description"><?php echo $desc; ?></span>
|
1095 |
-
</td>
|
1096 |
-
</tr>
|
1097 |
-
<?php break; ?>
|
1098 |
-
<?php case 'hidden': ?>
|
1099 |
-
<tr>
|
1100 |
-
<td colspan="2">
|
1101 |
-
<input <?php echo $attributes ?>
|
1102 |
-
id="<?php echo $id; ?>"
|
1103 |
-
value="<?php echo $meta ?$meta :$default; ?>"
|
1104 |
-
type="<?php echo $type; ?>"
|
1105 |
-
name="<?php echo $id; ?>"
|
1106 |
-
style="visibility:hidden;" />
|
1107 |
-
</td>
|
1108 |
-
</tr>
|
1109 |
-
<?php break; ?>
|
1110 |
-
<?php case 'custom': ?>
|
1111 |
-
<tr>
|
1112 |
-
<td colspan="2">
|
1113 |
-
<?php echo $desc.$default; ?>
|
1114 |
-
</td>
|
1115 |
-
</tr>
|
1116 |
-
<?php } ?>
|
1117 |
-
<?php endforeach; ?>
|
1118 |
-
</table>
|
1119 |
-
<?php
|
1120 |
-
}
|
1121 |
-
return $this;
|
1122 |
-
}
|
1123 |
-
|
1124 |
-
|
1125 |
-
/**
|
1126 |
-
* Returns an options list of menus
|
1127 |
-
*/
|
1128 |
-
function get_options_pages() {
|
1129 |
-
// initializing
|
1130 |
-
$options = array( '0'=>' -- ' );
|
1131 |
-
$pages = get_pages( array( 'post_type' => 'page', 'post_status' => 'publish' ) );
|
1132 |
-
|
1133 |
-
foreach ( $pages as $page ) {
|
1134 |
-
$options[$page->ID] = $page->post_title;
|
1135 |
-
}
|
1136 |
-
|
1137 |
-
return $options;
|
1138 |
-
}
|
1139 |
-
|
1140 |
-
|
1141 |
-
/**
|
1142 |
-
* Returns an options list of menus
|
1143 |
-
*/
|
1144 |
-
function get_options_menus() {
|
1145 |
-
// initializing
|
1146 |
-
$options = array( '0'=>' -- ' );
|
1147 |
-
$menus = get_terms( 'nav_menu', array(
|
1148 |
-
'hide_empty' => 0
|
1149 |
-
) );
|
1150 |
-
|
1151 |
-
foreach ( $menus as $menu ) {
|
1152 |
-
$options[$menu->slug] = $menu->name;
|
1153 |
-
}
|
1154 |
-
|
1155 |
-
return $options;
|
1156 |
-
}
|
1157 |
-
|
1158 |
-
|
1159 |
-
/**
|
1160 |
-
* Returns an options list of users
|
1161 |
-
*/
|
1162 |
-
function get_options_users() {
|
1163 |
-
// initializing
|
1164 |
-
global $wpdb;
|
1165 |
-
|
1166 |
-
$options = array( '0'=>' -- ' );
|
1167 |
-
$query = $wpdb->prepare( "SELECT $wpdb->users.ID, $wpdb->users.display_name FROM $wpdb->users" );
|
1168 |
-
$results = $wpdb->get_results( $query );
|
1169 |
-
|
1170 |
-
foreach ( (array)$results as $result ) {
|
1171 |
-
$options[$result->ID] = $result->display_name;
|
1172 |
-
}
|
1173 |
-
|
1174 |
-
return $options;
|
1175 |
-
}
|
1176 |
-
|
1177 |
-
|
1178 |
-
/**
|
1179 |
-
* Returns an options list of capabilities
|
1180 |
-
*/
|
1181 |
-
function get_options_capabilities() {
|
1182 |
-
// initializing
|
1183 |
-
global $wpdb;
|
1184 |
-
|
1185 |
-
$options = array();
|
1186 |
-
$roles = get_option( $wpdb->prefix . 'user_roles' );
|
1187 |
-
|
1188 |
-
foreach ( (array)$roles as $role ) {
|
1189 |
-
if ( !isset( $role['capabilities'] ) ) continue;
|
1190 |
-
foreach ( (array)$role['capabilities'] as $cap => $v ) {
|
1191 |
-
$options[$role['name']."::$cap"] = $role['name']."::$cap";
|
1192 |
-
}
|
1193 |
-
}
|
1194 |
-
|
1195 |
-
return $options;
|
1196 |
-
}
|
1197 |
-
|
1198 |
-
|
1199 |
-
/**
|
1200 |
-
* Returns an options list of roles
|
1201 |
-
*/
|
1202 |
-
function get_options_roles() {
|
1203 |
-
// initializing
|
1204 |
-
global $wpdb;
|
1205 |
-
|
1206 |
-
$options = array(
|
1207 |
-
'read' => 'Public'
|
1208 |
-
);
|
1209 |
-
$roles = get_option( $wpdb->prefix . 'user_roles' );
|
1210 |
-
|
1211 |
-
foreach ( (array)$roles as $role ) {
|
1212 |
-
$options[strtolower( $role['name'] )] = $role['name'];
|
1213 |
-
}
|
1214 |
-
|
1215 |
-
return $options;
|
1216 |
-
}
|
1217 |
-
|
1218 |
-
|
1219 |
-
/**
|
1220 |
-
* Adds a box to the main column on the Post and Page edit screens
|
1221 |
-
*
|
1222 |
-
*/
|
1223 |
-
function _register() {
|
1224 |
-
// this metabox is to be displayed for a certain object type only
|
1225 |
-
if ( !empty( $this->_object_types ) && !in_array( $this->getCurrentPostType(), $this->_object_types ) )
|
1226 |
-
return;
|
1227 |
-
|
1228 |
-
if ( !$this->callback_args ) {
|
1229 |
-
$this->callback_args = $this;
|
1230 |
-
}
|
1231 |
-
|
1232 |
-
// if the user has not already set the type of this metabox,
|
1233 |
-
// then we need to do that now
|
1234 |
-
if ( !$this->_type ) {
|
1235 |
-
$this->setType();
|
1236 |
-
}
|
1237 |
-
|
1238 |
-
add_meta_box(
|
1239 |
-
$this->_id,
|
1240 |
-
$this->title,
|
1241 |
-
$this->callback,
|
1242 |
-
$this->getCurrentPostType(),
|
1243 |
-
$this->context,
|
1244 |
-
$this->priority,
|
1245 |
-
$this->callback_args
|
1246 |
-
);
|
1247 |
-
}
|
1248 |
-
|
1249 |
-
|
1250 |
-
/**
|
1251 |
-
* Method set's the hooks for the options creted by this metabox
|
1252 |
-
*
|
1253 |
-
*/
|
1254 |
-
function setOptionHooks() {
|
1255 |
-
foreach ( (array)$this->_fields as $field ) {
|
1256 |
-
if ( !isset( $field['id'] ) ) continue;
|
1257 |
-
|
1258 |
-
//creating the callback for the admin page
|
1259 |
-
$function = create_function( '$default', '
|
1260 |
-
return redrokk_admin_class::getInstance("'.$this->_isAdminPage.'")
|
1261 |
-
->getOption("'.$field['id'].'", $default, true);
|
1262 |
-
' );
|
1263 |
-
add_filter( "pre_option_{$field['id']}", $function, 20, 2 );
|
1264 |
-
}
|
1265 |
-
}
|
1266 |
-
|
1267 |
-
|
1268 |
-
/**
|
1269 |
-
* Method redirects the user if we have added a request redirect
|
1270 |
-
* in the url
|
1271 |
-
*
|
1272 |
-
* @param string $location
|
1273 |
-
*/
|
1274 |
-
function _redirectIntervention( $location ) {
|
1275 |
-
if ( isset( $_GET['_redirect'] ) ) {
|
1276 |
-
$location = urldecode( $_GET['_redirect'] );
|
1277 |
-
}
|
1278 |
-
return $location;
|
1279 |
-
}
|
1280 |
-
|
1281 |
-
|
1282 |
-
/**
|
1283 |
-
* Get the current page url
|
1284 |
-
*/
|
1285 |
-
function _currentPageURL() {
|
1286 |
-
$pageURL = 'http';
|
1287 |
-
if ( isset( $_SERVER["HTTPS"] ) && $_SERVER["HTTPS"] == "on" ) {$pageURL .= "s";}
|
1288 |
-
$pageURL .= "://";
|
1289 |
-
if ( $_SERVER["SERVER_PORT"] != "80" ) {
|
1290 |
-
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
|
1291 |
-
} else {
|
1292 |
-
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
|
1293 |
-
}
|
1294 |
-
return $pageURL;
|
1295 |
-
}
|
1296 |
-
|
1297 |
-
|
1298 |
-
/**
|
1299 |
-
* Method to bind an associative array or object to the JTable instance.This
|
1300 |
-
* method only binds properties that are publicly accessible and optionally
|
1301 |
-
* takes an array of properties to ignore when binding.
|
1302 |
-
*
|
1303 |
-
* @param mixed $src An associative array or object to bind to the JTable instance.
|
1304 |
-
* @param mixed $ignore An optional array or space separated list of properties to ignore while binding.
|
1305 |
-
*
|
1306 |
-
* @return boolean True on success.
|
1307 |
-
*
|
1308 |
-
* @link http://docs.joomla.org/JTable/bind
|
1309 |
-
* @since 11.1
|
1310 |
-
*/
|
1311 |
-
public function bind( $src, $ignore = array() ) {
|
1312 |
-
// If the source value is not an array or object return false.
|
1313 |
-
if ( !is_object( $src ) && !is_array( $src ) ) {
|
1314 |
-
trigger_error( 'Bind failed as the provided source is not an array.' );
|
1315 |
-
return false;
|
1316 |
-
}
|
1317 |
-
|
1318 |
-
// If the source value is an object, get its accessible properties.
|
1319 |
-
if ( is_object( $src ) ) {
|
1320 |
-
$src = get_object_vars( $src );
|
1321 |
-
}
|
1322 |
-
|
1323 |
-
// If the ignore value is a string, explode it over spaces.
|
1324 |
-
if ( !is_array( $ignore ) ) {
|
1325 |
-
$ignore = explode( ' ', $ignore );
|
1326 |
-
}
|
1327 |
-
|
1328 |
-
// Bind the source value, excluding the ignored fields.
|
1329 |
-
foreach ( $this->getProperties() as $k => $v ) {
|
1330 |
-
// Only process fields not in the ignore array.
|
1331 |
-
if ( !in_array( $k, $ignore ) ) {
|
1332 |
-
if ( isset( $src[$k] ) ) {
|
1333 |
-
$this->$k = $src[$k];
|
1334 |
-
}
|
1335 |
-
}
|
1336 |
-
}
|
1337 |
-
|
1338 |
-
return true;
|
1339 |
-
}
|
1340 |
-
|
1341 |
-
|
1342 |
-
/**
|
1343 |
-
* Set the object properties based on a named array/hash.
|
1344 |
-
*
|
1345 |
-
* @param mixed $properties Either an associative array or another object.
|
1346 |
-
*
|
1347 |
-
* @return boolean
|
1348 |
-
*
|
1349 |
-
* @since 11.1
|
1350 |
-
*
|
1351 |
-
* @see set()
|
1352 |
-
*/
|
1353 |
-
public function setProperties( $properties ) {
|
1354 |
-
if ( is_array( $properties ) || is_object( $properties ) ) {
|
1355 |
-
foreach ( (array) $properties as $k => $v ) {
|
1356 |
-
// Use the set function which might be overridden.
|
1357 |
-
$this->set( $k, $v );
|
1358 |
-
}
|
1359 |
-
return true;
|
1360 |
-
}
|
1361 |
-
|
1362 |
-
return false;
|
1363 |
-
}
|
1364 |
-
|
1365 |
-
|
1366 |
-
/**
|
1367 |
-
* Modifies a property of the object, creating it if it does not already exist.
|
1368 |
-
*
|
1369 |
-
* @param string $property The name of the property.
|
1370 |
-
* @param mixed $value The value of the property to set.
|
1371 |
-
*
|
1372 |
-
* @return mixed Previous value of the property.
|
1373 |
-
*
|
1374 |
-
* @since 11.1
|
1375 |
-
*/
|
1376 |
-
public function set( $property, $value = null ) {
|
1377 |
-
$_property = 'set'.str_replace( ' ', '', ucwords( str_replace( '_', ' ', $property ) ) );
|
1378 |
-
if ( method_exists( $this, $_property ) ) {
|
1379 |
-
return $this->$_property( $value );
|
1380 |
-
}
|
1381 |
-
|
1382 |
-
$previous = isset( $this->$property ) ? $this->$property : null;
|
1383 |
-
$this->$property = $value;
|
1384 |
-
return $previous;
|
1385 |
-
}
|
1386 |
-
|
1387 |
-
|
1388 |
-
/**
|
1389 |
-
* Returns an associative array of object properties.
|
1390 |
-
*
|
1391 |
-
* @param boolean $public If true, returns only the public properties.
|
1392 |
-
*
|
1393 |
-
* @return array
|
1394 |
-
*
|
1395 |
-
* @see get()
|
1396 |
-
*/
|
1397 |
-
public function getProperties( $public = true ) {
|
1398 |
-
$vars = get_object_vars( $this );
|
1399 |
-
if ( $public ) {
|
1400 |
-
foreach ( $vars as $key => $value ) {
|
1401 |
-
if ( '_' == substr( $key, 0, 1 ) ) {
|
1402 |
-
unset( $vars[$key] );
|
1403 |
-
}
|
1404 |
-
}
|
1405 |
-
}
|
1406 |
-
|
1407 |
-
return $vars;
|
1408 |
-
}
|
1409 |
-
|
1410 |
-
|
1411 |
-
/**
|
1412 |
-
* contains the current instance of this class
|
1413 |
-
*
|
1414 |
-
* @var object
|
1415 |
-
*/
|
1416 |
-
static $_instances = null;
|
1417 |
-
|
1418 |
-
/**
|
1419 |
-
* Method is called when we need to instantiate this class
|
1420 |
-
*
|
1421 |
-
* @param array $options
|
1422 |
-
*/
|
1423 |
-
public static function getInstance( $_id, $options = array() ) {
|
1424 |
-
if ( !isset( self::$_instances[$_id] ) ) {
|
1425 |
-
$options['_id'] = $_id;
|
1426 |
-
$class = get_class();
|
1427 |
-
self::$_instances[$_id] = new $class( $options );
|
1428 |
-
}
|
1429 |
-
return self::$_instances[$_id];
|
1430 |
-
}
|
1431 |
-
|
1432 |
-
|
1433 |
-
}
|
1434 |
-
|
1435 |
-
|
1436 |
-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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trunk/includes/requirements.php
DELETED
@@ -1,67 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
3 |
-
Copyright 2014 Michael Cannon (email: mc@aihr.us)
|
4 |
-
|
5 |
-
This program is free software; you can redistribute it and/or modify
|
6 |
-
it under the terms of the GNU General Public License, version 2, as
|
7 |
-
published by the Free Software Foundation.
|
8 |
-
|
9 |
-
This program is distributed in the hope that it will be useful,
|
10 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12 |
-
GNU General Public License for more details.
|
13 |
-
|
14 |
-
You should have received a copy of the GNU General Public License
|
15 |
-
along with this program; if not, write to the Free Software
|
16 |
-
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
17 |
-
*/
|
18 |
-
|
19 |
-
require_once TW_DIR_LIB . 'aihrus-framework/aihrus-framework.php';
|
20 |
-
|
21 |
-
|
22 |
-
function tw_requirements_check( $force_check = false ) {
|
23 |
-
$check_okay = get_transient( 'tw_requirements_check' );
|
24 |
-
if ( empty( $force_check ) && $check_okay !== false ) {
|
25 |
-
return $check_okay;
|
26 |
-
}
|
27 |
-
|
28 |
-
$deactivate_reason = false;
|
29 |
-
if ( ! function_exists( 'aihr_check_aihrus_framework' ) ) {
|
30 |
-
$deactivate_reason = esc_html__( 'Missing Aihrus Framework', 'testimonials-widget' );
|
31 |
-
add_action( 'admin_notices', 'tw_notice_aihrus' );
|
32 |
-
} elseif ( ! aihr_check_aihrus_framework( TW_BASE, TW_NAME, TW_AIHR_VERSION ) ) {
|
33 |
-
$deactivate_reason = esc_html__( 'Old Aihrus Framework version detected', 'testimonials-widget' );
|
34 |
-
}
|
35 |
-
|
36 |
-
if ( ! aihr_check_php( TW_BASE, TW_NAME ) ) {
|
37 |
-
$deactivate_reason = esc_html__( 'Old PHP version detected', 'testimonials-widget' );
|
38 |
-
}
|
39 |
-
|
40 |
-
if ( ! aihr_check_wp( TW_BASE, TW_NAME ) ) {
|
41 |
-
$deactivate_reason = esc_html__( 'Old WordPress version detected', 'testimonials-widget' );
|
42 |
-
}
|
43 |
-
|
44 |
-
if ( ! empty( $deactivate_reason ) ) {
|
45 |
-
aihr_deactivate_plugin( TW_BASE, TW_NAME, $deactivate_reason );
|
46 |
-
}
|
47 |
-
|
48 |
-
$check_okay = empty( $deactivate_reason );
|
49 |
-
if ( $check_okay ) {
|
50 |
-
delete_transient( 'tw_requirements_check' );
|
51 |
-
set_transient( 'tw_requirements_check', $check_okay, HOUR_IN_SECONDS );
|
52 |
-
}
|
53 |
-
|
54 |
-
return $check_okay;
|
55 |
-
}
|
56 |
-
|
57 |
-
|
58 |
-
function tw_notice_aihrus() {
|
59 |
-
$help_url = esc_url( 'https://aihrus.zendesk.com/entries/35689458' );
|
60 |
-
$help_link = sprintf( __( '<a href="%1$s">Update plugins</a>. <a href="%2$s">More information</a>.', 'testimonials-widget' ), self_admin_url( 'update-core.php' ), $help_url );
|
61 |
-
|
62 |
-
$text = sprintf( esc_html__( 'Plugin "%1$s" has been deactivated as it requires a current Aihrus Framework. Once corrected, "%1$s" can be activated. %2$s', 'testimonials-widget' ), TW_NAME, $help_link );
|
63 |
-
|
64 |
-
aihr_notice_error( $text );
|
65 |
-
}
|
66 |
-
|
67 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trunk/languages/testimonials-widget-he_IL.mo
DELETED
Binary file
|
trunk/languages/testimonials-widget-he_IL.po
DELETED
@@ -1,546 +0,0 @@
|
|
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 "עדויות"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trunk/languages/testimonials-widget-nl_NL.mo
DELETED
Binary file
|
trunk/languages/testimonials-widget-nl_NL.po
DELETED
@@ -1,631 +0,0 @@
|
|
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.9.0\n"
|
6 |
-
"Report-Msgid-Bugs-To: http://wordpress.org/tag/testimonials-widget\n"
|
7 |
-
"POT-Creation-Date: 2013-03-13 13:55:03+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-03-16 16:22+0100\n"
|
12 |
-
"Last-Translator: \n"
|
13 |
-
"Language-Team: \n"
|
14 |
-
"X-Generator: Poedit 1.5.5\n"
|
15 |
-
"Language: Dutch/Nederlands\n"
|
16 |
-
|
17 |
-
#: lib/settings.testimonials-widget.php:38
|
18 |
-
msgid "General"
|
19 |
-
msgstr "Algemeen"
|
20 |
-
|
21 |
-
#: lib/settings.testimonials-widget.php:39
|
22 |
-
msgid "Selection"
|
23 |
-
msgstr "Selectie"
|
24 |
-
|
25 |
-
#: lib/settings.testimonials-widget.php:40
|
26 |
-
msgid "Ordering"
|
27 |
-
msgstr "Volgorde"
|
28 |
-
|
29 |
-
#: lib/settings.testimonials-widget.php:41
|
30 |
-
msgid "Widget"
|
31 |
-
msgstr "Widget"
|
32 |
-
|
33 |
-
#: lib/settings.testimonials-widget.php:43
|
34 |
-
msgid "Post Type"
|
35 |
-
msgstr "Post Type"
|
36 |
-
|
37 |
-
#: lib/settings.testimonials-widget.php:44
|
38 |
-
msgid "Reset"
|
39 |
-
msgstr "Herstellen"
|
40 |
-
|
41 |
-
#: lib/settings.testimonials-widget.php:45
|
42 |
-
msgid "About Testimonials Widget"
|
43 |
-
msgstr "Over Testimonials Widget"
|
44 |
-
|
45 |
-
#: lib/settings.testimonials-widget.php:55
|
46 |
-
msgid "Widget Title"
|
47 |
-
msgstr "Widget Titel"
|
48 |
-
|
49 |
-
#: lib/settings.testimonials-widget.php:56 testimonials-widget.php:354
|
50 |
-
#: testimonials-widget.php:382
|
51 |
-
msgid "Testimonials"
|
52 |
-
msgstr "Testimonials"
|
53 |
-
|
54 |
-
#: lib/settings.testimonials-widget.php:61
|
55 |
-
msgid "Title Link"
|
56 |
-
msgstr "Titel Link"
|
57 |
-
|
58 |
-
#: lib/settings.testimonials-widget.php:62
|
59 |
-
msgid "URL or Post ID to link widget title to. Ex: 123 or http://example.com"
|
60 |
-
msgstr ""
|
61 |
-
"URL of Post ID om de widget titel naar te linken. Vb.: 123 of http://"
|
62 |
-
"voorbeeld.com"
|
63 |
-
|
64 |
-
#: lib/settings.testimonials-widget.php:67
|
65 |
-
msgid "Keep Whitespace?"
|
66 |
-
msgstr "Witruimte behouden?"
|
67 |
-
|
68 |
-
#: lib/settings.testimonials-widget.php:68
|
69 |
-
msgid "Keeps testimonials looking as entered than sans auto-formatting"
|
70 |
-
msgstr "Behoud testimonials zoals ingegeven ipv auto-opmaak"
|
71 |
-
|
72 |
-
#: lib/settings.testimonials-widget.php:74
|
73 |
-
msgid "Minimum Height"
|
74 |
-
msgstr "Minimum Hoogte"
|
75 |
-
|
76 |
-
#: lib/settings.testimonials-widget.php:75
|
77 |
-
msgid "Set for minimum display height, in pixels"
|
78 |
-
msgstr "Geef de minimum weer te geven hoogte, in pixels"
|
79 |
-
|
80 |
-
#: lib/settings.testimonials-widget.php:80
|
81 |
-
msgid "Maximum Height"
|
82 |
-
msgstr "Maximum Hoogte"
|
83 |
-
|
84 |
-
#: lib/settings.testimonials-widget.php:81
|
85 |
-
msgid "Set for maximum display height, in pixels"
|
86 |
-
msgstr "Geef de maximum weer te geven hoogte, in pixels"
|
87 |
-
|
88 |
-
#: lib/settings.testimonials-widget.php:86
|
89 |
-
msgid "Rotation Speed"
|
90 |
-
msgstr "Rotatiesnelheid"
|
91 |
-
|
92 |
-
#: lib/settings.testimonials-widget.php:87
|
93 |
-
msgid ""
|
94 |
-
"Number of seconds between testimonial rotations or 0 for no rotation at all "
|
95 |
-
"refresh"
|
96 |
-
msgstr "Aantal seconden tussen testimonial rotaties of 0 voor geen rotatie"
|
97 |
-
|
98 |
-
#: lib/settings.testimonials-widget.php:93
|
99 |
-
msgid "General Options"
|
100 |
-
msgstr "Algemene Opties"
|
101 |
-
|
102 |
-
#: lib/settings.testimonials-widget.php:98
|
103 |
-
msgid "Character Limit"
|
104 |
-
msgstr "Teken limiet"
|
105 |
-
|
106 |
-
#: lib/settings.testimonials-widget.php:99
|
107 |
-
msgid "Number of characters to limit non-single testimonial views to"
|
108 |
-
msgstr "Aantal karakters om enkelvoudige testimonials tot te beperken"
|
109 |
-
|
110 |
-
#: lib/settings.testimonials-widget.php:103
|
111 |
-
msgid "Hide \"Testimonials Not Found\"?"
|
112 |
-
msgstr "Verberg \"Testimonials Niet gevonden\"?"
|
113 |
-
|
114 |
-
#: lib/settings.testimonials-widget.php:108
|
115 |
-
msgid "Hide Gravatar Image?"
|
116 |
-
msgstr "Verberg Gravatar afbeelding?"
|
117 |
-
|
118 |
-
#: lib/settings.testimonials-widget.php:113
|
119 |
-
msgid "Hide Image?"
|
120 |
-
msgstr "Verberg Afbeelding?"
|
121 |
-
|
122 |
-
#: lib/settings.testimonials-widget.php:118
|
123 |
-
msgid "Hide Testimonial Content?"
|
124 |
-
msgstr "Verberg Testimonial inhoud?"
|
125 |
-
|
126 |
-
#: lib/settings.testimonials-widget.php:123
|
127 |
-
msgid "Hide Author/Source?"
|
128 |
-
msgstr "Verberg Auteur/Bron?"
|
129 |
-
|
130 |
-
#: lib/settings.testimonials-widget.php:125
|
131 |
-
msgid "Don't display \"Post Title\" in cite"
|
132 |
-
msgstr "Verberg \"Post Titel\" in citaat"
|
133 |
-
|
134 |
-
#: lib/settings.testimonials-widget.php:129
|
135 |
-
msgid "Hide Email?"
|
136 |
-
msgstr "Verberg Email?"
|
137 |
-
|
138 |
-
#: lib/settings.testimonials-widget.php:135
|
139 |
-
msgid "Hide Title?"
|
140 |
-
msgstr "Verberg Titel?"
|
141 |
-
|
142 |
-
#: lib/settings.testimonials-widget.php:140
|
143 |
-
msgid "Hide Location?"
|
144 |
-
msgstr "Verberg Locatie?"
|
145 |
-
|
146 |
-
#: lib/settings.testimonials-widget.php:145
|
147 |
-
msgid "Hide Company?"
|
148 |
-
msgstr "Verberg Bedrijf?"
|
149 |
-
|
150 |
-
#: lib/settings.testimonials-widget.php:150
|
151 |
-
msgid "Hide URL?"
|
152 |
-
msgstr "Verberg URL?"
|
153 |
-
|
154 |
-
#: lib/settings.testimonials-widget.php:155
|
155 |
-
msgid "URL Target"
|
156 |
-
msgstr "URL doel"
|
157 |
-
|
158 |
-
#: lib/settings.testimonials-widget.php:156
|
159 |
-
msgid "Adds target to all URLs; leave blank if none"
|
160 |
-
msgstr "Voeg doel aan alle URLs toe; Laat leeg voor geen toe te voegen"
|
161 |
-
|
162 |
-
#: lib/settings.testimonials-widget.php:160
|
163 |
-
msgid "Testimonial Bottom Text"
|
164 |
-
msgstr "Testimonial Bottom Text"
|
165 |
-
|
166 |
-
#: lib/settings.testimonials-widget.php:161
|
167 |
-
msgid "Custom text or HTML for bottom of testimonials"
|
168 |
-
msgstr "Aangepaste text of HTML for onder de testimonials"
|
169 |
-
|
170 |
-
#: lib/settings.testimonials-widget.php:166
|
171 |
-
msgid "Enable Paging?"
|
172 |
-
msgstr "Activeer Pagina nummering?"
|
173 |
-
|
174 |
-
#: lib/settings.testimonials-widget.php:167
|
175 |
-
msgid "For `[testimonialswidget_list]`"
|
176 |
-
msgstr "Voor `[testimonialswidget_list]`"
|
177 |
-
|
178 |
-
#: lib/settings.testimonials-widget.php:170
|
179 |
-
msgid "Disable"
|
180 |
-
msgstr "Uitschakelen"
|
181 |
-
|
182 |
-
#: lib/settings.testimonials-widget.php:171
|
183 |
-
msgid "Enable"
|
184 |
-
msgstr "Inschakelen"
|
185 |
-
|
186 |
-
#: lib/settings.testimonials-widget.php:172
|
187 |
-
msgid "Before testimonials"
|
188 |
-
msgstr "Voor testimonials"
|
189 |
-
|
190 |
-
#: lib/settings.testimonials-widget.php:173
|
191 |
-
msgid "After testimonials"
|
192 |
-
msgstr "Na testimonials"
|
193 |
-
|
194 |
-
#: lib/settings.testimonials-widget.php:179
|
195 |
-
msgid "Remove `.hentry` CSS?"
|
196 |
-
msgstr "Verwijder '.hentry' CSS?"
|
197 |
-
|
198 |
-
#: lib/settings.testimonials-widget.php:180
|
199 |
-
msgid ""
|
200 |
-
"Some themes use class `.hentry` in a manner that breaks Testimonials Widgets "
|
201 |
-
"CSS"
|
202 |
-
msgstr ""
|
203 |
-
"Sommige thema's gebruiken class '.hentry' dat de functies van Testimonials "
|
204 |
-
"Widgets CSS schaadt."
|
205 |
-
|
206 |
-
#: lib/settings.testimonials-widget.php:191
|
207 |
-
msgid "Selection Options"
|
208 |
-
msgstr "Selectie Opties"
|
209 |
-
|
210 |
-
#: lib/settings.testimonials-widget.php:197
|
211 |
-
msgid "Category Filter"
|
212 |
-
msgstr "Categorie Filter"
|
213 |
-
|
214 |
-
#: lib/settings.testimonials-widget.php:198
|
215 |
-
msgid "Comma separated category slug-names. Ex: category-a, another-category"
|
216 |
-
msgstr ""
|
217 |
-
"Komma gescheiden categorie slug-namen. Vb.: categorie-a, andere-categorie"
|
218 |
-
|
219 |
-
#: lib/settings.testimonials-widget.php:203
|
220 |
-
msgid "Tags Filter"
|
221 |
-
msgstr "Tags Filter"
|
222 |
-
|
223 |
-
#: lib/settings.testimonials-widget.php:204
|
224 |
-
msgid "Comma separated tag slug-names. Ex: tag-a, another-tag"
|
225 |
-
msgstr "Komma gescheiden tag slug-namen. Vb.: tag-a, andere-tag"
|
226 |
-
|
227 |
-
#: lib/settings.testimonials-widget.php:209
|
228 |
-
msgid "Require All Tags?"
|
229 |
-
msgstr "Vereist alle tags?"
|
230 |
-
|
231 |
-
#: lib/settings.testimonials-widget.php:210
|
232 |
-
msgid "Select only testimonials with all of the given tags"
|
233 |
-
msgstr "Selecteer alleen testimonials met alle opgegeven tags"
|
234 |
-
|
235 |
-
#: lib/settings.testimonials-widget.php:216
|
236 |
-
msgid "Include IDs Filter"
|
237 |
-
msgstr "Ingesloten IDs filter"
|
238 |
-
|
239 |
-
#: lib/settings.testimonials-widget.php:217
|
240 |
-
#: lib/settings.testimonials-widget.php:223
|
241 |
-
msgid "Comma separated testimonial IDs. Ex: 3,1,2"
|
242 |
-
msgstr "Komma gescheiden testimonial IDs. Vb.: 3,1,2"
|
243 |
-
|
244 |
-
#: lib/settings.testimonials-widget.php:222
|
245 |
-
msgid "Exclude IDs Filter"
|
246 |
-
msgstr "Uitgesloten IDs filter"
|
247 |
-
|
248 |
-
#: lib/settings.testimonials-widget.php:228
|
249 |
-
msgid "Limit"
|
250 |
-
msgstr "Limiet"
|
251 |
-
|
252 |
-
#: lib/settings.testimonials-widget.php:229
|
253 |
-
msgid "Number of testimonials to select per instance"
|
254 |
-
msgstr "Aantal testimonials om te selecteren per exemplaar"
|
255 |
-
|
256 |
-
#: lib/settings.testimonials-widget.php:241
|
257 |
-
msgid "Ordering Options"
|
258 |
-
msgstr "Volgorde Opties"
|
259 |
-
|
260 |
-
#: lib/settings.testimonials-widget.php:247
|
261 |
-
msgid "Random Order?"
|
262 |
-
msgstr "Willekeurige Volgorde?"
|
263 |
-
|
264 |
-
#: lib/settings.testimonials-widget.php:248
|
265 |
-
msgid ""
|
266 |
-
"If checked, ignores ORDER BY, ORDER BY meta_key, and ORDER BY Order. Widgets "
|
267 |
-
"are random by default automatically"
|
268 |
-
msgstr ""
|
269 |
-
"Wanneer aangevinkt, negeer ORDER BY, ORDER BY meta_key, and ORDER BY Order. "
|
270 |
-
"Widgets worden automatisch willekeurig ingesteld"
|
271 |
-
|
272 |
-
#: lib/settings.testimonials-widget.php:254
|
273 |
-
msgid "ORDER BY"
|
274 |
-
msgstr "ORDER BY"
|
275 |
-
|
276 |
-
#: lib/settings.testimonials-widget.php:255
|
277 |
-
msgid "Used when \"Random Order\" is disabled"
|
278 |
-
msgstr "Gebruikt wanneer \"Willekeurige Volgorde\" is uitgeschakeld"
|
279 |
-
|
280 |
-
#: lib/settings.testimonials-widget.php:258
|
281 |
-
msgid "Testimonial ID"
|
282 |
-
msgstr "Testimonial ID"
|
283 |
-
|
284 |
-
#: lib/settings.testimonials-widget.php:259
|
285 |
-
msgid "Author"
|
286 |
-
msgstr "Auteur"
|
287 |
-
|
288 |
-
#: lib/settings.testimonials-widget.php:260 testimonials-widget.php:330
|
289 |
-
msgid "Source"
|
290 |
-
msgstr "Bron"
|
291 |
-
|
292 |
-
#: lib/settings.testimonials-widget.php:261 testimonials-widget.php:340
|
293 |
-
msgid "Date"
|
294 |
-
msgstr "Datum"
|
295 |
-
|
296 |
-
#: lib/settings.testimonials-widget.php:262
|
297 |
-
msgid "No order"
|
298 |
-
msgstr "Geen volgorde"
|
299 |
-
|
300 |
-
#: lib/settings.testimonials-widget.php:269
|
301 |
-
msgid "ORDER BY meta_key"
|
302 |
-
msgstr "ORDER BY meta_key"
|
303 |
-
|
304 |
-
#: lib/settings.testimonials-widget.php:270
|
305 |
-
msgid ""
|
306 |
-
"Used when \"Random Order\" is disabled and sorting by a testimonials meta "
|
307 |
-
"key is needed. Overrides ORDER BY"
|
308 |
-
msgstr ""
|
309 |
-
"Gebruikt wanneer \"Willekeurige Volgorde\" uitgeschakeld is en de volgorde "
|
310 |
-
"bepaald moet worden door meta key. Overheerst ORDER BY"
|
311 |
-
|
312 |
-
#: lib/settings.testimonials-widget.php:273
|
313 |
-
msgid "None"
|
314 |
-
msgstr "Geen"
|
315 |
-
|
316 |
-
#: lib/settings.testimonials-widget.php:274 testimonials-widget.php:332
|
317 |
-
#: testimonials-widget.php:1224
|
318 |
-
msgid "Title"
|
319 |
-
msgstr "Titel"
|
320 |
-
|
321 |
-
#: lib/settings.testimonials-widget.php:275 testimonials-widget.php:334
|
322 |
-
#: testimonials-widget.php:1236
|
323 |
-
msgid "Email"
|
324 |
-
msgstr "Email"
|
325 |
-
|
326 |
-
#: lib/settings.testimonials-widget.php:276 testimonials-widget.php:335
|
327 |
-
#: testimonials-widget.php:1242
|
328 |
-
msgid "Company"
|
329 |
-
msgstr "Bedrijf"
|
330 |
-
|
331 |
-
#: lib/settings.testimonials-widget.php:277 testimonials-widget.php:336
|
332 |
-
#: testimonials-widget.php:1248
|
333 |
-
msgid "URL"
|
334 |
-
msgstr "URL"
|
335 |
-
|
336 |
-
#: lib/settings.testimonials-widget.php:283
|
337 |
-
msgid "ORDER BY Order"
|
338 |
-
msgstr "ORDER BY Order"
|
339 |
-
|
340 |
-
#: lib/settings.testimonials-widget.php:286
|
341 |
-
msgid "Descending"
|
342 |
-
msgstr "Aflopend"
|
343 |
-
|
344 |
-
#: lib/settings.testimonials-widget.php:287
|
345 |
-
msgid "Ascending"
|
346 |
-
msgstr "Oplopend"
|
347 |
-
|
348 |
-
#: lib/settings.testimonials-widget.php:300
|
349 |
-
msgid "Debug Mode?"
|
350 |
-
msgstr "Foutopsporingsmodus?"
|
351 |
-
|
352 |
-
#: lib/settings.testimonials-widget.php:301
|
353 |
-
msgid "Not implemented yet"
|
354 |
-
msgstr "Nog niet geïmplementeerd"
|
355 |
-
|
356 |
-
#: lib/settings.testimonials-widget.php:308
|
357 |
-
msgid "Allow Comments?"
|
358 |
-
msgstr "Commentaren toestaan?"
|
359 |
-
|
360 |
-
#: lib/settings.testimonials-widget.php:309
|
361 |
-
msgid "If checked, allows commenting on testimonial single-view pages"
|
362 |
-
msgstr ""
|
363 |
-
"Wanneer aangevinkt, staat commentaren toe op enkelvoudig testimonial pagina's"
|
364 |
-
|
365 |
-
#: lib/settings.testimonials-widget.php:313
|
366 |
-
msgid ""
|
367 |
-
"URL slug-name for <a href=\"%1s\">testimonials archive</a> page. After "
|
368 |
-
"changing, you must click \"Save Changes\" on <a href=\"%2s\">Permalink "
|
369 |
-
"Settings</a> to update them."
|
370 |
-
msgstr ""
|
371 |
-
"URL slug-naam voor <a href=\"%1s\">testimonials archief</a> pagina. Na "
|
372 |
-
"wijzigingen, klik op \"Wijzigingen opslaan\" om <a href=\"%2s\">Permalink "
|
373 |
-
"instellingen</a> bij te werken."
|
374 |
-
|
375 |
-
#: lib/settings.testimonials-widget.php:319
|
376 |
-
msgid "Archive Page URL"
|
377 |
-
msgstr "Archief pagina URL"
|
378 |
-
|
379 |
-
#: lib/settings.testimonials-widget.php:324
|
380 |
-
msgid ""
|
381 |
-
"URL slug-name for testimonial view pages. After changing, you must click "
|
382 |
-
"\"Save Changes\" on <a href=\"%1s\">Permalink Settings</a> to update them."
|
383 |
-
msgstr ""
|
384 |
-
"URL slug-naam voor testimonial pagina's. Na wijzigingen, klik \"Wijzigingen "
|
385 |
-
"opslaan\" op <a href=\"%1s\">Permalink instellingen</a> om deze bij te "
|
386 |
-
"werken."
|
387 |
-
|
388 |
-
#: lib/settings.testimonials-widget.php:327
|
389 |
-
msgid "Testimonial Page URL"
|
390 |
-
msgstr "Testimonial Pagina URL"
|
391 |
-
|
392 |
-
#: lib/settings.testimonials-widget.php:335
|
393 |
-
msgid "Reset to Defaults?"
|
394 |
-
msgstr "Herstellen naar standaard?"
|
395 |
-
|
396 |
-
#: lib/settings.testimonials-widget.php:338
|
397 |
-
msgid "Check this box to reset options to their defaults"
|
398 |
-
msgstr "Vink aan om de opties te herstellen naar standaard opties"
|
399 |
-
|
400 |
-
#: lib/settings.testimonials-widget.php:344
|
401 |
-
msgid "Example Text Input"
|
402 |
-
msgstr "Voorbeeld tekst invoer"
|
403 |
-
|
404 |
-
#: lib/settings.testimonials-widget.php:345
|
405 |
-
msgid "This is a description for the text input."
|
406 |
-
msgstr "Dit is een beschrijving voor tekst invoer."
|
407 |
-
|
408 |
-
#: lib/settings.testimonials-widget.php:350
|
409 |
-
msgid "Example Textarea Input"
|
410 |
-
msgstr "Voorbeeld tekstveld"
|
411 |
-
|
412 |
-
#: lib/settings.testimonials-widget.php:351
|
413 |
-
msgid "This is a description for the textarea input."
|
414 |
-
msgstr "Dit is een beschrijving voor het tekstveld."
|
415 |
-
|
416 |
-
#: lib/settings.testimonials-widget.php:357
|
417 |
-
msgid "Example Checkbox"
|
418 |
-
msgstr "Voorbeeld keuzevakje"
|
419 |
-
|
420 |
-
#: lib/settings.testimonials-widget.php:358
|
421 |
-
msgid "This is a description for the checkbox."
|
422 |
-
msgstr "Dit is een beschrijving voor het keuzevakje."
|
423 |
-
|
424 |
-
#: lib/settings.testimonials-widget.php:370
|
425 |
-
msgid "Example Radio"
|
426 |
-
msgstr "Voorbeeld keuzerondje"
|
427 |
-
|
428 |
-
#: lib/settings.testimonials-widget.php:371
|
429 |
-
msgid "This is a description for the radio buttons."
|
430 |
-
msgstr "Dit is een beschrijving voor het keuzerondje."
|
431 |
-
|
432 |
-
#: lib/settings.testimonials-widget.php:381
|
433 |
-
msgid "Example Select"
|
434 |
-
msgstr "Voorbeeld selectie"
|
435 |
-
|
436 |
-
#: lib/settings.testimonials-widget.php:382
|
437 |
-
msgid "This is a description for the drop-down."
|
438 |
-
msgstr "Dit is een beschrijving voor de selectie."
|
439 |
-
|
440 |
-
#: lib/settings.testimonials-widget.php:433
|
441 |
-
#: lib/settings.testimonials-widget.php:465
|
442 |
-
msgid "Testimonials Widget Settings"
|
443 |
-
msgstr "Testimonials Widget Settings"
|
444 |
-
|
445 |
-
#: lib/settings.testimonials-widget.php:433 testimonials-widget.php:90
|
446 |
-
msgid "Settings"
|
447 |
-
msgstr "Instellingen"
|
448 |
-
|
449 |
-
#: lib/settings.testimonials-widget.php:484
|
450 |
-
msgid "Save Changes"
|
451 |
-
msgstr "Wijzigingen Opslaan"
|
452 |
-
|
453 |
-
#: lib/settings.testimonials-widget.php:495
|
454 |
-
msgid "Copyright ©%1$s %2$s."
|
455 |
-
msgstr "Copyright ©%1$s %2$s."
|
456 |
-
|
457 |
-
#: lib/testimonials-widget-widget.php:8
|
458 |
-
msgid "Display testimonials with multiple selection and display options"
|
459 |
-
msgstr "Geef testimonials weer met meerdere selectie en weergave mogelijkheden"
|
460 |
-
|
461 |
-
#. #-#-#-#-# testimonials-widget.pot (Testimonials Widget 2.9.0) #-#-#-#-#
|
462 |
-
#. Plugin Name of the plugin/theme
|
463 |
-
#: lib/testimonials-widget-widget.php:19
|
464 |
-
msgid "Testimonials Widget"
|
465 |
-
msgstr "Testimonials Widget"
|
466 |
-
|
467 |
-
#: lib/testimonials-widget-widget.php:138
|
468 |
-
msgid "CSS Class"
|
469 |
-
msgstr "CSS Class"
|
470 |
-
|
471 |
-
#: lib/testimonials-widget-widget.php:139
|
472 |
-
msgid "This widget's unique CSS class for styling"
|
473 |
-
msgstr "Deze widget uniele CSS class voor stijlopmaak"
|
474 |
-
|
475 |
-
#: lib/testimonials-widget-widget.php:177
|
476 |
-
msgid "Expand/Collapse"
|
477 |
-
msgstr "Uitvouwen/Samenvouwen"
|
478 |
-
|
479 |
-
#: testimonials-widget.php:329
|
480 |
-
msgid "Image"
|
481 |
-
msgstr "Afbeelding"
|
482 |
-
|
483 |
-
#: testimonials-widget.php:331
|
484 |
-
msgid "Shortcodes"
|
485 |
-
msgstr "Shortcodes"
|
486 |
-
|
487 |
-
#: testimonials-widget.php:333 testimonials-widget.php:1230
|
488 |
-
msgid "Location"
|
489 |
-
msgstr "Locatie"
|
490 |
-
|
491 |
-
#: testimonials-widget.php:337
|
492 |
-
msgid "Published by"
|
493 |
-
msgstr "Gepubliceerd door"
|
494 |
-
|
495 |
-
#: testimonials-widget.php:338
|
496 |
-
msgid "Category"
|
497 |
-
msgstr "Categorie"
|
498 |
-
|
499 |
-
#: testimonials-widget.php:339
|
500 |
-
msgid "Tags"
|
501 |
-
msgstr "Tags"
|
502 |
-
|
503 |
-
#: testimonials-widget.php:351
|
504 |
-
msgid "Add New"
|
505 |
-
msgstr "Nieuw Toevoegen"
|
506 |
-
|
507 |
-
#: testimonials-widget.php:352 testimonials-widget.php:355
|
508 |
-
msgid "Add New Testimonial"
|
509 |
-
msgstr "Nieuwe testimonial toevoegen"
|
510 |
-
|
511 |
-
#: testimonials-widget.php:353
|
512 |
-
msgid "Edit Testimonial"
|
513 |
-
msgstr "Testimonial bewerken"
|
514 |
-
|
515 |
-
#: testimonials-widget.php:356 testimonials-widget.php:617
|
516 |
-
msgid "No testimonials found"
|
517 |
-
msgstr "Geen testimonials gevonden"
|
518 |
-
|
519 |
-
#: testimonials-widget.php:357
|
520 |
-
msgid "No testimonials found in Trash"
|
521 |
-
msgstr "Geen testimonials gevonden in prullenbak"
|
522 |
-
|
523 |
-
#: testimonials-widget.php:359
|
524 |
-
msgid "Search Testimonials"
|
525 |
-
msgstr "Zoek testimonials"
|
526 |
-
|
527 |
-
#: testimonials-widget.php:360
|
528 |
-
msgid "Testimonial"
|
529 |
-
msgstr "Testimonial"
|
530 |
-
|
531 |
-
#: testimonials-widget.php:361
|
532 |
-
msgid "View Testimonial"
|
533 |
-
msgstr "Bekijk testimonial"
|
534 |
-
|
535 |
-
#: testimonials-widget.php:650
|
536 |
-
msgid "…"
|
537 |
-
msgstr "..."
|
538 |
-
|
539 |
-
#: testimonials-widget.php:996
|
540 |
-
msgid "«"
|
541 |
-
msgstr "«"
|
542 |
-
|
543 |
-
#: testimonials-widget.php:1005
|
544 |
-
msgid "»"
|
545 |
-
msgstr "»"
|
546 |
-
|
547 |
-
#: testimonials-widget.php:1260
|
548 |
-
msgid "Testimonial Data"
|
549 |
-
msgstr "Testimonial Data"
|
550 |
-
|
551 |
-
#: testimonials-widget.php:1285
|
552 |
-
msgid "Enter title here"
|
553 |
-
msgstr "Geef titel op"
|
554 |
-
|
555 |
-
#: testimonials-widget.php:1286
|
556 |
-
msgid "Enter testimonial source here"
|
557 |
-
msgstr "Geef testimonial bron op"
|
558 |
-
|
559 |
-
#: testimonials-widget.php:1310
|
560 |
-
msgid "Testimonial updated. <a href=\"%s\">View testimonial</a>"
|
561 |
-
msgstr "Testimonial bijgewerkt. <a href=\"%s\">Bekijk testimonial</a>"
|
562 |
-
|
563 |
-
#: testimonials-widget.php:1311
|
564 |
-
msgid "Custom field updated."
|
565 |
-
msgstr "Aangepast veld bijgewerkt."
|
566 |
-
|
567 |
-
#: testimonials-widget.php:1312
|
568 |
-
msgid "Custom field deleted."
|
569 |
-
msgstr "Aangepast veld verwijderd."
|
570 |
-
|
571 |
-
#: testimonials-widget.php:1313
|
572 |
-
msgid "Testimonial updated."
|
573 |
-
msgstr "Testimonial bijgewerkt."
|
574 |
-
|
575 |
-
#. translators: %s: date and time of the revision
|
576 |
-
#: testimonials-widget.php:1315
|
577 |
-
msgid "Testimonial restored to revision from %s"
|
578 |
-
msgstr "Testimonial herstelt naar revisie van %s"
|
579 |
-
|
580 |
-
#: testimonials-widget.php:1316
|
581 |
-
msgid "Testimonial published. <a href=\"%s\">View testimonial</a>"
|
582 |
-
msgstr "Testimonial gepubliceerd. <a href=\"%s\">Bekijk testimonial</a>"
|
583 |
-
|
584 |
-
#: testimonials-widget.php:1317
|
585 |
-
msgid "Testimonial saved."
|
586 |
-
msgstr "Testimonial opgeslaan."
|
587 |
-
|
588 |
-
#: testimonials-widget.php:1318
|
589 |
-
msgid ""
|
590 |
-
"Testimonial submitted. <a target=\"_blank\" href=\"%s\">Preview testimonial</"
|
591 |
-
"a>"
|
592 |
-
msgstr ""
|
593 |
-
"Testimonial toegevoegd. <a target=\"_blank\" href=\"%s\">Bekijk voorbeeld "
|
594 |
-
"testimonial</a>"
|
595 |
-
|
596 |
-
#: testimonials-widget.php:1319
|
597 |
-
msgid ""
|
598 |
-
"Testimonial scheduled for: <strong>%1$s</strong>. <a target=\"_blank\" href="
|
599 |
-
"\"%2$s\">Preview testimonial</a>"
|
600 |
-
msgstr ""
|
601 |
-
"Testimonial gepland voor: <strong>%1$s</strong>. <a target=\"_blank\" href="
|
602 |
-
"\"%2$s\">Bekijk voorbeeld testimonial</a>"
|
603 |
-
|
604 |
-
#: testimonials-widget.php:1320
|
605 |
-
msgid ""
|
606 |
-
"Testimonial draft updated. <a target=\"_blank\" href=\"%s\">Preview "
|
607 |
-
"testimonial</a>"
|
608 |
-
msgstr ""
|
609 |
-
"Testimonial concept bijgewerkt. <a target=\"_blank\" href=\"%s\">Bekijk "
|
610 |
-
"voorbeeld</a>"
|
611 |
-
|
612 |
-
#. Plugin URI of the plugin/theme
|
613 |
-
msgid "http://wordpress.org/extend/plugins/testimonials-widget/"
|
614 |
-
msgstr "http://wordpress.org/extend/plugins/testimonials-widget/"
|
615 |
-
|
616 |
-
#. Description of the plugin/theme
|
617 |
-
msgid ""
|
618 |
-
"Testimonials Widget plugin allows you to display random or rotating "
|
619 |
-
"portfolio, quotes, reviews, showcases, or text with images on your WordPress "
|
620 |
-
"blog."
|
621 |
-
msgstr ""
|
622 |
-
"Testimonials Widget plugin laat je toe om willekeurig of roterend portfolio, "
|
623 |
-
"quotes, recensies, showcases, of tekst met afbeeldingen op uw WordPress blog."
|
624 |
-
|
625 |
-
#. Author of the plugin/theme
|
626 |
-
msgid "Michael C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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trunk/languages/testimonials-widget.pot
DELETED
@@ -1,963 +0,0 @@
|
|
1 |
-
# Copyright (C) 2014 Testimonials by Aihrus
|
2 |
-
# This file is distributed under the same license as the Testimonials by Aihrus package.
|
3 |
-
msgid ""
|
4 |
-
msgstr ""
|
5 |
-
"Project-Id-Version: Testimonials by Aihrus 2.19.1\n"
|
6 |
-
"Report-Msgid-Bugs-To: http://wordpress.org/tag/testimonials-widget\n"
|
7 |
-
"POT-Creation-Date: 2014-04-08 02:22:47+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: 2014-MO-DA HO:MI+ZONE\n"
|
12 |
-
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
13 |
-
"Language-Team: LANGUAGE <LL@li.org>\n"
|
14 |
-
|
15 |
-
#: includes/class-testimonials-widget-settings.php:91
|
16 |
-
msgid "Testimonials Settings"
|
17 |
-
msgstr ""
|
18 |
-
|
19 |
-
#: includes/class-testimonials-widget-settings.php:91
|
20 |
-
#: includes/class-testimonials-widget.php:115
|
21 |
-
msgid "Settings"
|
22 |
-
msgstr ""
|
23 |
-
|
24 |
-
#: includes/class-testimonials-widget-settings.php:107
|
25 |
-
#: includes/class-testimonials-widget-settings.php:943
|
26 |
-
msgid "General"
|
27 |
-
msgstr ""
|
28 |
-
|
29 |
-
#: includes/class-testimonials-widget-settings.php:108
|
30 |
-
#: includes/class-testimonials-widget-settings.php:951
|
31 |
-
msgid "Selection"
|
32 |
-
msgstr ""
|
33 |
-
|
34 |
-
#: includes/class-testimonials-widget-settings.php:109
|
35 |
-
#: includes/class-testimonials-widget-settings.php:959
|
36 |
-
msgid "Ordering"
|
37 |
-
msgstr ""
|
38 |
-
|
39 |
-
#: includes/class-testimonials-widget-settings.php:110
|
40 |
-
#: includes/class-testimonials-widget-settings.php:967
|
41 |
-
msgid "Widget"
|
42 |
-
msgstr ""
|
43 |
-
|
44 |
-
#: includes/class-testimonials-widget-settings.php:111
|
45 |
-
#: includes/class-testimonials-widget-settings.php:975
|
46 |
-
msgid "Post Type"
|
47 |
-
msgstr ""
|
48 |
-
|
49 |
-
#: includes/class-testimonials-widget-settings.php:112
|
50 |
-
#: includes/class-testimonials-widget-settings.php:983
|
51 |
-
msgid "Columns"
|
52 |
-
msgstr ""
|
53 |
-
|
54 |
-
#: includes/class-testimonials-widget-settings.php:129
|
55 |
-
msgid "Widget Title"
|
56 |
-
msgstr ""
|
57 |
-
|
58 |
-
#: includes/class-testimonials-widget-settings.php:130
|
59 |
-
#: includes/class-testimonials-widget-widget.php:32
|
60 |
-
#: includes/class-testimonials-widget.php:612
|
61 |
-
#: includes/class-testimonials-widget.php:658
|
62 |
-
msgid "Testimonials"
|
63 |
-
msgstr ""
|
64 |
-
|
65 |
-
#: includes/class-testimonials-widget-settings.php:136
|
66 |
-
msgid "Title Link"
|
67 |
-
msgstr ""
|
68 |
-
|
69 |
-
#: includes/class-testimonials-widget-settings.php:137
|
70 |
-
msgid "URL, path, or post ID to link widget title to. Ex: http://example.com/stuff, /testimonials, 123 or "
|
71 |
-
msgstr ""
|
72 |
-
|
73 |
-
#: includes/class-testimonials-widget-settings.php:143
|
74 |
-
msgid "Character Limit"
|
75 |
-
msgstr ""
|
76 |
-
|
77 |
-
#: includes/class-testimonials-widget-settings.php:144
|
78 |
-
msgid "Number of characters to limit non-single testimonial views to"
|
79 |
-
msgstr ""
|
80 |
-
|
81 |
-
#: includes/class-testimonials-widget-settings.php:150
|
82 |
-
msgid "Rotation Speed"
|
83 |
-
msgstr ""
|
84 |
-
|
85 |
-
#: includes/class-testimonials-widget-settings.php:151
|
86 |
-
msgid "Number of seconds between testimonial rotations or 0 for no rotation at all refresh"
|
87 |
-
msgstr ""
|
88 |
-
|
89 |
-
#: includes/class-testimonials-widget-settings.php:163
|
90 |
-
msgid "Additional Widget Options"
|
91 |
-
msgstr ""
|
92 |
-
|
93 |
-
#: includes/class-testimonials-widget-settings.php:169
|
94 |
-
msgid "Transition Mode?"
|
95 |
-
msgstr ""
|
96 |
-
|
97 |
-
#: includes/class-testimonials-widget-settings.php:170
|
98 |
-
msgid "Type of transition between slides"
|
99 |
-
msgstr ""
|
100 |
-
|
101 |
-
#: includes/class-testimonials-widget-settings.php:173
|
102 |
-
msgid "Fade"
|
103 |
-
msgstr ""
|
104 |
-
|
105 |
-
#: includes/class-testimonials-widget-settings.php:174
|
106 |
-
msgid "Horizontal"
|
107 |
-
msgstr ""
|
108 |
-
|
109 |
-
#: includes/class-testimonials-widget-settings.php:175
|
110 |
-
msgid "Vertical"
|
111 |
-
msgstr ""
|
112 |
-
|
113 |
-
#: includes/class-testimonials-widget-settings.php:182
|
114 |
-
msgid "Show Play/Pause?"
|
115 |
-
msgstr ""
|
116 |
-
|
117 |
-
#: includes/class-testimonials-widget-settings.php:183
|
118 |
-
msgid "Display start and stop buttons underneath the testimonial slider."
|
119 |
-
msgstr ""
|
120 |
-
|
121 |
-
#: includes/class-testimonials-widget-settings.php:191
|
122 |
-
msgid "Enable Video?"
|
123 |
-
msgstr ""
|
124 |
-
|
125 |
-
#: includes/class-testimonials-widget-settings.php:192
|
126 |
-
msgid "Only enable when displaying video content."
|
127 |
-
msgstr ""
|
128 |
-
|
129 |
-
#: includes/class-testimonials-widget-settings.php:199
|
130 |
-
msgid "Keep Whitespace?"
|
131 |
-
msgstr ""
|
132 |
-
|
133 |
-
#: includes/class-testimonials-widget-settings.php:200
|
134 |
-
msgid "Keeps testimonials looking as entered than sans auto-formatting"
|
135 |
-
msgstr ""
|
136 |
-
|
137 |
-
#: includes/class-testimonials-widget-settings.php:207
|
138 |
-
msgid "Testimonial Bottom Text"
|
139 |
-
msgstr ""
|
140 |
-
|
141 |
-
#: includes/class-testimonials-widget-settings.php:208
|
142 |
-
msgid "Custom text or HTML for bottom of testimonials"
|
143 |
-
msgstr ""
|
144 |
-
|
145 |
-
#: includes/class-testimonials-widget-settings.php:220
|
146 |
-
msgid "General Options"
|
147 |
-
msgstr ""
|
148 |
-
|
149 |
-
#: includes/class-testimonials-widget-settings.php:225
|
150 |
-
msgid "Exclude bxSlider CSS?"
|
151 |
-
msgstr ""
|
152 |
-
|
153 |
-
#: includes/class-testimonials-widget-settings.php:226
|
154 |
-
msgid "For a bare-bones, unthemed slider."
|
155 |
-
msgstr ""
|
156 |
-
|
157 |
-
#: includes/class-testimonials-widget-settings.php:233
|
158 |
-
msgid "Include IE7 CSS?"
|
159 |
-
msgstr ""
|
160 |
-
|
161 |
-
#: includes/class-testimonials-widget-settings.php:240
|
162 |
-
msgid "Hide built-in quotes?"
|
163 |
-
msgstr ""
|
164 |
-
|
165 |
-
#: includes/class-testimonials-widget-settings.php:241
|
166 |
-
msgid "Remove open and close quote span tags surrounding testimonial content"
|
167 |
-
msgstr ""
|
168 |
-
|
169 |
-
#: includes/class-testimonials-widget-settings.php:247
|
170 |
-
msgid "Remove `.hentry` CSS?"
|
171 |
-
msgstr ""
|
172 |
-
|
173 |
-
#: includes/class-testimonials-widget-settings.php:248
|
174 |
-
msgid "Some themes use class `.hentry` in a manner that breaks Testimonials' CSS"
|
175 |
-
msgstr ""
|
176 |
-
|
177 |
-
#: includes/class-testimonials-widget-settings.php:255
|
178 |
-
msgid "Use `<q>` tag?"
|
179 |
-
msgstr ""
|
180 |
-
|
181 |
-
#: includes/class-testimonials-widget-settings.php:256
|
182 |
-
msgid "Not HTML5 compliant"
|
183 |
-
msgstr ""
|
184 |
-
|
185 |
-
#: includes/class-testimonials-widget-settings.php:262
|
186 |
-
msgid "Fields to Show"
|
187 |
-
msgstr ""
|
188 |
-
|
189 |
-
#: includes/class-testimonials-widget-settings.php:267
|
190 |
-
msgid "Hide Gravatar Image?"
|
191 |
-
msgstr ""
|
192 |
-
|
193 |
-
#: includes/class-testimonials-widget-settings.php:273
|
194 |
-
#: includes/class-testimonials-widget-settings.php:566
|
195 |
-
msgid "Hide Image?"
|
196 |
-
msgstr ""
|
197 |
-
|
198 |
-
#: includes/class-testimonials-widget-settings.php:279
|
199 |
-
msgid "Hide Image in Single View?"
|
200 |
-
msgstr ""
|
201 |
-
|
202 |
-
#: includes/class-testimonials-widget-settings.php:286
|
203 |
-
msgid "Hide Testimonial Content?"
|
204 |
-
msgstr ""
|
205 |
-
|
206 |
-
#: includes/class-testimonials-widget-settings.php:292
|
207 |
-
msgid "Hide Author/Source?"
|
208 |
-
msgstr ""
|
209 |
-
|
210 |
-
#: includes/class-testimonials-widget-settings.php:295
|
211 |
-
msgid "Don't display \"Post Title\" in cite"
|
212 |
-
msgstr ""
|
213 |
-
|
214 |
-
#: includes/class-testimonials-widget-settings.php:299
|
215 |
-
#: includes/class-testimonials-widget-settings.php:600
|
216 |
-
msgid "Hide Email?"
|
217 |
-
msgstr ""
|
218 |
-
|
219 |
-
#: includes/class-testimonials-widget-settings.php:306
|
220 |
-
#: includes/class-testimonials-widget-settings.php:582
|
221 |
-
msgid "Hide Job Title?"
|
222 |
-
msgstr ""
|
223 |
-
|
224 |
-
#: includes/class-testimonials-widget-settings.php:312
|
225 |
-
#: includes/class-testimonials-widget-settings.php:591
|
226 |
-
msgid "Hide Location?"
|
227 |
-
msgstr ""
|
228 |
-
|
229 |
-
#: includes/class-testimonials-widget-settings.php:318
|
230 |
-
#: includes/class-testimonials-widget-settings.php:609
|
231 |
-
msgid "Hide Company?"
|
232 |
-
msgstr ""
|
233 |
-
|
234 |
-
#: includes/class-testimonials-widget-settings.php:324
|
235 |
-
#: includes/class-testimonials-widget-settings.php:618
|
236 |
-
msgid "Hide URL?"
|
237 |
-
msgstr ""
|
238 |
-
|
239 |
-
#: includes/class-testimonials-widget-settings.php:330
|
240 |
-
msgid "Miscellanious"
|
241 |
-
msgstr ""
|
242 |
-
|
243 |
-
#: includes/class-testimonials-widget-settings.php:335
|
244 |
-
msgid "Default Reviewed Item?"
|
245 |
-
msgstr ""
|
246 |
-
|
247 |
-
#: includes/class-testimonials-widget-settings.php:336
|
248 |
-
msgid "Name of thing being referenced in testimonials"
|
249 |
-
msgstr ""
|
250 |
-
|
251 |
-
#: includes/class-testimonials-widget-settings.php:342
|
252 |
-
msgid "Default Reviewed Item URL?"
|
253 |
-
msgstr ""
|
254 |
-
|
255 |
-
#: includes/class-testimonials-widget-settings.php:343
|
256 |
-
msgid "URL of thing being referenced in testimonials"
|
257 |
-
msgstr ""
|
258 |
-
|
259 |
-
#: includes/class-testimonials-widget-settings.php:350
|
260 |
-
msgid "Enable Paging?"
|
261 |
-
msgstr ""
|
262 |
-
|
263 |
-
#: includes/class-testimonials-widget-settings.php:351
|
264 |
-
msgid "For `[testimonials]`"
|
265 |
-
msgstr ""
|
266 |
-
|
267 |
-
#: includes/class-testimonials-widget-settings.php:354
|
268 |
-
msgid "Disable"
|
269 |
-
msgstr ""
|
270 |
-
|
271 |
-
#: includes/class-testimonials-widget-settings.php:355
|
272 |
-
msgid "Enable"
|
273 |
-
msgstr ""
|
274 |
-
|
275 |
-
#: includes/class-testimonials-widget-settings.php:356
|
276 |
-
msgid "Before testimonials"
|
277 |
-
msgstr ""
|
278 |
-
|
279 |
-
#: includes/class-testimonials-widget-settings.php:357
|
280 |
-
msgid "After testimonials"
|
281 |
-
msgstr ""
|
282 |
-
|
283 |
-
#: includes/class-testimonials-widget-settings.php:363
|
284 |
-
msgid "Adds HTML tag markup per the <a href=\"%s\">Review schema</a> to testimonials. Search engines including Bing, Google, Yahoo! and Yandex rely on this markup to improve the display of search results."
|
285 |
-
msgstr ""
|
286 |
-
|
287 |
-
#: includes/class-testimonials-widget-settings.php:366
|
288 |
-
msgid "Enable Review Schema?"
|
289 |
-
msgstr ""
|
290 |
-
|
291 |
-
#: includes/class-testimonials-widget-settings.php:374
|
292 |
-
msgid "Enable [shortcodes]?"
|
293 |
-
msgstr ""
|
294 |
-
|
295 |
-
#: includes/class-testimonials-widget-settings.php:375
|
296 |
-
msgid "If unchecked, shortcodes are stripped."
|
297 |
-
msgstr ""
|
298 |
-
|
299 |
-
#: includes/class-testimonials-widget-settings.php:382
|
300 |
-
msgid "Hide \"Testimonials Not Found\"?"
|
301 |
-
msgstr ""
|
302 |
-
|
303 |
-
#: includes/class-testimonials-widget-settings.php:388
|
304 |
-
msgid "URL Target"
|
305 |
-
msgstr ""
|
306 |
-
|
307 |
-
#: includes/class-testimonials-widget-settings.php:389
|
308 |
-
msgid "Add target to all URLs; leave blank if none"
|
309 |
-
msgstr ""
|
310 |
-
|
311 |
-
#: includes/class-testimonials-widget-settings.php:400
|
312 |
-
msgid "Selection Options"
|
313 |
-
msgstr ""
|
314 |
-
|
315 |
-
#: includes/class-testimonials-widget-settings.php:406
|
316 |
-
msgid "Category Filter"
|
317 |
-
msgstr ""
|
318 |
-
|
319 |
-
#: includes/class-testimonials-widget-settings.php:407
|
320 |
-
msgid "Comma separated category names. Ex: Category A, Another category"
|
321 |
-
msgstr ""
|
322 |
-
|
323 |
-
#: includes/class-testimonials-widget-settings.php:414
|
324 |
-
msgid "Tags Filter"
|
325 |
-
msgstr ""
|
326 |
-
|
327 |
-
#: includes/class-testimonials-widget-settings.php:415
|
328 |
-
msgid "Comma separated tag names. Ex: Tag A, Another tag"
|
329 |
-
msgstr ""
|
330 |
-
|
331 |
-
#: includes/class-testimonials-widget-settings.php:422
|
332 |
-
msgid "Require All Tags?"
|
333 |
-
msgstr ""
|
334 |
-
|
335 |
-
#: includes/class-testimonials-widget-settings.php:423
|
336 |
-
msgid "Select only testimonials with all of the given tags"
|
337 |
-
msgstr ""
|
338 |
-
|
339 |
-
#: includes/class-testimonials-widget-settings.php:430
|
340 |
-
msgid "Include IDs Filter"
|
341 |
-
msgstr ""
|
342 |
-
|
343 |
-
#: includes/class-testimonials-widget-settings.php:431
|
344 |
-
#: includes/class-testimonials-widget-settings.php:438
|
345 |
-
msgid "Comma separated testimonial IDs. Ex: 3,1,2"
|
346 |
-
msgstr ""
|
347 |
-
|
348 |
-
#: includes/class-testimonials-widget-settings.php:437
|
349 |
-
msgid "Exclude IDs Filter"
|
350 |
-
msgstr ""
|
351 |
-
|
352 |
-
#: includes/class-testimonials-widget-settings.php:444
|
353 |
-
msgid "Limit"
|
354 |
-
msgstr ""
|
355 |
-
|
356 |
-
#: includes/class-testimonials-widget-settings.php:445
|
357 |
-
msgid "Number of testimonials to select per instance"
|
358 |
-
msgstr ""
|
359 |
-
|
360 |
-
#: includes/class-testimonials-widget-settings.php:458
|
361 |
-
msgid "Ordering Options"
|
362 |
-
msgstr ""
|
363 |
-
|
364 |
-
#: includes/class-testimonials-widget-settings.php:464
|
365 |
-
msgid "Random Order?"
|
366 |
-
msgstr ""
|
367 |
-
|
368 |
-
#: includes/class-testimonials-widget-settings.php:465
|
369 |
-
msgid "If checked, ignores ORDER BY, ORDER BY meta_key, and ORDER BY Order. Widgets are random by default automatically"
|
370 |
-
msgstr ""
|
371 |
-
|
372 |
-
#: includes/class-testimonials-widget-settings.php:472
|
373 |
-
msgid "ORDER BY"
|
374 |
-
msgstr ""
|
375 |
-
|
376 |
-
#: includes/class-testimonials-widget-settings.php:473
|
377 |
-
msgid "Used when \"Random Order\" is disabled"
|
378 |
-
msgstr ""
|
379 |
-
|
380 |
-
#: includes/class-testimonials-widget-settings.php:476
|
381 |
-
msgid "Testimonial ID"
|
382 |
-
msgstr ""
|
383 |
-
|
384 |
-
#: includes/class-testimonials-widget-settings.php:477
|
385 |
-
msgid "Author"
|
386 |
-
msgstr ""
|
387 |
-
|
388 |
-
#: includes/class-testimonials-widget-settings.php:478
|
389 |
-
#: includes/class-testimonials-widget.php:549
|
390 |
-
msgid "Date"
|
391 |
-
msgstr ""
|
392 |
-
|
393 |
-
#: includes/class-testimonials-widget-settings.php:479
|
394 |
-
msgid "Menu Order"
|
395 |
-
msgstr ""
|
396 |
-
|
397 |
-
#: includes/class-testimonials-widget-settings.php:480
|
398 |
-
#: includes/class-testimonials-widget.php:547
|
399 |
-
msgid "Source"
|
400 |
-
msgstr ""
|
401 |
-
|
402 |
-
#: includes/class-testimonials-widget-settings.php:481
|
403 |
-
msgid "No order"
|
404 |
-
msgstr ""
|
405 |
-
|
406 |
-
#: includes/class-testimonials-widget-settings.php:489
|
407 |
-
msgid "ORDER BY meta_key"
|
408 |
-
msgstr ""
|
409 |
-
|
410 |
-
#: includes/class-testimonials-widget-settings.php:490
|
411 |
-
msgid "Used when \"Random Order\" is disabled and sorting by a testimonials meta key is needed. Overrides ORDER BY"
|
412 |
-
msgstr ""
|
413 |
-
|
414 |
-
#: includes/class-testimonials-widget-settings.php:493
|
415 |
-
msgid "None"
|
416 |
-
msgstr ""
|
417 |
-
|
418 |
-
#: includes/class-testimonials-widget-settings.php:494
|
419 |
-
#: includes/class-testimonials-widget.php:578
|
420 |
-
#: includes/class-testimonials-widget.php:1683
|
421 |
-
msgid "Job Title"
|
422 |
-
msgstr ""
|
423 |
-
|
424 |
-
#: includes/class-testimonials-widget-settings.php:495
|
425 |
-
#: includes/class-testimonials-widget.php:588
|
426 |
-
#: includes/class-testimonials-widget.php:1695
|
427 |
-
msgid "Email"
|
428 |
-
msgstr ""
|
429 |
-
|
430 |
-
#: includes/class-testimonials-widget-settings.php:496
|
431 |
-
#: includes/class-testimonials-widget.php:583
|
432 |
-
#: includes/class-testimonials-widget.php:1689
|
433 |
-
msgid "Location"
|
434 |
-
msgstr ""
|
435 |
-
|
436 |
-
#: includes/class-testimonials-widget-settings.php:497
|
437 |
-
#: includes/class-testimonials-widget.php:593
|
438 |
-
#: includes/class-testimonials-widget.php:1701
|
439 |
-
msgid "Company"
|
440 |
-
msgstr ""
|
441 |
-
|
442 |
-
#: includes/class-testimonials-widget-settings.php:498
|
443 |
-
#: includes/class-testimonials-widget.php:598
|
444 |
-
#: includes/class-testimonials-widget.php:1707
|
445 |
-
msgid "URL"
|
446 |
-
msgstr ""
|
447 |
-
|
448 |
-
#: includes/class-testimonials-widget-settings.php:505
|
449 |
-
msgid "ORDER BY Order"
|
450 |
-
msgstr ""
|
451 |
-
|
452 |
-
#: includes/class-testimonials-widget-settings.php:508
|
453 |
-
msgid "Descending"
|
454 |
-
msgstr ""
|
455 |
-
|
456 |
-
#: includes/class-testimonials-widget-settings.php:509
|
457 |
-
msgid "Ascending"
|
458 |
-
msgstr ""
|
459 |
-
|
460 |
-
#: includes/class-testimonials-widget-settings.php:523
|
461 |
-
msgid "Allow Comments?"
|
462 |
-
msgstr ""
|
463 |
-
|
464 |
-
#: includes/class-testimonials-widget-settings.php:524
|
465 |
-
msgid "Only affects the Testimonials post edit page. Your theme controls the front-end view."
|
466 |
-
msgstr ""
|
467 |
-
|
468 |
-
#: includes/class-testimonials-widget-settings.php:530
|
469 |
-
msgid "URL slug-name for <a href=\"%1s\">testimonials archive</a> page."
|
470 |
-
msgstr ""
|
471 |
-
|
472 |
-
#: includes/class-testimonials-widget-settings.php:536
|
473 |
-
msgid "Archive Page URL"
|
474 |
-
msgstr ""
|
475 |
-
|
476 |
-
#: includes/class-testimonials-widget-settings.php:543
|
477 |
-
msgid "URL slug-name for testimonial view pages. Shouldn't be the same as the Archive Page URL nor should it match a page URL slug."
|
478 |
-
msgstr ""
|
479 |
-
|
480 |
-
#: includes/class-testimonials-widget-settings.php:547
|
481 |
-
msgid "Testimonial Page URL"
|
482 |
-
msgstr ""
|
483 |
-
|
484 |
-
#: includes/class-testimonials-widget-settings.php:557
|
485 |
-
msgid "Hide ID?"
|
486 |
-
msgstr ""
|
487 |
-
|
488 |
-
#: includes/class-testimonials-widget-settings.php:574
|
489 |
-
msgid "Hide Shortcode?"
|
490 |
-
msgstr ""
|
491 |
-
|
492 |
-
#: includes/class-testimonials-widget-settings.php:628
|
493 |
-
msgid "Reset & Compatiblity Options"
|
494 |
-
msgstr ""
|
495 |
-
|
496 |
-
#: includes/class-testimonials-widget-settings.php:634
|
497 |
-
msgid "Don't Use Default Taxonomies?"
|
498 |
-
msgstr ""
|
499 |
-
|
500 |
-
#: includes/class-testimonials-widget-settings.php:637
|
501 |
-
msgid "If checked, use Testimonials' own category and tag taxonomies instead"
|
502 |
-
msgstr ""
|
503 |
-
|
504 |
-
#: includes/class-testimonials-widget-settings.php:645
|
505 |
-
msgid "Version Based Options"
|
506 |
-
msgstr ""
|
507 |
-
|
508 |
-
#: includes/class-testimonials-widget-settings.php:651
|
509 |
-
msgid "Use bxSlider?"
|
510 |
-
msgstr ""
|
511 |
-
|
512 |
-
#: includes/class-testimonials-widget-settings.php:652
|
513 |
-
msgid "Pre 2.15.0, Testimonials' used custom JavaScript for transitions."
|
514 |
-
msgstr ""
|
515 |
-
|
516 |
-
#: includes/class-testimonials-widget-settings.php:665
|
517 |
-
msgid "Disable Animation?"
|
518 |
-
msgstr ""
|
519 |
-
|
520 |
-
#: includes/class-testimonials-widget-settings.php:666
|
521 |
-
msgid "Pre 2.15.0, Disable animation between testimonial transitions. Useful when stacking widgets."
|
522 |
-
msgstr ""
|
523 |
-
|
524 |
-
#: includes/class-testimonials-widget-settings.php:674
|
525 |
-
msgid "Fade Out Speed"
|
526 |
-
msgstr ""
|
527 |
-
|
528 |
-
#: includes/class-testimonials-widget-settings.php:675
|
529 |
-
#: includes/class-testimonials-widget-settings.php:683
|
530 |
-
msgid "Pre 2.15.0, Transition duration in milliseconds; higher values indicate slower animations, not faster ones."
|
531 |
-
msgstr ""
|
532 |
-
|
533 |
-
#: includes/class-testimonials-widget-settings.php:682
|
534 |
-
msgid "Fade In Speed"
|
535 |
-
msgstr ""
|
536 |
-
|
537 |
-
#: includes/class-testimonials-widget-settings.php:690
|
538 |
-
msgid "Height"
|
539 |
-
msgstr ""
|
540 |
-
|
541 |
-
#: includes/class-testimonials-widget-settings.php:691
|
542 |
-
msgid "Pre 2.15.0, Testimonials height, in pixels. Overrides minimum and maximum height"
|
543 |
-
msgstr ""
|
544 |
-
|
545 |
-
#: includes/class-testimonials-widget-settings.php:697
|
546 |
-
msgid "Minimum Height"
|
547 |
-
msgstr ""
|
548 |
-
|
549 |
-
#: includes/class-testimonials-widget-settings.php:698
|
550 |
-
msgid "Pre 2.15.0, Set for minimum display height, in pixels"
|
551 |
-
msgstr ""
|
552 |
-
|
553 |
-
#: includes/class-testimonials-widget-settings.php:704
|
554 |
-
msgid "Maximum Height"
|
555 |
-
msgstr ""
|
556 |
-
|
557 |
-
#: includes/class-testimonials-widget-settings.php:705
|
558 |
-
msgid "Pre 2.15.0, Set for maximum display height, in pixels"
|
559 |
-
msgstr ""
|
560 |
-
|
561 |
-
#: includes/class-testimonials-widget-settings.php:929
|
562 |
-
msgid "These Testimonials Settings establish the default option values for shortcodes, theme functions, and widget instances. Widgets, once created no longer inherit these global settings. Therefore, you'll need to update each widget with the new settings. It might be easier to delete the widget and then recreate it."
|
563 |
-
msgstr ""
|
564 |
-
|
565 |
-
#: includes/class-testimonials-widget-settings.php:931
|
566 |
-
msgid "Shortcode option names are listed below each entry."
|
567 |
-
msgstr ""
|
568 |
-
|
569 |
-
#: includes/class-testimonials-widget-settings.php:934
|
570 |
-
msgid "View the <a href=\"%s\">Testimonials documentation</a>."
|
571 |
-
msgstr ""
|
572 |
-
|
573 |
-
#: includes/class-testimonials-widget-settings.php:944
|
574 |
-
msgid "Show or hide optional fields."
|
575 |
-
msgstr ""
|
576 |
-
|
577 |
-
#: includes/class-testimonials-widget-settings.php:952
|
578 |
-
msgid "Options used to select testimonials."
|
579 |
-
msgstr ""
|
580 |
-
|
581 |
-
#: includes/class-testimonials-widget-settings.php:960
|
582 |
-
msgid "Options used to determine displayed testimonials ordering."
|
583 |
-
msgstr ""
|
584 |
-
|
585 |
-
#: includes/class-testimonials-widget-settings.php:968
|
586 |
-
msgid "Options related to showing testimonials in widgets."
|
587 |
-
msgstr ""
|
588 |
-
|
589 |
-
#: includes/class-testimonials-widget-settings.php:976
|
590 |
-
msgid "Archive and singular page URL related testimonials options."
|
591 |
-
msgstr ""
|
592 |
-
|
593 |
-
#: includes/class-testimonials-widget-settings.php:984
|
594 |
-
msgid "Allowed columns to display on edit page."
|
595 |
-
msgstr ""
|
596 |
-
|
597 |
-
#: includes/class-testimonials-widget-settings.php:991
|
598 |
-
msgid "Compatibility & Reset"
|
599 |
-
msgstr ""
|
600 |
-
|
601 |
-
#: includes/class-testimonials-widget-settings.php:992
|
602 |
-
msgid "Backwards compatibility, import/export options, and reset options."
|
603 |
-
msgstr ""
|
604 |
-
|
605 |
-
#: includes/class-testimonials-widget-widget.php:30
|
606 |
-
msgid "Display testimonials with multiple selection and display options"
|
607 |
-
msgstr ""
|
608 |
-
|
609 |
-
#: includes/class-testimonials-widget-widget.php:96
|
610 |
-
msgid "CSS Class"
|
611 |
-
msgstr ""
|
612 |
-
|
613 |
-
#: includes/class-testimonials-widget-widget.php:97
|
614 |
-
msgid "This widget's unique CSS class for styling"
|
615 |
-
msgstr ""
|
616 |
-
|
617 |
-
#: includes/class-testimonials-widget.php:143
|
618 |
-
#: includes/class-testimonials-widget.php:2050
|
619 |
-
msgid "Testimonials Shortcode Examples"
|
620 |
-
msgstr ""
|
621 |
-
|
622 |
-
#: includes/class-testimonials-widget.php:143
|
623 |
-
msgid "E.g. Shortcodes"
|
624 |
-
msgstr ""
|
625 |
-
|
626 |
-
#: includes/class-testimonials-widget.php:334
|
627 |
-
msgid "If your Testimonials display has gone to funky town, please <a href=\"%s\">read the FAQ</a> about possible CSS fixes."
|
628 |
-
msgstr ""
|
629 |
-
|
630 |
-
#: includes/class-testimonials-widget.php:548
|
631 |
-
msgid "Published by"
|
632 |
-
msgstr ""
|
633 |
-
|
634 |
-
#: includes/class-testimonials-widget.php:554
|
635 |
-
#: includes/class-testimonials-widget.php:557
|
636 |
-
msgid "Category"
|
637 |
-
msgstr ""
|
638 |
-
|
639 |
-
#: includes/class-testimonials-widget.php:555
|
640 |
-
#: includes/class-testimonials-widget.php:558
|
641 |
-
msgid "Tags"
|
642 |
-
msgstr ""
|
643 |
-
|
644 |
-
#: includes/class-testimonials-widget.php:563
|
645 |
-
msgid "ID"
|
646 |
-
msgstr ""
|
647 |
-
|
648 |
-
#: includes/class-testimonials-widget.php:568
|
649 |
-
msgid "Image"
|
650 |
-
msgstr ""
|
651 |
-
|
652 |
-
#: includes/class-testimonials-widget.php:573
|
653 |
-
msgid "Shortcodes"
|
654 |
-
msgstr ""
|
655 |
-
|
656 |
-
#: includes/class-testimonials-widget.php:609
|
657 |
-
msgid "Add New"
|
658 |
-
msgstr ""
|
659 |
-
|
660 |
-
#: includes/class-testimonials-widget.php:610
|
661 |
-
#: includes/class-testimonials-widget.php:613
|
662 |
-
msgid "Add New Testimonial"
|
663 |
-
msgstr ""
|
664 |
-
|
665 |
-
#: includes/class-testimonials-widget.php:611
|
666 |
-
msgid "Edit Testimonial"
|
667 |
-
msgstr ""
|
668 |
-
|
669 |
-
#: includes/class-testimonials-widget.php:614
|
670 |
-
#: includes/class-testimonials-widget.php:1040
|
671 |
-
msgid "No testimonials found"
|
672 |
-
msgstr ""
|
673 |
-
|
674 |
-
#: includes/class-testimonials-widget.php:615
|
675 |
-
msgid "No testimonials found in Trash"
|
676 |
-
msgstr ""
|
677 |
-
|
678 |
-
#: includes/class-testimonials-widget.php:617
|
679 |
-
msgid "Search Testimonials"
|
680 |
-
msgstr ""
|
681 |
-
|
682 |
-
#: includes/class-testimonials-widget.php:618
|
683 |
-
#: includes/class-testimonials-widget.php:1795
|
684 |
-
msgid "Testimonial"
|
685 |
-
msgstr ""
|
686 |
-
|
687 |
-
#: includes/class-testimonials-widget.php:619
|
688 |
-
msgid "View Testimonial"
|
689 |
-
msgstr ""
|
690 |
-
|
691 |
-
#: includes/class-testimonials-widget.php:1206
|
692 |
-
msgid "…"
|
693 |
-
msgstr ""
|
694 |
-
|
695 |
-
#: includes/class-testimonials-widget.php:1413
|
696 |
-
msgid "«"
|
697 |
-
msgstr ""
|
698 |
-
|
699 |
-
#: includes/class-testimonials-widget.php:1421
|
700 |
-
msgid "»"
|
701 |
-
msgstr ""
|
702 |
-
|
703 |
-
#: includes/class-testimonials-widget.php:1719
|
704 |
-
msgid "Testimonial Data"
|
705 |
-
msgstr ""
|
706 |
-
|
707 |
-
#: includes/class-testimonials-widget.php:1744
|
708 |
-
msgid "Enter title here"
|
709 |
-
msgstr ""
|
710 |
-
|
711 |
-
#: includes/class-testimonials-widget.php:1745
|
712 |
-
msgid "Enter testimonial source here"
|
713 |
-
msgstr ""
|
714 |
-
|
715 |
-
#: includes/class-testimonials-widget.php:1770
|
716 |
-
msgid "Testimonial updated. <a href=\"%s\">View testimonial</a>"
|
717 |
-
msgstr ""
|
718 |
-
|
719 |
-
#: includes/class-testimonials-widget.php:1771
|
720 |
-
msgid "Custom field updated."
|
721 |
-
msgstr ""
|
722 |
-
|
723 |
-
#: includes/class-testimonials-widget.php:1772
|
724 |
-
msgid "Custom field deleted."
|
725 |
-
msgstr ""
|
726 |
-
|
727 |
-
#: includes/class-testimonials-widget.php:1773
|
728 |
-
msgid "Testimonial updated."
|
729 |
-
msgstr ""
|
730 |
-
|
731 |
-
#. translators: %s: date and time of the revision
|
732 |
-
|
733 |
-
#: includes/class-testimonials-widget.php:1775
|
734 |
-
msgid "Testimonial restored to revision from %s"
|
735 |
-
msgstr ""
|
736 |
-
|
737 |
-
#: includes/class-testimonials-widget.php:1776
|
738 |
-
msgid "Testimonial published. <a href=\"%s\">View testimonial</a>"
|
739 |
-
msgstr ""
|
740 |
-
|
741 |
-
#: includes/class-testimonials-widget.php:1777
|
742 |
-
msgid "Testimonial saved."
|
743 |
-
msgstr ""
|
744 |
-
|
745 |
-
#: includes/class-testimonials-widget.php:1778
|
746 |
-
msgid "Testimonial submitted. <a target=\"_blank\" href=\"%s\">Preview testimonial</a>"
|
747 |
-
msgstr ""
|
748 |
-
|
749 |
-
#: includes/class-testimonials-widget.php:1779
|
750 |
-
msgid "Testimonial scheduled for: <strong>%1$s</strong>. <a target=\"_blank\" href=\"%2$s\">Preview testimonial</a>"
|
751 |
-
msgstr ""
|
752 |
-
|
753 |
-
#: includes/class-testimonials-widget.php:1780
|
754 |
-
msgid "Testimonial draft updated. <a target=\"_blank\" href=\"%s\">Preview testimonial</a>"
|
755 |
-
msgstr ""
|
756 |
-
|
757 |
-
#: includes/class-testimonials-widget.php:2041
|
758 |
-
msgid "If your Testimonials display has gone to funky town, please <a href=\"%s\">read the FAQ</a> about possible fixes."
|
759 |
-
msgstr ""
|
760 |
-
|
761 |
-
#: includes/class-testimonials-widget.php:2096
|
762 |
-
msgid "Failed version check"
|
763 |
-
msgstr ""
|
764 |
-
|
765 |
-
#: includes/class-testimonials-widget.php:2127
|
766 |
-
msgid "Shortcode"
|
767 |
-
msgstr ""
|
768 |
-
|
769 |
-
#: includes/libraries/aihrus-framework/aihrus-framework.php:40
|
770 |
-
msgid "`aihr_check_aihrus_framework` requires $file argument"
|
771 |
-
msgstr ""
|
772 |
-
|
773 |
-
#: includes/libraries/aihrus-framework/aihrus-framework.php:83
|
774 |
-
#: includes/requirements.php:60
|
775 |
-
msgid "<a href=\"%1$s\">Update plugins</a>. <a href=\"%2$s\">More information</a>."
|
776 |
-
msgstr ""
|
777 |
-
|
778 |
-
#: includes/libraries/aihrus-framework/aihrus-framework.php:94
|
779 |
-
msgid "Plugin \"%1$s\" is causing the out of date issue."
|
780 |
-
msgstr ""
|
781 |
-
|
782 |
-
#: includes/libraries/aihrus-framework/aihrus-framework.php:99
|
783 |
-
msgid "Plugin \"%1$s\" has been deactivated as it requires Aihrus Framework %2$s or newer. You're running Aihrus Framework %4$s. Once corrected, \"%1$s\" can be activated. %5$s %3$s"
|
784 |
-
msgstr ""
|
785 |
-
|
786 |
-
#: includes/libraries/aihrus-framework/aihrus-framework.php:108
|
787 |
-
msgid "`aihr_check_php` requires $file argument"
|
788 |
-
msgstr ""
|
789 |
-
|
790 |
-
#: includes/libraries/aihrus-framework/aihrus-framework.php:147
|
791 |
-
msgid "Plugin \"%1$s\" has been deactivated as it requires PHP %2$s or newer. You're running PHP %4$s. Once corrected, \"%1$s\" can be activated. <a href=\"%3$s\">More information</a>."
|
792 |
-
msgstr ""
|
793 |
-
|
794 |
-
#: includes/libraries/aihrus-framework/aihrus-framework.php:156
|
795 |
-
msgid "`aihr_check_wp` requires $file argument"
|
796 |
-
msgstr ""
|
797 |
-
|
798 |
-
#: includes/libraries/aihrus-framework/aihrus-framework.php:199
|
799 |
-
msgid "Plugin \"%1$s\" has been deactivated as it requires WordPress %2$s or newer. You're running WordPress %4$s. Once corrected, \"%1$s\" can be activated. <a href=\"%3$s\">Update WordPress</a>."
|
800 |
-
msgstr ""
|
801 |
-
|
802 |
-
#: includes/libraries/aihrus-framework/aihrus-framework.php:229
|
803 |
-
msgid "<a href=\"%1$s\">update to</a>"
|
804 |
-
msgstr ""
|
805 |
-
|
806 |
-
#: includes/libraries/aihrus-framework/aihrus-framework.php:234
|
807 |
-
msgid "<a href=\"%1$s\">install</a>"
|
808 |
-
msgstr ""
|
809 |
-
|
810 |
-
#: includes/libraries/aihrus-framework/aihrus-framework.php:237
|
811 |
-
msgid "<a href=\"%1$s\">activate</a>"
|
812 |
-
msgstr ""
|
813 |
-
|
814 |
-
#: includes/libraries/aihrus-framework/aihrus-framework.php:241
|
815 |
-
msgid "Plugin \"%3$s\" has been deactivated. Please %1$s \"%4$s\" version %2$s or newer before activating \"%3$s\"."
|
816 |
-
msgstr ""
|
817 |
-
|
818 |
-
#: includes/libraries/aihrus-framework/aihrus-framework.php:254
|
819 |
-
msgid "<a href=\"%1$s\">%2$s > Settings</a>, <em>Premium</em> tab, <em>License Key</em> entry"
|
820 |
-
msgstr ""
|
821 |
-
|
822 |
-
#: includes/libraries/aihrus-framework/aihrus-framework.php:259
|
823 |
-
msgid "<a href=\"%s\">Where's my license key?</a>"
|
824 |
-
msgstr ""
|
825 |
-
|
826 |
-
#: includes/libraries/aihrus-framework/aihrus-framework.php:264
|
827 |
-
msgid "<a href=\"%1$s\">%2$s</a>"
|
828 |
-
msgstr ""
|
829 |
-
|
830 |
-
#: includes/libraries/aihrus-framework/aihrus-framework.php:268
|
831 |
-
msgid "Plugin \"%1$s\" requires license activation before updating will work. Please activate the license key through %2$s. No license key? See \"%3$s\" or purchase \"%4$s\"."
|
832 |
-
msgstr ""
|
833 |
-
|
834 |
-
#: includes/libraries/aihrus-framework/aihrus-framework.php:279
|
835 |
-
msgid "`aihr_deactivate_plugin` requires $file argument"
|
836 |
-
msgstr ""
|
837 |
-
|
838 |
-
#: includes/libraries/aihrus-framework/aihrus-framework.php:318
|
839 |
-
msgid "Unknown"
|
840 |
-
msgstr ""
|
841 |
-
|
842 |
-
#: includes/libraries/aihrus-framework/aihrus-framework.php:321
|
843 |
-
msgid "Plugin \"%1$s\" has been deactivated due to \"%2$s\". Once corrected, \"%1$s\" can be activated."
|
844 |
-
msgstr ""
|
845 |
-
|
846 |
-
#: includes/libraries/aihrus-framework/aihrus-framework.php:332
|
847 |
-
msgid "`aihr_deactivate_plugin_do` requires $file argument"
|
848 |
-
msgstr ""
|
849 |
-
|
850 |
-
#: includes/libraries/aihrus-framework/includes/class-aihrus-common.php:156
|
851 |
-
msgid "Please donate $5 towards ongoing free support and development of the \"%1$s\" plugin. %2$s"
|
852 |
-
msgstr ""
|
853 |
-
|
854 |
-
#: includes/libraries/aihrus-framework/includes/class-aihrus-settings.php:62
|
855 |
-
msgid "Reset"
|
856 |
-
msgstr ""
|
857 |
-
|
858 |
-
#: includes/libraries/aihrus-framework/includes/class-aihrus-settings.php:63
|
859 |
-
msgid "About"
|
860 |
-
msgstr ""
|
861 |
-
|
862 |
-
#: includes/libraries/aihrus-framework/includes/class-aihrus-settings.php:81
|
863 |
-
msgid "Export Settings"
|
864 |
-
msgstr ""
|
865 |
-
|
866 |
-
#: includes/libraries/aihrus-framework/includes/class-aihrus-settings.php:83
|
867 |
-
msgid "These are your current settings in a serialized format. Copy the contents to make a backup of your settings."
|
868 |
-
msgstr ""
|
869 |
-
|
870 |
-
#: includes/libraries/aihrus-framework/includes/class-aihrus-settings.php:91
|
871 |
-
msgid "Import Settings"
|
872 |
-
msgstr ""
|
873 |
-
|
874 |
-
#: includes/libraries/aihrus-framework/includes/class-aihrus-settings.php:93
|
875 |
-
msgid "Paste new serialized settings here to overwrite your current configuration."
|
876 |
-
msgstr ""
|
877 |
-
|
878 |
-
#: includes/libraries/aihrus-framework/includes/class-aihrus-settings.php:97
|
879 |
-
msgid "Delete all %s data and options from database on plugin deletion. Even if this option isn't checked, WordPress will still give a data deletion warning."
|
880 |
-
msgstr ""
|
881 |
-
|
882 |
-
#: includes/libraries/aihrus-framework/includes/class-aihrus-settings.php:101
|
883 |
-
msgid "Remove Plugin Data on Deletion?"
|
884 |
-
msgstr ""
|
885 |
-
|
886 |
-
#: includes/libraries/aihrus-framework/includes/class-aihrus-settings.php:110
|
887 |
-
msgid "Reset to Defaults?"
|
888 |
-
msgstr ""
|
889 |
-
|
890 |
-
#: includes/libraries/aihrus-framework/includes/class-aihrus-settings.php:113
|
891 |
-
msgid "Check this box to reset options to their defaults"
|
892 |
-
msgstr ""
|
893 |
-
|
894 |
-
#: includes/libraries/aihrus-framework/includes/class-aihrus-settings.php:237
|
895 |
-
msgid "<img class=\"alignright size-medium\" src=\"%1$simages/michael-cannon-red-square-300x2251.jpg\" alt=\"Michael in Red Square, Moscow, Russia\" width=\"300\" height=\"225\" /><a href=\"%2$s\">%3$s</a> is by <a href=\"%4$s\">Michael Cannon</a>. He's <a href=\"%5$s\">Peichi’s</a> smiling man, an adventurous <a href=\"%6$s\" target=\"_blank\">water-rat</a>, <a href=\"%7$s\">chief people officer</a>, <a href=\"%8$s\">cyclist</a>, <a href=\"%9$s\">full stack developer</a>, <a href=\"%10$s\">poet</a>, <a href=\"%11$s\">WWOOF’er</a> and <a href=\"%12$s\">world traveler</a>."
|
896 |
-
msgstr ""
|
897 |
-
|
898 |
-
#: includes/libraries/aihrus-framework/includes/class-aihrus-settings.php:280
|
899 |
-
msgid "Save Changes"
|
900 |
-
msgstr ""
|
901 |
-
|
902 |
-
#: includes/libraries/aihrus-framework/includes/class-aihrus-settings.php:288
|
903 |
-
msgid "If you like this plugin, please <a href=\"%1$s\" title=\"Donate for Good Karma\"><img src=\"%2$s\" border=\"0\" alt=\"Donate for Good Karma\" /></a> or <a href=\"%3$s\" title=\"purchase premium WordPress plugins from Aihrus \">purchase the Premium version</a> to help fund further development and <a href=\"%4$s\" title=\"Support forums\">support</a>."
|
904 |
-
msgstr ""
|
905 |
-
|
906 |
-
#: includes/libraries/aihrus-framework/includes/class-aihrus-settings.php:299
|
907 |
-
msgid "Copyright ©%1$s <a href=\"%2$s\">Aihrus</a>."
|
908 |
-
msgstr ""
|
909 |
-
|
910 |
-
#: includes/libraries/aihrus-framework/includes/class-aihrus-settings.php:581
|
911 |
-
msgid "Settings saved."
|
912 |
-
msgstr ""
|
913 |
-
|
914 |
-
#: includes/libraries/aihrus-framework/includes/class-aihrus-settings.php:638
|
915 |
-
msgid "Required"
|
916 |
-
msgstr ""
|
917 |
-
|
918 |
-
#: includes/libraries/aihrus-framework/includes/class-aihrus-widget.php:133
|
919 |
-
msgid "Expand/Collapse All Options"
|
920 |
-
msgstr ""
|
921 |
-
|
922 |
-
#: includes/libraries/aihrus-framework/includes/class-aihrus-widget.php:142
|
923 |
-
msgid "Expand/Collapse"
|
924 |
-
msgstr ""
|
925 |
-
|
926 |
-
#: includes/requirements.php:30
|
927 |
-
msgid "Missing Aihrus Framework"
|
928 |
-
msgstr ""
|
929 |
-
|
930 |
-
#: includes/requirements.php:33
|
931 |
-
msgid "Old Aihrus Framework version detected"
|
932 |
-
msgstr ""
|
933 |
-
|
934 |
-
#: includes/requirements.php:37
|
935 |
-
msgid "Old PHP version detected"
|
936 |
-
msgstr ""
|
937 |
-
|
938 |
-
#: includes/requirements.php:41
|
939 |
-
msgid "Old WordPress version detected"
|
940 |
-
msgstr ""
|
941 |
-
|
942 |
-
#: includes/requirements.php:62
|
943 |
-
msgid "Plugin \"%1$s\" has been deactivated as it requires a current Aihrus Framework. Once corrected, \"%1$s\" can be activated. %2$s"
|
944 |
-
msgstr ""
|
945 |
-
#. Plugin Name of the plugin/theme
|
946 |
-
msgid "Testimonials by Aihrus"
|
947 |
-
msgstr ""
|
948 |
-
|
949 |
-
#. Plugin URI of the plugin/theme
|
950 |
-
msgid "http://wordpress.org/plugins/testimonials-widget/"
|
951 |
-
msgstr ""
|
952 |
-
|
953 |
-
#. Description of the plugin/theme
|
954 |
-
msgid "Testimonials by Aihrus lets you randomly slide or list selected portfolios, quotes, reviews, or text with images or videos on your WordPress site."
|
955 |
-
msgstr ""
|
956 |
-
|
957 |
-
#. Author of the plugin/theme
|
958 |
-
msgid "Michael Cannon"
|
959 |
-
msgstr ""
|
960 |
-
|
961 |
-
#. Author URI of the plugin/theme
|
962 |
-
msgid "http://aihr.us/resume/"
|
963 |
-
msgstr ""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trunk/readme.txt
DELETED
@@ -1,588 +0,0 @@
|
|
1 |
-
=== Testimonials by Aihrus ===
|
2 |
-
|
3 |
-
Contributors: comprock
|
4 |
-
Donate link: http://aihr.us/about-aihrus/donate/
|
5 |
-
Tags: client, customer, portfolio, quotations, quote, quotes, random, recommendation, reference, review, reviews, testimonial, testimonials, testimony, wpml
|
6 |
-
Requires at least: 3.6
|
7 |
-
Tested up to: 3.9.0
|
8 |
-
Stable tag: 2.19.1
|
9 |
-
License: GPLv2 or later
|
10 |
-
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
-
|
12 |
-
Testimonials by Aihrus lets you randomly slide or list selected portfolios, quotes, reviews, or text with images or videos on your WordPress site.
|
13 |
-
|
14 |
-
|
15 |
-
== Description ==
|
16 |
-
|
17 |
-
Testimonials [by Aihrus](http://aihr.us/about-aihrus/) lets you randomly slide or list selected portfolios, quotes, reviews, or text with images or videos on your WordPress site. You can insert Testimonials content via shortcode, theme functions, or widgets with category and tag selections and having multiple display options such as random or specific ordering. Further, [Review schema](http://schema.org/Review) for improved search engine results is built-in.
|
18 |
-
|
19 |
-
[youtube https://www.youtube.com/watch?v=bhUhuQ-2m8s]
|
20 |
-
|
21 |
-
**[Video introduction](https://www.youtube.com/watch?v=bhUhuQ-2m8s)**
|
22 |
-
|
23 |
-
**View a [Live Testimonials Demo](http://aihr.us/good-work-deserves-good-words-testimonials-examples/)**
|
24 |
-
|
25 |
-
= Testimonials Is Way Beyond Being Just a Testimonials Slider! =
|
26 |
-
|
27 |
-
* Slide Images - responsive image slideshow
|
28 |
-
* Slide Videos - video slideshow
|
29 |
-
* Slide Text - useful for rotating testimonials
|
30 |
-
* Slide Mixed Content: slideshow having video slides, images slides, and text slides. Each individual slide can also have mixed content.
|
31 |
-
* Shortcode compatible - slide content that is rendered using shortcodes. i.e. stock Worpdress Galleries and Gravity Forms
|
32 |
-
* Widget ready
|
33 |
-
* Shortcode ready
|
34 |
-
* Random display
|
35 |
-
* Fade and slide transitions
|
36 |
-
* Filter slideshow content by WordPress' built in categories, tags, or post-ID
|
37 |
-
|
38 |
-
More than one Testimonials shortcode or widget instance can be displayed at a time 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 Testimonial widget has its own CSS identifier for custom styling.
|
39 |
-
|
40 |
-
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.
|
41 |
-
|
42 |
-
Through categories and tagging, you can create organizational structures based upon products, projects and services via categories and then apply tagging for further classification. 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 instance to show only Portfolio testimonials with the public and enterprise tags. In another Testimonial instance, you can also select only Portfolio testimonials, but then allow web and media tags.
|
43 |
-
|
44 |
-
The single testimonial view supports image, source, title, location, email, company and URL details with optional Review schema.
|
45 |
-
|
46 |
-
= Primary Features =
|
47 |
-
|
48 |
-
* API to manipulate testimonials output and selection
|
49 |
-
* Admin interface to add, edit and manage testimonials
|
50 |
-
* Capable of handling multiple widgets per page or post
|
51 |
-
* Fields for source, testimonial, image, title, location, email, company and URL details
|
52 |
-
* Minimalist CSS styling for easier theming
|
53 |
-
* Multiple paging options for testimonials listings
|
54 |
-
* Schema.org microdata format for improved search engine results
|
55 |
-
* Settings export/import
|
56 |
-
* Settings screen for site-wide option defaults
|
57 |
-
* Shortcodes and theme functions for listings and rotation
|
58 |
-
* Single testimonial view includes image, source, title, location, email, company and URL details
|
59 |
-
* Testimonials archive view
|
60 |
-
* Use custom taxonomy or WordPress's own for categories and tags
|
61 |
-
* Uses [bxSlider](http://bxslider.com) for transitions
|
62 |
-
|
63 |
-
= Shortcodes =
|
64 |
-
|
65 |
-
* `[[testimonials]]` - Listings with paging
|
66 |
-
* `[[testimonials_slider]]` - Rotating
|
67 |
-
|
68 |
-
= Theme Functions =
|
69 |
-
|
70 |
-
* `testimonials()` - Testimonials listing with paging
|
71 |
-
* `testimonials_slider()` - Rotating testimonials
|
72 |
-
|
73 |
-
= Testimonials Migration Helpers =
|
74 |
-
* Testimonials Widget pre 2.0.0 - Upgrading is automatic
|
75 |
-
* [GC Testimonials](http://wordpress.org/plugins/gc-testimonials-to-testimonials/)
|
76 |
-
* [Testimonials by WooThemes](http://wordpress.org/plugins/wootheme-testimonials-to-testimonials/)
|
77 |
-
|
78 |
-
= Testimonials Premium =
|
79 |
-
|
80 |
-
Testimonials Premium adds onto the best WordPress testimonials plugin there is, [Testimonials](http://wordpress.org/extend/plugins/testimonials-widget/). Testimonials Premium offers [caching, excerpts, filters, read more links](http://aihr.us/products/testimonials-premium-wordpress-plugin/), more selection options, and advanced capabilities like using custom post types as testimonials. Additionally, testimonials support ratings and users can submit their own testimonials via a front-end form shortcode or widget.
|
81 |
-
|
82 |
-
[Buy Testimonials Premium](http://aihr.us/products/testimonials-premium-wordpress-plugin/) plugin for WordPress.
|
83 |
-
|
84 |
-
= Primary Premium Features =
|
85 |
-
|
86 |
-
* Akismet, math-based CAPTCHA, and more anti-spam traps
|
87 |
-
* Alternate destinations for "Read more" links
|
88 |
-
* Auto rotate testimonials by page
|
89 |
-
* CSS or HTML table based testimonials submissions form layout
|
90 |
-
* Caching of testimonials queries and content to decrease server load time improve page loading speed by 1/10 to 1/2 a second
|
91 |
-
* Carousel mode for rotating multiple testimonials at the same time
|
92 |
-
* Displays ratings to grant testimonials more power!
|
93 |
-
* Excerpts for widget view, with read more link to complete testimonial
|
94 |
-
* Front-end entry form for user supplied testimonials. **[Live form demo](http://aihr.us/about-aihrus/testimonials/add-testimonial/)**
|
95 |
-
* Select only testimonials with excerpts, images or of arbitrary maximum and minimum length
|
96 |
-
* Show unique testimonials when displaying multiple testimonial instances
|
97 |
-
|
98 |
-
= Premium Shortcodes =
|
99 |
-
|
100 |
-
* Count of testimonials `[[testimonials_count]]`
|
101 |
-
* List of testimonial source and title linking to full entry `[[testimonials_links]]`
|
102 |
-
* Testimonials entry form `[[testimonials_form]]`
|
103 |
-
|
104 |
-
= Premium Theme Functions =
|
105 |
-
|
106 |
-
* `<?php echo testimonials_count( $args ); ?>`
|
107 |
-
* `<?php echo testimonials_form( $args ); ?>`
|
108 |
-
* `<?php echo testimonials_links( $args ); ?>`
|
109 |
-
|
110 |
-
[Buy Testimonials Premium](http://aihr.us/products/testimonials-premium-wordpress-plugin/) plugin for WordPress.
|
111 |
-
|
112 |
-
= Additional Features =
|
113 |
-
|
114 |
-
* Adjustable animation speed
|
115 |
-
* Archive Page URL and Testimonial Page URL are prevented from being the same or matching existing pages.
|
116 |
-
* Auto-suggest for category and tag options
|
117 |
-
* Automatic linking of email and URL fields via source or company fields
|
118 |
-
* Clickable widget titles
|
119 |
-
* Commenting on testimonial single-view pages
|
120 |
-
* Compatible with WordPress multisite
|
121 |
-
* Configuration based validation for easy extending or overriding
|
122 |
-
* Content truncation respects HTML tags
|
123 |
-
* Custom CSS in footer for HTML validation
|
124 |
-
* Custom text or HTML for bottom of widgets
|
125 |
-
* Custom widget bottom text
|
126 |
-
* Customizable archive and testimonial URLs
|
127 |
-
* Customizable testimonial data field `testimonial_extra`
|
128 |
-
* Deletes testimonials-widget custom post type entries and settings on uninstall
|
129 |
-
* Disable self-generated quotation marks
|
130 |
-
* Easily label and link to reviewed item for Review schema
|
131 |
-
* Easy to configure Next and Previous page indicators
|
132 |
-
* Editors and admins can edit testimonial publisher
|
133 |
-
* Flush URLs on deactivation
|
134 |
-
* Gravatars saved as featured images
|
135 |
-
* IDs column shown in testimonials edit page
|
136 |
-
* IE7 CSS hacks for quotes and join parts
|
137 |
-
* Image, email based Gravatar, category and tag enabled
|
138 |
-
* Internal version tracking for compatibility checks and automatic settings update
|
139 |
-
* Localizable via `languages/testimonials-widget.pot`
|
140 |
-
* Optional commenting on testimonial single-view pages
|
141 |
-
* Performance optimizations
|
142 |
-
* Respects meta capabilities
|
143 |
-
* Rotation JavaScript in footer than body
|
144 |
-
* Settings page contextual help
|
145 |
-
* Shortcode helpers on category and tag admin screens
|
146 |
-
* Shortcodes allowed inside of testimonials content
|
147 |
-
* Supports [WP-PageNavi](http://wordpress.org/extend/plugins/wp-pagenavi/)
|
148 |
-
* Testimonial content supports HTML
|
149 |
-
* Testimonial, email, and URL fields are clickable – URL requires `http://` or `https://` prefix
|
150 |
-
* Testimonials output is completely customizable via filters
|
151 |
-
* Testimonials support styling based upon CSS classes for category, tags and post id
|
152 |
-
* Testimonials widget displays static and rotating testimonials
|
153 |
-
* Unique CSS class per widget
|
154 |
-
* URLs can be opened in new windows
|
155 |
-
* WordPress Multilingual enabled [WPML](http://wpml.org/)
|
156 |
-
|
157 |
-
= Shortcode Examples =
|
158 |
-
|
159 |
-
**[[testimonials]]**
|
160 |
-
|
161 |
-
* `[[testimonials category="category-name"]]` - Testimonial list by category
|
162 |
-
* `[[testimonials category=product hide_not_found=true]]` - Testimonial list by category and hide "No testimonials found" message
|
163 |
-
* `[[testimonials category=product tags=widget limit=5]]` - Testimonial list by tag, showing 5 at most
|
164 |
-
* `[[testimonials char_limit=0 limit=-1]]` - Show all testimonials on one page
|
165 |
-
* `[[testimonials char_limit=0 target=_new limit=3 disable_quotes=true]]` - Show 3 full-length testimonials, with opening and closing quote marks removed
|
166 |
-
* `[[testimonials hide_source=true hide_url=true]]` - Show testimonial list with source and urls hidden
|
167 |
-
* `[[testimonials ids="1,11,111" paging=false]]` - Show only these 3 testimonials
|
168 |
-
* `[[testimonials meta_key=testimonials-widget-company order=asc limit=15]]` - Show 15 testimonials, in company order
|
169 |
-
* `[[testimonials order=ASC orderby=title]]` - List testimonials by post title
|
170 |
-
* `[[testimonials tags="test,fun" random=true exclude="2,22,333"]]` - Select testimonials tagged with either "test" or "fun", in random order, but ignore those of the excluded ids
|
171 |
-
|
172 |
-
**[[testimonials_slider]]**
|
173 |
-
|
174 |
-
* `[[testimonials_slider category=product order=asc]]` - Show rotating testimonials, of the product category, lowest post ids first
|
175 |
-
* `[[testimonials_slider tags=sometag random=true]]` - Show rotating, random testimonials having tag "sometag"
|
176 |
-
|
177 |
-
= Shortcode and Widget Options =
|
178 |
-
|
179 |
-
Please keep in mind that inheritance affects options. This means that changes made to Testimonials > Settings will not affect current widget instance options. You must change the widget instance manually. However, if you create a new widget instance, then the global settings will apply.
|
180 |
-
|
181 |
-
Further, global settings are the baseline for shortcodes. If you want to alter the shortcode appearance, then alter the shortcode options directly.
|
182 |
-
|
183 |
-
**General**
|
184 |
-
|
185 |
-
* Enable Review Schema? – Adds HTML tag markup per the [Review schema](http://schema.org/Review) to testimonials. Search engines including Bing, Google, Yahoo! and Yandex rely on this markup to improve the display of search results.
|
186 |
-
* `enable_schema` - default true; enable_schema=false
|
187 |
-
* Default Reviewed Item? - Name of thing being referenced in testimonials
|
188 |
-
* `item_reviewed` - default "Site Title"
|
189 |
-
* Default Reviewed Item URL? - URL of thing being referenced in testimonials
|
190 |
-
* `item_reviewed_url` - default `network_site_url();`
|
191 |
-
* Hide built-in quotes? - Remove open and close quote span tags surrounding testimonial content
|
192 |
-
* `disable_quotes` - default false; disable_quotes=true
|
193 |
-
* Hide "Testimonials Not Found"?
|
194 |
-
* `hide_not_found` - default show; hide_not_found=true
|
195 |
-
* Hide Gravatar Image?
|
196 |
-
* `hide_gravatar` - default show; hide_gravatar=true
|
197 |
-
* Hide Image?
|
198 |
-
* `hide_image` - default show; hide_image=true
|
199 |
-
* Hide Image in Single View?
|
200 |
-
* `hide_image_single` - default show; hide_image_single=true
|
201 |
-
* Hide Testimonial Content?
|
202 |
-
* `hide_content` - default show; hide_content=true
|
203 |
-
* Hide Author/Source? - Don't display "Post Title" in cite
|
204 |
-
* `hide_source` - default show; hide_source=true
|
205 |
-
* Hide Email?
|
206 |
-
* `hide_email` - default show; hide_email=true
|
207 |
-
* Hide Job Title?
|
208 |
-
* `hide_title` - default show; hide_title=true
|
209 |
-
* Hide Location?
|
210 |
-
* `hide_location` - default show; hide_location=true
|
211 |
-
* Hide Company?
|
212 |
-
* `hide_company` - default show; hide_company=true
|
213 |
-
* Hide URL?
|
214 |
-
* `hide_url` - default show; hide_url=true
|
215 |
-
* Exclude bxSlider CSS? - For a bare-bones, unthemed slider.
|
216 |
-
* `exclude_bxslider_css` - default show; exclude_bxslider_css=true
|
217 |
-
* URL Target - Add target to all URLs; leave blank if none
|
218 |
-
* `target` - default none; target=_new
|
219 |
-
* Enable Paging? - for [[testimonials]]
|
220 |
-
* `paging` - default true [true|before|after|false]; paging=false
|
221 |
-
* `true` – display paging before and after testimonial entries
|
222 |
-
* `before` – display paging only before testimonial entries
|
223 |
-
* `after` – display paging only after testimonial entries
|
224 |
-
* Widget - Not functional
|
225 |
-
* Enable [shortcodes]? - If unchecked, shortcodes are stripped.
|
226 |
-
* `do_shortcode` - default false; do_shortcode=true
|
227 |
-
* Include IE7 CSS?
|
228 |
-
* Use `<q>` tag? – Not HTML5 compliant
|
229 |
-
* `use_quote_tag` - default none; use_quote_tag=true
|
230 |
-
* Remove `.hentry` CSS? – Some themes use class `.hentry` in a manner that breaks Testimonials' CSS and corrupts microdata parsing
|
231 |
-
* `remove_hentry` - default true; remove_hentry=false
|
232 |
-
|
233 |
-
**Selection**
|
234 |
-
|
235 |
-
* Category Filter - Comma separated category names
|
236 |
-
* `category` - default none; category=product or category="category-a, another-category"
|
237 |
-
* Tags Filter - Comma separated tag names
|
238 |
-
* `tags` - default none; tags=fire or tags="tag-a, another-tag"
|
239 |
-
* Require All Tags - Select only testimonials with all of the given tags
|
240 |
-
* `tags_all` - default OR; tags_all=true
|
241 |
-
* Include IDs Filter - Comma separated IDs
|
242 |
-
* `ids` - default none; ids=2 or ids="2,4,6"
|
243 |
-
* Exclude IDs Filter - Comma separated IDs
|
244 |
-
* `exclude` - default none; exclude=2 or exclude="2,4,6"
|
245 |
-
* Limit - Number of testimonials to rotate through via widget or show at a time when listing
|
246 |
-
* `limit` - default 10; limit=25
|
247 |
-
|
248 |
-
**Ordering**
|
249 |
-
|
250 |
-
* Random Order? - Unchecking this will rotate testimonials per ORDER BY and ORDER BY Order. Widgets are random by default automatically
|
251 |
-
* `random` - default none; random=true (overrides `order` and `orderby`)
|
252 |
-
* Widget = default true
|
253 |
-
* ORDER BY - Used when Random order is disabled
|
254 |
-
* `orderby` - [default ID](http://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters); orderby=title
|
255 |
-
* ORDER BY meta_key - Used when "Random Order" is disabled and sorting by a testimonials meta key is needed
|
256 |
-
* `meta_key` - default none [testimonials-widget-company|testimonials-widget-email|testimonials-widget-title|testimonials-widget-location|testimonials-widget-url]; meta_key=testimonials-widget-company
|
257 |
-
* ORDER BY Order - DESC or ASC
|
258 |
-
* `order` - [default DESC](http://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters); order=ASC
|
259 |
-
|
260 |
-
**Widget**
|
261 |
-
|
262 |
-
* Widget Title
|
263 |
-
* `title` - default "Testimonials"
|
264 |
-
* Title Link - URL or Post ID to link widget title to
|
265 |
-
* `title_link` - default none; title_link=123, title_link=http://example.com
|
266 |
-
* Character Limit - Number of characters to limit testimonial views to
|
267 |
-
* `char_limit` - default none; char_limit=200
|
268 |
-
* Widget - default 500
|
269 |
-
* Rotation speed - Seconds between testimonial rotations or 0 for no rotation at all
|
270 |
-
* `refresh_interval` - default 5; refresh_interval=0
|
271 |
-
* Transition Mode? - Type of transition between slides
|
272 |
-
* `transition_mode` - default fade; transition_mode=horizontal|vertical|fade
|
273 |
-
* Show Play/Pause? - Display start and stop buttons underneath the testimonial slider.
|
274 |
-
* `show_start_stop` - default true; show_start_stop=false
|
275 |
-
* Enable Video? - Only enable when displaying video content.
|
276 |
-
* `enable_video` - default false; enable_video=true
|
277 |
-
* Keep Whitespace? - Keeps testimonials looking as entered than sans auto-formatting
|
278 |
-
* `keep_whitespace` - default none; keep_whitespace=true
|
279 |
-
* The citation has no whitespace adaptations. It's straight text, except for email or URL links. The presentation is handled strictly by CSS.
|
280 |
-
* Testimonial Bottom Text - Custom text or HTML for bottom of testimonials
|
281 |
-
* `bottom_text` - default none; bottom_text="`<h3><a href="http://example.com">All testimonials</a></h3>`"
|
282 |
-
|
283 |
-
**Post Type**
|
284 |
-
|
285 |
-
* Allow Comments? – Only affects the Testimonials post edit page. Your theme controls the front-end view.
|
286 |
-
* Archive Page URL – URL slug-name for testimonials archive page. After changing, you must click "Save Changes" on Permalink Settings to update them.
|
287 |
-
* Testimonial Page URL – URL slug-name for testimonial view pages. After changing, you must click "Save Changes" on Permalink Settings to update them.
|
288 |
-
|
289 |
-
**Reset**
|
290 |
-
|
291 |
-
* Don't Use Default Taxonomies? – If checked, use Testimonials' own category and tag taxonomies instead
|
292 |
-
* Export Settings – These are your current settings in a serialized format. Copy the contents to make a backup of your settings.
|
293 |
-
* Import Settings – Paste new serialized settings here to overwrite your current configuration.
|
294 |
-
* Remove Plugin Data on Deletion? - Delete all Testimonials data and options from database on plugin deletion
|
295 |
-
* Reset to Defaults? – Check this box to reset options to their defaults
|
296 |
-
|
297 |
-
**Version Based Options**
|
298 |
-
|
299 |
-
* Use bxSlider? - Pre 2.15.0, Testimonials' used custom JavaScript for transitions.
|
300 |
-
* Disable Animation? - Disable animation between testimonial transitions. Useful when stacking.
|
301 |
-
* `disable_animation` - default false; disable_animation=true
|
302 |
-
* Fade Out Speed - Transition duration in milliseconds; higher values indicate slower animations, not faster ones.
|
303 |
-
* `fade_out_speed` - default 1250; fade_out_speed=400
|
304 |
-
* Fade In Speed - Transition duration in milliseconds; higher values indicate slower animations, not faster ones.
|
305 |
-
* `fade_in_speed` - default 500; fade_in_speed=800
|
306 |
-
* Height - Testimonials height, in pixels. Overrides minimum and maximum height
|
307 |
-
* `height` - default none; height=300
|
308 |
-
* Minimum Height - Set for minimum display height, in pixels
|
309 |
-
* `min_height` - default none; min_height=100
|
310 |
-
* Maximum Height - Set for maximum display height, in pixels
|
311 |
-
* `max_height` - default none; max_height=250
|
312 |
-
|
313 |
-
|
314 |
-
== Installation ==
|
315 |
-
|
316 |
-
= Requirements =
|
317 |
-
|
318 |
-
* [jQuery 1.10+](https://aihrus.zendesk.com/entries/23693363)
|
319 |
-
* PHP 5.3+ [Read notice](https://aihrus.zendesk.com/entries/30678006) – Since 2.16.0
|
320 |
-
|
321 |
-
= Install Methods =
|
322 |
-
|
323 |
-
* Through WordPress Admin > Plugins > Add New, Search for "Testimonials Widget"
|
324 |
-
* Find "Testimonials by Aihrus"
|
325 |
-
* Click "Install Now" of "Testimonials by Aihrus"
|
326 |
-
* Download [`testimonials-widget.zip`](http://downloads.wordpress.org/plugin/testimonials-widget.zip) locally
|
327 |
-
* Through WordPress Admin > Plugins > Add New
|
328 |
-
* Click Upload
|
329 |
-
* "Choose File" `testimonials-widget.zip`
|
330 |
-
* Click "Install Now"
|
331 |
-
* Download and unzip [`testimonials-widget.zip`](http://downloads.wordpress.org/plugin/testimonials-widget.zip) locally
|
332 |
-
* Using FTP, upload directory `testimonials-widget` to your website's `/wp-content/plugins/` directory
|
333 |
-
|
334 |
-
= Activation Options =
|
335 |
-
|
336 |
-
* Activate the "Testimonials" plugin after uploading
|
337 |
-
* Activate the "Testimonials" plugin through WordPress Admin > Plugins
|
338 |
-
|
339 |
-
= Usage =
|
340 |
-
|
341 |
-
1. Read [How do I create a testimonial record?](https://aihrus.zendesk.com/entries/30602506)
|
342 |
-
1. Add and manage testimonials through the "Testimonials" menu in the WordPress admin area
|
343 |
-
1. To display testimonials in the sidebar, go to "Widgets" menu and drag "Testimonials" widget into the desired widget area
|
344 |
-
1. Configure "Testimonials" to select quotes and display as needed
|
345 |
-
1. Use the `[[testimonials]]` or `[[testimonials_slider]]` shortcodes to display testimonials on a page or in a post
|
346 |
-
1. Read [theme functions usage](https://aihrus.zendesk.com/entries/23702878) for `testimonials()` and `testimonials_slider()`
|
347 |
-
|
348 |
-
= Upgrading =
|
349 |
-
|
350 |
-
* Through WordPress
|
351 |
-
* Via WordPress Admin > Dashboard > Updates, click "Check Again"
|
352 |
-
* Select plugins for update, click "Update Plugins"
|
353 |
-
* Using FTP
|
354 |
-
* Download and unzip [`testimonials-widget.zip`](http://downloads.wordpress.org/plugin/testimonials-widget.zip) locally
|
355 |
-
* Upload directory `testimonials-widget` to your website's `/wp-content/plugins/` directory
|
356 |
-
* Be sure to overwrite your existing `testimonials-widget` folder contents
|
357 |
-
|
358 |
-
|
359 |
-
== Frequently Asked Questions ==
|
360 |
-
|
361 |
-
= Most Common Issues =
|
362 |
-
|
363 |
-
* Got `Parse error: syntax error, unexpected T_STATIC, expecting ')'`? Read [Most Aihrus Plugins Require PHP 5.3+](https://aihrus.zendesk.com/entries/30678006) for the fixes.
|
364 |
-
* [404 - Page not found](https://aihrus.zendesk.com/entries/23679301)
|
365 |
-
* [Change or debug CSS](https://aihrus.zendesk.com/entries/24910733) AKA "What's up with these quotes?"
|
366 |
-
* [Customize bxSlider](http://bxslider.com/examples)
|
367 |
-
* [Debug common theme and plugin conflicts](https://aihrus.zendesk.com/entries/25119302)
|
368 |
-
* [How do I change my widget's rotation speed or other options?](https://aihrus.zendesk.com/entries/27714083)
|
369 |
-
* [How do I create a testimonial record?](https://aihrus.zendesk.com/entries/30602506)
|
370 |
-
* [How to change testimonials layout](https://aihrus.zendesk.com/entries/38055707)
|
371 |
-
* [My options don't work, no matter what I do.](https://aihrus.zendesk.com/entries/30746533)
|
372 |
-
* [Pagination is broken](https://aihrus.zendesk.com/entries/23693513)
|
373 |
-
* [Test Review schema output](http://www.google.com/webmasters/tools/richsnippets)
|
374 |
-
* [Widgets don't rotate](https://aihrus.zendesk.com/entries/23693363)
|
375 |
-
|
376 |
-
= Still Stuck or Want Something Done? Get Support! =
|
377 |
-
|
378 |
-
1. [Testimonials Knowledge Base](https://aihrus.zendesk.com/categories/20104507) - read and comment upon 125+ frequently asked questions
|
379 |
-
1. [Open Testimonials Issues](https://github.com/michael-cannon/testimonials-widget/issues) - review and submit bug reports and enhancement requests
|
380 |
-
1. [Testimonials Support on WordPress](http://wordpress.org/support/plugin/testimonials-widget) - ask questions and review responses
|
381 |
-
1. [Contribute Code to Testimonials](https://github.com/michael-cannon/testimonials-widget/blob/master/CONTRIBUTING.md)
|
382 |
-
1. [Beta Testers Needed](http://aihr.us/become-beta-tester/) - get the latest Testimonials version
|
383 |
-
|
384 |
-
|
385 |
-
== Screenshots ==
|
386 |
-
|
387 |
-
1. Testimonials admin interface
|
388 |
-
2. Collapsed Testimonials options
|
389 |
-
3. Expanded "General Options" in Testimonials options
|
390 |
-
4. Testimonial widget in the sidebar
|
391 |
-
5. [[testimonials]] in post
|
392 |
-
6. [[testimonials]] results with paging
|
393 |
-
7. Widget whitespace kept
|
394 |
-
8. Widget with clickable title and custom text/HTML on bottom
|
395 |
-
9. [WP-PageNavi compatible](http://wordpress.org/extend/plugins/wp-pagenavi/) for page numbers than default arrows
|
396 |
-
10. Poedit Catalog properties
|
397 |
-
11. Testimonials Settings > General tab
|
398 |
-
12. Expanded "Selection Options" in Testimonials options
|
399 |
-
13. Expanded "Ordering Options" in Testimonials options
|
400 |
-
14. Testimonials Settings > Selection tab
|
401 |
-
15. Testimonials Settings > Post Type tab
|
402 |
-
16. Testimonials Settings > Widget tab
|
403 |
-
17. Testimonials Settings > Compatibility & Reset tab
|
404 |
-
18. Dashboard > Right Now "Testimonials" count
|
405 |
-
19. Using Review and AggregateRating schema data structures
|
406 |
-
20. Testimonials Shortcode Examples page
|
407 |
-
21. Shortcode helpers on category and tag admin screens
|
408 |
-
22. Testimonials Settings > Columns tab
|
409 |
-
|
410 |
-
[gallery]
|
411 |
-
|
412 |
-
|
413 |
-
== Changelog ==
|
414 |
-
|
415 |
-
See [Changelog](https://github.com/michael-cannon/testimonials-widget/blob/master/CHANGELOG.md)
|
416 |
-
|
417 |
-
|
418 |
-
== Upgrade Notice ==
|
419 |
-
|
420 |
-
= 2.19.0 =
|
421 |
-
|
422 |
-
* CSS class `.title` is now `.job-title`. Thank you Mark
|
423 |
-
* Please resave your WordPress Admin > Testimonials > Settings so that missing aoptions are included again.
|
424 |
-
* Shortcode and theme function `testimonialswidget_list` being deprecated by `testimonials`
|
425 |
-
* Shortcode and theme function `testimonialswidget_widget` being deprecated by `testimonials_slider`
|
426 |
-
|
427 |
-
= 2.18.3 =
|
428 |
-
|
429 |
-
* CSS class `.hide` renamed `.display-none`
|
430 |
-
* This is the last version supporting pre-bxSlider options
|
431 |
-
|
432 |
-
= 2.18.2 =
|
433 |
-
|
434 |
-
* CSS class `.display-none` renamed `.hide`
|
435 |
-
|
436 |
-
= 2.18.1 =
|
437 |
-
|
438 |
-
* CSS is back to being always loaded in the header
|
439 |
-
* Removed "Use bxSlider?" and "Include IE7 CSS" from widget options
|
440 |
-
|
441 |
-
= 2.18.0 =
|
442 |
-
|
443 |
-
* `remove_hentry` is now true by default
|
444 |
-
|
445 |
-
= 2.16.0 =
|
446 |
-
|
447 |
-
* [Requires PHP 5.3+](https://aihrus.zendesk.com/entries/30678006)
|
448 |
-
|
449 |
-
= 2.15.0 =
|
450 |
-
|
451 |
-
* If upgrading, bxSlider will not be enabled by default. You must enable it in your widget and global settings. CSS customizations must be reviewed to have the `.active` and `.display-none` classes removed. The main `.testimonials-widget-testimonial` class also need the `display: none;` and `clear: left;` removed.
|
452 |
-
|
453 |
-
= 2.14.0 =
|
454 |
-
|
455 |
-
* **60 modifications** See [Changelog](https://github.com/michael-cannon/testimonials-widget/blob/master/CHANGELOG.md)
|
456 |
-
* CSS wp_register_style and wp_enqueue_style slug changed from 'testimonials-widget' to 'Testimonials_Widget'
|
457 |
-
* Gravatar image size now based upon Thumbnail size in Media Settings
|
458 |
-
* Scripts `ksort` removed. Use `array_unshift` in your `testimonials_widget_testimonials_js` filters instead.
|
459 |
-
* Testimonials > Settings, General tab, option Enable Review Schema? is enabled by default.
|
460 |
-
|
461 |
-
= 2.13.6 =
|
462 |
-
|
463 |
-
* IE 7 CSS moved to separate file. Include via Testimonials > Settings if needed
|
464 |
-
|
465 |
-
= 2.12.0 =
|
466 |
-
|
467 |
-
* CSS and JavaScript renaming
|
468 |
-
* `bottom_text` renamed to `bottom-text`
|
469 |
-
* `close_quote` renamed to `close-quote`
|
470 |
-
* `display_none` renamed to `display-none`
|
471 |
-
* `join_location` renamed to `join-location`
|
472 |
-
* `join_title` renamed to `join-title`
|
473 |
-
* `open_quote` renamed to `open-quote`
|
474 |
-
* `testimonialswidget_testimonial` renamed to `testimonials-widget-testimonial`
|
475 |
-
* `testimonialswidget_testimonials` renamed to `testimonials-widget-testimonials`
|
476 |
-
|
477 |
-
= 2.11.3 =
|
478 |
-
|
479 |
-
* Correct filter name `testimonials_widget_next_posts_link` to `testimonials_widget_next_posts_link_text`
|
480 |
-
|
481 |
-
= 2.11.0 =
|
482 |
-
|
483 |
-
* CSS class names are simplified. For the most part, other than `testimonialswidget_testimonial` remove `testimonialswidget_` from the CSS class name in your CSS customizations.
|
484 |
-
* Ex: `.testimonialswidget_join` becomes `.join`
|
485 |
-
* Ex: `.testimonialswidget_author` becomes `.author`
|
486 |
-
* Testimonials are now formatted using `blockquote` than `q` for HTML5 compliance. If you need `q` tag formatting, enable it at WP Admin > Testimonials > Settings, Compatibility & Reset tab
|
487 |
-
* `cite` is now `div.credit`
|
488 |
-
|
489 |
-
= 2.8.0 =
|
490 |
-
|
491 |
-
* Deprecated
|
492 |
-
* `hide_author` now `hide_source`
|
493 |
-
* Removed filters `testimonials_widget_options_update`, `testimonials_widget_options_form`
|
494 |
-
* Use `testimonials_widget_validate_settings` and `testimonials_widget_settings` instead
|
495 |
-
* Renamed variable and related class `widget_text` to `bottom_text`
|
496 |
-
|
497 |
-
= 2.7.3 =
|
498 |
-
|
499 |
-
* 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`
|
500 |
-
* 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.
|
501 |
-
|
502 |
-
= 2.7.0 =
|
503 |
-
|
504 |
-
* 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`
|
505 |
-
* Widget testimonial `p` tags are no longer CSS `display: inline`, `display: block` as expected
|
506 |
-
|
507 |
-
= 2.4.1 =
|
508 |
-
|
509 |
-
* Paging is on by default, except for widgets
|
510 |
-
|
511 |
-
= 2.0.0 =
|
512 |
-
|
513 |
-
* CSS
|
514 |
-
* Class `testimonialswidget_company` replaces `testimonialswidget_source`
|
515 |
-
* Class `testimonialswidget_source` replaces `testimonialswidget_author`
|
516 |
-
* The tighten widget display up, p tags within q are displayed inline.
|
517 |
-
* JavaScript
|
518 |
-
* The JavaScript for rotating testimonials is moved to the footer. As such, your theme requires `wp_footer()` in the footer.
|
519 |
-
* Shortcode options
|
520 |
-
* `hide_source` replaced by `hide_url`
|
521 |
-
* `hide_author` replaced by `hide_source`
|
522 |
-
* Testimonials
|
523 |
-
* Migration from the old custom table to new custom post type is automatically done. Import might take a few moments to complete.
|
524 |
-
* 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.
|
525 |
-
* Public testimonials are saved as Published. Non-public testimonials are marked as Private.
|
526 |
-
* Widget options
|
527 |
-
* "Show author" and "Show source" options are replaced by "Hide source" and "Hide URL" respectively. There's no backwards compatibility for these changes.
|
528 |
-
* Default `min-height` is now 250px than 150px.
|
529 |
-
|
530 |
-
|
531 |
-
== Notes ==
|
532 |
-
|
533 |
-
* Default and Gravatar image size is based upon Thumbnail size in Media Settings
|
534 |
-
* Migration from from pre-2.0.0 custom table to new custom post type is automatic
|
535 |
-
* Review schema [structured data testing tool](http://www.google.com/webmasters/tools/richsnippets)
|
536 |
-
* When plugin is uninstalled, all data and settings are deleted if "Remove Plugin Data on Deletion" is checked in Settings
|
537 |
-
|
538 |
-
|
539 |
-
== API ==
|
540 |
-
|
541 |
-
* Read the [Testimonials API](https://github.com/michael-cannon/testimonials-widget/blob/master/API.md).
|
542 |
-
|
543 |
-
|
544 |
-
== Background ==
|
545 |
-
|
546 |
-
Version 2.0.0 of Testimonials 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.
|
547 |
-
|
548 |
-
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).
|
549 |
-
|
550 |
-
|
551 |
-
== Conflicts ==
|
552 |
-
|
553 |
-
* [ReOrder Post Within Categories](http://wordpress.org/plugins/reorder-post-within-categories/) – Uses custom ordering table
|
554 |
-
|
555 |
-
|
556 |
-
== Deprecation Notices ==
|
557 |
-
|
558 |
-
= Deprecated Shortcodes =
|
559 |
-
|
560 |
-
* `[[testimonialswidget_list]]` - Listings with paging
|
561 |
-
* `[[testimonialswidget_widget]]` - Rotating
|
562 |
-
|
563 |
-
= Deprecated Theme Functions =
|
564 |
-
|
565 |
-
* `testimonialswidget_list()` - Testimonials listing with paging
|
566 |
-
* `testimonialswidget_widget()` - Rotating testimonials
|
567 |
-
|
568 |
-
|
569 |
-
== Localization ==
|
570 |
-
|
571 |
-
* Dutch by Bjorn Robijns
|
572 |
-
* [Hebrew by Ahrale](http://atar4u.com/)
|
573 |
-
|
574 |
-
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/) for plugin inclusion.
|
575 |
-
|
576 |
-
**[How do I localize?](https://aihrus.zendesk.com/entries/23691557)**
|
577 |
-
|
578 |
-
|
579 |
-
== Recommendation ==
|
580 |
-
|
581 |
-
* 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
|
582 |
-
|
583 |
-
|
584 |
-
== Thank You ==
|
585 |
-
|
586 |
-
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 banner. It's fantastic.
|
587 |
-
|
588 |
-
A cool thanks to RedRokk Library for the [redrokk_metabox_class](https://gist.github.com/1880770). It makes configuring meta boxes for your pos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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trunk/testimonials-widget.php
DELETED
@@ -1,134 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Plugin Name: Testimonials by Aihrus
|
4 |
-
* Plugin URI: http://wordpress.org/plugins/testimonials-widget/
|
5 |
-
* Description: Testimonials by Aihrus lets you randomly slide or list selected portfolios, quotes, reviews, or text with images or videos on your WordPress site.
|
6 |
-
* Version: 2.19.1
|
7 |
-
* Author: Michael Cannon
|
8 |
-
* Author URI: http://aihr.us/resume/
|
9 |
-
* License: GPLv2 or later
|
10 |
-
* Text Domain: testimonials-widget
|
11 |
-
* Domain Path: /languages
|
12 |
-
*/
|
13 |
-
|
14 |
-
|
15 |
-
/**
|
16 |
-
* Copyright 2014 Michael Cannon (email: mc@aihr.us)
|
17 |
-
* This program is free software; you can redistribute it and/or modify
|
18 |
-
* it under the terms of the GNU General Public License, version 2, as
|
19 |
-
* published by the Free Software Foundation.
|
20 |
-
* This program is distributed in the hope that it will be useful,
|
21 |
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
22 |
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
23 |
-
* GNU General Public License for more details.
|
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 |
-
// Exit if accessed directly
|
30 |
-
if ( ! defined( 'ABSPATH' ) )
|
31 |
-
exit;
|
32 |
-
|
33 |
-
if ( ! defined( 'TW_AIHR_VERSION' ) )
|
34 |
-
define( 'TW_AIHR_VERSION', '1.1.1' );
|
35 |
-
|
36 |
-
if ( ! defined( 'TW_BASE' ) )
|
37 |
-
define( 'TW_BASE', plugin_basename( __FILE__ ) );
|
38 |
-
|
39 |
-
if ( ! defined( 'TW_DIR' ) )
|
40 |
-
define( 'TW_DIR', plugin_dir_path( __FILE__ ) );
|
41 |
-
|
42 |
-
if ( ! defined( 'TW_DIR_INC' ) )
|
43 |
-
define( 'TW_DIR_INC', TW_DIR . 'includes/' );
|
44 |
-
|
45 |
-
if ( ! defined( 'TW_DIR_LIB' ) )
|
46 |
-
define( 'TW_DIR_LIB', TW_DIR_INC . 'libraries/' );
|
47 |
-
|
48 |
-
if ( ! defined( 'TW_NAME' ) )
|
49 |
-
define( 'TW_NAME', 'Testimonials by Aihrus' );
|
50 |
-
|
51 |
-
if ( ! defined( 'TW_PREMIUM_LINK' ) )
|
52 |
-
define( 'TW_PREMIUM_LINK', '<a href="http://aihr.us/downloads/testimonials-widget-premium-wordpress-plugin/">Buy Premium</a>' );
|
53 |
-
|
54 |
-
if ( ! defined( 'TW_VERSION' ) )
|
55 |
-
define( 'TW_VERSION', '2.19.1' );
|
56 |
-
|
57 |
-
require_once TW_DIR_INC . 'requirements.php';
|
58 |
-
|
59 |
-
global $tw_activated;
|
60 |
-
|
61 |
-
$tw_activated = true;
|
62 |
-
if ( ! tw_requirements_check() ) {
|
63 |
-
$tw_activated = false;
|
64 |
-
|
65 |
-
return false;
|
66 |
-
}
|
67 |
-
|
68 |
-
require_once TW_DIR_INC . 'class-testimonials-widget.php';
|
69 |
-
|
70 |
-
add_action( 'plugins_loaded', 'testimonialswidget_init', 99 );
|
71 |
-
|
72 |
-
|
73 |
-
/**
|
74 |
-
*
|
75 |
-
*
|
76 |
-
* @SuppressWarnings(PHPMD.LongVariable)
|
77 |
-
* @SuppressWarnings(PHPMD.UnusedLocalVariable)
|
78 |
-
*/
|
79 |
-
if ( ! function_exists( 'testimonialswidget_init' ) ) {
|
80 |
-
function testimonialswidget_init() {
|
81 |
-
if ( Testimonials_Widget::version_check() ) {
|
82 |
-
global $Testimonials_Widget_Settings;
|
83 |
-
if ( is_null( $Testimonials_Widget_Settings ) )
|
84 |
-
$Testimonials_Widget_Settings = new Testimonials_Widget_Settings();
|
85 |
-
|
86 |
-
global $Testimonials_Widget;
|
87 |
-
if ( is_null( $Testimonials_Widget ) )
|
88 |
-
$Testimonials_Widget = new Testimonials_Widget();
|
89 |
-
}
|
90 |
-
}
|
91 |
-
}
|
92 |
-
|
93 |
-
|
94 |
-
register_activation_hook( __FILE__, array( 'Testimonials_Widget', 'activation' ) );
|
95 |
-
register_deactivation_hook( __FILE__, array( 'Testimonials_Widget', 'deactivation' ) );
|
96 |
-
register_uninstall_hook( __FILE__, array( 'Testimonials_Widget', 'uninstall' ) );
|
97 |
-
|
98 |
-
|
99 |
-
if ( ! function_exists( 'testimonials' ) ) {
|
100 |
-
function testimonials( $atts = array() ) {
|
101 |
-
global $Testimonials_Widget;
|
102 |
-
|
103 |
-
return $Testimonials_Widget->testimonials( $atts );
|
104 |
-
}
|
105 |
-
}
|
106 |
-
|
107 |
-
|
108 |
-
if ( ! function_exists( 'testimonials_slider' ) ) {
|
109 |
-
function testimonials_slider( $atts = array(), $widget_number = null ) {
|
110 |
-
global $Testimonials_Widget;
|
111 |
-
|
112 |
-
return $Testimonials_Widget->testimonials_slider( $atts, $widget_number );
|
113 |
-
}
|
114 |
-
}
|
115 |
-
|
116 |
-
|
117 |
-
if ( ! function_exists( 'testimonialswidget_list' ) ) {
|
118 |
-
function testimonialswidget_list( $atts = array() ) {
|
119 |
-
_deprecated_function( __FUNCTION__, '2.19.0', 'testimonials()' );
|
120 |
-
|
121 |
-
return testimonials( $atts );
|
122 |
-
}
|
123 |
-
}
|
124 |
-
|
125 |
-
|
126 |
-
if ( ! function_exists( 'testimonialswidget_widget' ) ) {
|
127 |
-
function testimonialswidget_widget( $atts = array(), $widget_number = null ) {
|
128 |
-
_deprecated_function( __FUNCTION__, '2.19.0', 'testimonials_slider()' );
|
129 |
-
|
130 |
-
return testimonials_slider( $atts, $widget_number );
|
131 |
-
}
|
132 |
-
}
|
133 |
-
|
134 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trunk/wpml-config.xml
DELETED
@@ -1,19 +0,0 @@
|
|
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-location</custom-field>
|
7 |
-
<custom-field action="translate">testimonials-widget-title</custom-field>
|
8 |
-
<custom-field action="ignore">_testimonials-widget:testimonial_id</custom-field>
|
9 |
-
</custom-fields>
|
10 |
-
<custom-types>
|
11 |
-
<custom-type translate="1">testimonials-widget</custom-type>
|
12 |
-
</custom-types>
|
13 |
-
<taxonomies>
|
14 |
-
<taxonomy translate="1">category</taxonomy>
|
15 |
-
<taxonomy translate="1">post_tag</taxonomy>
|
16 |
-
<taxonomy translate="1">testimonials-widget-category</taxonomy>
|
17 |
-
<taxonomy translate="1">testimonials-widget-post_tag</taxonomy>
|
18 |
-
</taxonomies>
|
19 |
-
</wpml-config>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|