Version Description
= 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.16.0 |
Comparing to | |
See all releases |
Code changes from version 2.15.1 to 2.16.0
- API.md +5 -5
- CHANGELOG.md +29 -1
- CONTRIBUTING.md +7 -7
- README.md +9 -9
- TODO.md +5 -6
- languages/testimonials-widget.pot +345 -294
- lib/aihrus/.gitignore +2 -0
- lib/aihrus/CHANGELOG.md +17 -0
- lib/aihrus/LICENSE +339 -0
- lib/aihrus/README.md +72 -0
- lib/aihrus/TODO.md +3 -0
- lib/aihrus/class-aihrus-common.php +318 -0
- lib/aihrus/class-aihrus-licensing.php +186 -0
- lib/aihrus/class-aihrus-settings.php +726 -0
- lib/aihrus/class-aihrus-widget.php +289 -0
- lib/aihrus/interface-aihrus-common.php +27 -0
- lib/aihrus/interface-aihrus-licensing.php +28 -0
- lib/aihrus/interface-aihrus-widget.php +33 -0
- lib/class-testimonials-widget-settings.php +103 -636
- lib/class-testimonials-widget-widget.php +44 -231
- readme.txt +57 -69
- testimonials-widget.php +192 -195
API.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
-
# API Testimonials
|
2 |
|
3 |
-
The [Testimonials
|
4 |
|
5 |
## Actions
|
6 |
|
@@ -137,11 +137,11 @@ The [Testimonials Widget plugin](http://wordpress.org/plugins/testimonials-widge
|
|
137 |
|
138 |
* `testimonials_widget_defaults_single`
|
139 |
|
140 |
-
Create a global or central Testimonials
|
141 |
|
142 |
* `testimonials_widget_defaults`
|
143 |
|
144 |
-
Create a global or central Testimonials
|
145 |
|
146 |
* `testimonials_widget_meta_box`
|
147 |
|
@@ -181,4 +181,4 @@ The [Testimonials Widget plugin](http://wordpress.org/plugins/testimonials-widge
|
|
181 |
|
182 |
## Need More?
|
183 |
|
184 |
-
Further examples and more can be found by reading and searching the [Testimonials
|
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 |
|
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 |
|
181 |
|
182 |
## Need More?
|
183 |
|
184 |
+
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).
|
CHANGELOG.md
CHANGED
@@ -1,10 +1,38 @@
|
|
1 |
-
# CHANGELOG Testimonials
|
2 |
|
3 |
## master
|
4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
## 2.15.1
|
6 |
* BUGFIX Fatal error: Access to undeclared static property: Testimonials_Widget_Settings::$cpt_category
|
7 |
* Encapsulate shortcodes
|
|
|
8 |
|
9 |
## 2.15.0
|
10 |
* Add 2.15.0 upgrade notice
|
1 |
+
# CHANGELOG Testimonials
|
2 |
|
3 |
## master
|
4 |
|
5 |
+
## 2.16.0
|
6 |
+
* Add Expand/Collapse All Options helper for widget options - Thank you Scott Hendison
|
7 |
+
* Add Shortcodes helper page - Thank you Scott Hendison
|
8 |
+
* Add screenshot 20. Testimonials Shortcode Examples page
|
9 |
+
* Add version_check
|
10 |
+
* BUGFIX Donate notice shows despite `disable_donate` set
|
11 |
+
* BUGFIX JavaScript generated even when no testimonials
|
12 |
+
* BUGFIX Page Display of Testimonial duplicating Text - Elegant Themes' Trim theme
|
13 |
+
* BUGFIX Saving settings doesn't show update notice
|
14 |
+
* Delete notices on deactivation
|
15 |
+
* Disable schemas by default for widgets
|
16 |
+
* Enabled resetting widget options
|
17 |
+
* Mark cacheables with similar key for easier cleanup
|
18 |
+
* Rebrand Testimonials Widget as Testimonials
|
19 |
+
* Removed Testimonials Widget pre-2.0.0 migration code
|
20 |
+
* Rename no_code to show_code
|
21 |
+
* Replace JS_KEY with SLUG
|
22 |
+
* Revise Shortcode Examples formatting
|
23 |
+
* Revise short description
|
24 |
+
* Simplify display_setting
|
25 |
+
* Update TODO
|
26 |
+
* Update readme verbiage
|
27 |
+
* Update to use `TW_PLUGIN_DIR_LIB`
|
28 |
+
* Use abstract class Aihrus_Settings
|
29 |
+
* Use abstract class Aihrus_Widget
|
30 |
+
* Use aihrus framework
|
31 |
+
|
32 |
## 2.15.1
|
33 |
* BUGFIX Fatal error: Access to undeclared static property: Testimonials_Widget_Settings::$cpt_category
|
34 |
* Encapsulate shortcodes
|
35 |
+
* [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
|
36 |
|
37 |
## 2.15.0
|
38 |
* Add 2.15.0 upgrade notice
|
CONTRIBUTING.md
CHANGED
@@ -1,12 +1,12 @@
|
|
1 |
-
# CONTRIBUTE Testimonials
|
2 |
|
3 |
-
Community made patches, localisation, bug reports and contributions are very welcome and help make Testimonials
|
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
|
10 |
|
11 |
## Getting Started
|
12 |
|
@@ -21,19 +21,19 @@ For localization, please refer to [How do I change Testimonials Widget text labe
|
|
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
|
25 |
|
26 |
## Code Documentation
|
27 |
|
28 |
-
* Try to ensure that every Testimonials
|
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
|
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
|
38 |
* [General GitHub Documentation](http://help.github.com/)
|
39 |
* [GitHub Pull Request documentation](http://help.github.com/send-pull-requests/)
|
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 |
|
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/)
|
README.md
CHANGED
@@ -1,22 +1,22 @@
|
|
1 |
-
# README Testimonials
|
2 |
|
3 |
[![Build Status](https://travis-ci.org/michael-cannon/testimonials-widget.png?branch=master)](https://travis-ci.org/michael-cannon/testimonials-widget)
|
4 |
[![ProjectStatus](http://stillmaintained.com/michael-cannon/testimonials-widget.png)](http://stillmaintained.com/michael-cannon/testimonials-widget)
|
5 |
|
6 |
-
## Welcome to the Testimonials
|
7 |
|
8 |
-
Testimonials
|
9 |
|
10 |
-
While the documentation for the [Testimonials
|
11 |
|
12 |
## Installation
|
13 |
|
14 |
-
Here's a [guide on how to install Testimonials
|
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
|
20 |
|
21 |
## Bugs
|
22 |
|
@@ -24,17 +24,17 @@ If you find an issue, [let us know here](https://github.com/michael-cannon/testi
|
|
24 |
|
25 |
## Support
|
26 |
|
27 |
-
This is a developer's portal for Testimonials
|
28 |
|
29 |
## Contributions
|
30 |
|
31 |
-
Anyone is welcome to contribute to Testimonials
|
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 |
* Send us a Pull Request with your bug fixes and/or new features.
|
37 |
-
* [Translate Testimonials
|
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
|
1 |
+
# README Testimonials WordPress Plugin
|
2 |
|
3 |
[![Build Status](https://travis-ci.org/michael-cannon/testimonials-widget.png?branch=master)](https://travis-ci.org/michael-cannon/testimonials-widget)
|
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 |
|
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 |
* 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
|
TODO.md
CHANGED
@@ -1,10 +1,9 @@
|
|
1 |
-
# TODO Testimonials
|
2 |
|
3 |
Is there something you want done? Write it up on the [support forums](http://wordpress.org/support/plugin/testimonials-widget) and then [donate](http://aihr.us/about-aihrus/donate/) or [write an awesome testimonial](http://aihr.us/about-aihrus/testimonials/add-testimonial/).
|
4 |
|
5 |
-
* 3.X Remove prior version options
|
6 |
-
* Add easing options - http://bxslider.com/examples/easing, http://gsgd.co.uk/sandbox/jquery/easing/
|
7 |
-
* BUG Saving settings doesn't show update notice
|
8 |
* Consolidate schema by testimonial item
|
9 |
-
*
|
10 |
-
*
|
|
|
|
1 |
+
# TODO Testimonials
|
2 |
|
3 |
Is there something you want done? Write it up on the [support forums](http://wordpress.org/support/plugin/testimonials-widget) and then [donate](http://aihr.us/about-aihrus/donate/) or [write an awesome testimonial](http://aihr.us/about-aihrus/testimonials/add-testimonial/).
|
4 |
|
|
|
|
|
|
|
5 |
* Consolidate schema by testimonial item
|
6 |
+
* Move suggest JS to footer
|
7 |
+
* On widget expand/collaspe switch labels
|
8 |
+
* Support subdirectory testimonial landing page
|
9 |
+
* Validate HTML
|
languages/testimonials-widget.pot
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
-
# Copyright (C) 2013 Testimonials
|
2 |
-
# This file is distributed under the same license as the Testimonials
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Testimonials
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/testimonials-widget\n"
|
7 |
-
"POT-Creation-Date: 2013-
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
@@ -12,836 +12,887 @@ msgstr ""
|
|
12 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
13 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
14 |
|
15 |
-
#: lib/class-
|
16 |
-
|
17 |
-
msgid "Testimonials Widget Settings"
|
18 |
msgstr ""
|
19 |
|
20 |
-
#: lib/class-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
msgid "Settings"
|
22 |
msgstr ""
|
23 |
|
24 |
-
#: lib/class-testimonials-widget-settings.php:
|
25 |
-
#: lib/class-testimonials-widget-settings.php:
|
26 |
msgid "General"
|
27 |
msgstr ""
|
28 |
|
29 |
-
#: lib/class-testimonials-widget-settings.php:
|
30 |
-
#: lib/class-testimonials-widget-settings.php:
|
31 |
msgid "Selection"
|
32 |
msgstr ""
|
33 |
|
34 |
-
#: lib/class-testimonials-widget-settings.php:
|
35 |
-
#: lib/class-testimonials-widget-settings.php:
|
36 |
msgid "Ordering"
|
37 |
msgstr ""
|
38 |
|
39 |
-
#: lib/class-testimonials-widget-settings.php:
|
40 |
-
#: lib/class-testimonials-widget-settings.php:
|
41 |
msgid "Widget"
|
42 |
msgstr ""
|
43 |
|
44 |
-
#: lib/class-testimonials-widget-settings.php:
|
45 |
-
#: lib/class-testimonials-widget-settings.php:
|
46 |
msgid "Post Type"
|
47 |
msgstr ""
|
48 |
|
49 |
-
#: lib/class-testimonials-widget-settings.php:
|
50 |
-
#: lib/class-testimonials-widget-settings.php:1445
|
51 |
-
msgid "Compatibility & Reset"
|
52 |
-
msgstr ""
|
53 |
-
|
54 |
-
#: lib/class-testimonials-widget-settings.php:120
|
55 |
-
msgid "About Testimonials Widget"
|
56 |
-
msgstr ""
|
57 |
-
|
58 |
-
#: lib/class-testimonials-widget-settings.php:135
|
59 |
msgid "Widget Title"
|
60 |
msgstr ""
|
61 |
|
62 |
-
|
63 |
-
|
|
|
|
|
|
|
64 |
msgid "Testimonials"
|
65 |
msgstr ""
|
66 |
|
67 |
-
#: lib/class-testimonials-widget-settings.php:
|
68 |
msgid "Title Link"
|
69 |
msgstr ""
|
70 |
|
71 |
-
#: lib/class-testimonials-widget-settings.php:
|
72 |
msgid ""
|
73 |
"URL, path, or post ID to link widget title to. Ex: http://example.com/"
|
74 |
"stuff, /testimonials, 123 or "
|
75 |
msgstr ""
|
76 |
|
77 |
-
#: lib/class-testimonials-widget-settings.php:
|
78 |
msgid "Character Limit"
|
79 |
msgstr ""
|
80 |
|
81 |
-
#: lib/class-testimonials-widget-settings.php:
|
82 |
msgid "Number of characters to limit non-single testimonial views to"
|
83 |
msgstr ""
|
84 |
|
85 |
-
#: lib/class-testimonials-widget-settings.php:
|
86 |
msgid "Rotation Speed"
|
87 |
msgstr ""
|
88 |
|
89 |
-
#: lib/class-testimonials-widget-settings.php:
|
90 |
msgid ""
|
91 |
"Number of seconds between testimonial rotations or 0 for no rotation at all "
|
92 |
"refresh"
|
93 |
msgstr ""
|
94 |
|
95 |
-
#: lib/class-testimonials-widget-settings.php:
|
96 |
msgid "Additional Widget Options"
|
97 |
msgstr ""
|
98 |
|
99 |
-
#: lib/class-testimonials-widget-settings.php:
|
100 |
msgid "Transition Mode?"
|
101 |
msgstr ""
|
102 |
|
103 |
-
#: lib/class-testimonials-widget-settings.php:
|
104 |
msgid "Type of transition between slides"
|
105 |
msgstr ""
|
106 |
|
107 |
-
#: lib/class-testimonials-widget-settings.php:
|
108 |
msgid "Fade"
|
109 |
msgstr ""
|
110 |
|
111 |
-
#: lib/class-testimonials-widget-settings.php:
|
112 |
msgid "Horizontal"
|
113 |
msgstr ""
|
114 |
|
115 |
-
#: lib/class-testimonials-widget-settings.php:
|
116 |
msgid "Vertical"
|
117 |
msgstr ""
|
118 |
|
119 |
-
#: lib/class-testimonials-widget-settings.php:
|
120 |
msgid "Show Play/Pause?"
|
121 |
msgstr ""
|
122 |
|
123 |
-
#: lib/class-testimonials-widget-settings.php:
|
124 |
msgid "Display start and stop buttons underneath the testimonial slider."
|
125 |
msgstr ""
|
126 |
|
127 |
-
#: lib/class-testimonials-widget-settings.php:
|
128 |
msgid "Enable Video?"
|
129 |
msgstr ""
|
130 |
|
131 |
-
#: lib/class-testimonials-widget-settings.php:
|
132 |
msgid "Only enable when displaying video content."
|
133 |
msgstr ""
|
134 |
|
135 |
-
#: lib/class-testimonials-widget-settings.php:
|
136 |
msgid "Keep Whitespace?"
|
137 |
msgstr ""
|
138 |
|
139 |
-
#: lib/class-testimonials-widget-settings.php:
|
140 |
msgid "Keeps testimonials looking as entered than sans auto-formatting"
|
141 |
msgstr ""
|
142 |
|
143 |
-
#: lib/class-testimonials-widget-settings.php:
|
144 |
msgid "Testimonial Bottom Text"
|
145 |
msgstr ""
|
146 |
|
147 |
-
#: lib/class-testimonials-widget-settings.php:
|
148 |
msgid "Custom text or HTML for bottom of testimonials"
|
149 |
msgstr ""
|
150 |
|
151 |
-
#: lib/class-testimonials-widget-settings.php:
|
152 |
msgid "General Options"
|
153 |
msgstr ""
|
154 |
|
155 |
-
#: lib/class-testimonials-widget-settings.php:
|
156 |
msgid ""
|
157 |
"Adds HTML tag markup per the <a href=\"%s\">Review schema</a> to "
|
158 |
"testimonials. Search engines including Bing, Google, Yahoo! and Yandex rely "
|
159 |
"on this markup to improve the display of search results."
|
160 |
msgstr ""
|
161 |
|
162 |
-
#: lib/class-testimonials-widget-settings.php:
|
163 |
msgid "Enable Review Schema?"
|
164 |
msgstr ""
|
165 |
|
166 |
-
#: lib/class-testimonials-widget-settings.php:
|
167 |
msgid "Reviewed Item?"
|
168 |
msgstr ""
|
169 |
|
170 |
-
#: lib/class-testimonials-widget-settings.php:
|
171 |
msgid "Name of thing being referenced in testimonials"
|
172 |
msgstr ""
|
173 |
|
174 |
-
#: lib/class-testimonials-widget-settings.php:
|
175 |
msgid "Reviewed Item URL?"
|
176 |
msgstr ""
|
177 |
|
178 |
-
#: lib/class-testimonials-widget-settings.php:
|
179 |
msgid "URL of thing being referenced in testimonials"
|
180 |
msgstr ""
|
181 |
|
182 |
-
#: lib/class-testimonials-widget-settings.php:
|
183 |
msgid "Hide built-in quotes?"
|
184 |
msgstr ""
|
185 |
|
186 |
-
#: lib/class-testimonials-widget-settings.php:
|
187 |
msgid "Remove open and close quote span tags surrounding testimonial content"
|
188 |
msgstr ""
|
189 |
|
190 |
-
#: lib/class-testimonials-widget-settings.php:
|
191 |
msgid "Hide \"Testimonials Not Found\"?"
|
192 |
msgstr ""
|
193 |
|
194 |
-
#: lib/class-testimonials-widget-settings.php:
|
195 |
msgid "Hide Gravatar Image?"
|
196 |
msgstr ""
|
197 |
|
198 |
-
#: lib/class-testimonials-widget-settings.php:
|
199 |
msgid "Hide Image?"
|
200 |
msgstr ""
|
201 |
|
202 |
-
#: lib/class-testimonials-widget-settings.php:
|
203 |
msgid "Hide Image in Single View?"
|
204 |
msgstr ""
|
205 |
|
206 |
-
#: lib/class-testimonials-widget-settings.php:
|
207 |
msgid "Hide Testimonial Content?"
|
208 |
msgstr ""
|
209 |
|
210 |
-
#: lib/class-testimonials-widget-settings.php:
|
211 |
msgid "Hide Author/Source?"
|
212 |
msgstr ""
|
213 |
|
214 |
-
#: lib/class-testimonials-widget-settings.php:
|
215 |
msgid "Don't display \"Post Title\" in cite"
|
216 |
msgstr ""
|
217 |
|
218 |
-
#: lib/class-testimonials-widget-settings.php:
|
219 |
msgid "Hide Email?"
|
220 |
msgstr ""
|
221 |
|
222 |
-
#: lib/class-testimonials-widget-settings.php:
|
223 |
msgid "Hide Job Title?"
|
224 |
msgstr ""
|
225 |
|
226 |
-
#: lib/class-testimonials-widget-settings.php:
|
227 |
msgid "Hide Location?"
|
228 |
msgstr ""
|
229 |
|
230 |
-
#: lib/class-testimonials-widget-settings.php:
|
231 |
msgid "Hide Company?"
|
232 |
msgstr ""
|
233 |
|
234 |
-
#: lib/class-testimonials-widget-settings.php:
|
235 |
msgid "Hide URL?"
|
236 |
msgstr ""
|
237 |
|
238 |
-
#: lib/class-testimonials-widget-settings.php:
|
239 |
msgid "URL Target"
|
240 |
msgstr ""
|
241 |
|
242 |
-
#: lib/class-testimonials-widget-settings.php:
|
243 |
msgid "Add target to all URLs; leave blank if none"
|
244 |
msgstr ""
|
245 |
|
246 |
-
#: lib/class-testimonials-widget-settings.php:
|
247 |
msgid "Enable Paging?"
|
248 |
msgstr ""
|
249 |
|
250 |
-
#: lib/class-testimonials-widget-settings.php:
|
251 |
msgid "For `[testimonialswidget_list]`"
|
252 |
msgstr ""
|
253 |
|
254 |
-
#: lib/class-testimonials-widget-settings.php:
|
255 |
msgid "Disable"
|
256 |
msgstr ""
|
257 |
|
258 |
-
#: lib/class-testimonials-widget-settings.php:
|
259 |
msgid "Enable"
|
260 |
msgstr ""
|
261 |
|
262 |
-
#: lib/class-testimonials-widget-settings.php:
|
263 |
msgid "Before testimonials"
|
264 |
msgstr ""
|
265 |
|
266 |
-
#: lib/class-testimonials-widget-settings.php:
|
267 |
msgid "After testimonials"
|
268 |
msgstr ""
|
269 |
|
270 |
-
#: lib/class-testimonials-widget-settings.php:
|
271 |
msgid "Do [shortcodes]?"
|
272 |
msgstr ""
|
273 |
|
274 |
-
#: lib/class-testimonials-widget-settings.php:
|
275 |
msgid "If unchecked, shortcodes are stripped."
|
276 |
msgstr ""
|
277 |
|
278 |
-
#: lib/class-testimonials-widget-settings.php:
|
279 |
msgid "Selection Options"
|
280 |
msgstr ""
|
281 |
|
282 |
-
#: lib/class-testimonials-widget-settings.php:
|
283 |
msgid "Category Filter"
|
284 |
msgstr ""
|
285 |
|
286 |
-
#: lib/class-testimonials-widget-settings.php:
|
287 |
msgid "Comma separated category names. Ex: Category A, Another category"
|
288 |
msgstr ""
|
289 |
|
290 |
-
#: lib/class-testimonials-widget-settings.php:
|
291 |
msgid "Tags Filter"
|
292 |
msgstr ""
|
293 |
|
294 |
-
#: lib/class-testimonials-widget-settings.php:
|
295 |
msgid "Comma separated tag names. Ex: Tag A, Another tag"
|
296 |
msgstr ""
|
297 |
|
298 |
-
#: lib/class-testimonials-widget-settings.php:
|
299 |
msgid "Require All Tags?"
|
300 |
msgstr ""
|
301 |
|
302 |
-
#: lib/class-testimonials-widget-settings.php:
|
303 |
msgid "Select only testimonials with all of the given tags"
|
304 |
msgstr ""
|
305 |
|
306 |
-
#: lib/class-testimonials-widget-settings.php:
|
307 |
msgid "Include IDs Filter"
|
308 |
msgstr ""
|
309 |
|
310 |
-
#: lib/class-testimonials-widget-settings.php:
|
311 |
-
#: lib/class-testimonials-widget-settings.php:
|
312 |
msgid "Comma separated testimonial IDs. Ex: 3,1,2"
|
313 |
msgstr ""
|
314 |
|
315 |
-
#: lib/class-testimonials-widget-settings.php:
|
316 |
msgid "Exclude IDs Filter"
|
317 |
msgstr ""
|
318 |
|
319 |
-
#: lib/class-testimonials-widget-settings.php:
|
320 |
msgid "Limit"
|
321 |
msgstr ""
|
322 |
|
323 |
-
#: lib/class-testimonials-widget-settings.php:
|
324 |
msgid "Number of testimonials to select per instance"
|
325 |
msgstr ""
|
326 |
|
327 |
-
#: lib/class-testimonials-widget-settings.php:
|
328 |
msgid "Ordering Options"
|
329 |
msgstr ""
|
330 |
|
331 |
-
#: lib/class-testimonials-widget-settings.php:
|
332 |
msgid "Random Order?"
|
333 |
msgstr ""
|
334 |
|
335 |
-
#: lib/class-testimonials-widget-settings.php:
|
336 |
msgid ""
|
337 |
"If checked, ignores ORDER BY, ORDER BY meta_key, and ORDER BY Order. Widgets "
|
338 |
"are random by default automatically"
|
339 |
msgstr ""
|
340 |
|
341 |
-
#: lib/class-testimonials-widget-settings.php:
|
342 |
msgid "ORDER BY"
|
343 |
msgstr ""
|
344 |
|
345 |
-
#: lib/class-testimonials-widget-settings.php:
|
346 |
msgid "Used when \"Random Order\" is disabled"
|
347 |
msgstr ""
|
348 |
|
349 |
-
#: lib/class-testimonials-widget-settings.php:
|
350 |
msgid "Testimonial ID"
|
351 |
msgstr ""
|
352 |
|
353 |
-
#: lib/class-testimonials-widget-settings.php:
|
354 |
msgid "Author"
|
355 |
msgstr ""
|
356 |
|
357 |
-
#: lib/class-testimonials-widget-settings.php:
|
358 |
msgid "Date"
|
359 |
msgstr ""
|
360 |
|
361 |
-
#: lib/class-testimonials-widget-settings.php:
|
362 |
msgid "Menu Order"
|
363 |
msgstr ""
|
364 |
|
365 |
-
#: lib/class-testimonials-widget-settings.php:
|
366 |
msgid "Source"
|
367 |
msgstr ""
|
368 |
|
369 |
-
#: lib/class-testimonials-widget-settings.php:
|
370 |
msgid "No order"
|
371 |
msgstr ""
|
372 |
|
373 |
-
#: lib/class-testimonials-widget-settings.php:
|
374 |
msgid "ORDER BY meta_key"
|
375 |
msgstr ""
|
376 |
|
377 |
-
#: lib/class-testimonials-widget-settings.php:
|
378 |
msgid ""
|
379 |
"Used when \"Random Order\" is disabled and sorting by a testimonials meta "
|
380 |
"key is needed. Overrides ORDER BY"
|
381 |
msgstr ""
|
382 |
|
383 |
-
#: lib/class-testimonials-widget-settings.php:
|
384 |
msgid "None"
|
385 |
msgstr ""
|
386 |
|
387 |
-
#: lib/class-testimonials-widget-settings.php:
|
388 |
-
#: testimonials-widget.php:
|
389 |
msgid "Job Title"
|
390 |
msgstr ""
|
391 |
|
392 |
-
#: lib/class-testimonials-widget-settings.php:
|
393 |
-
#: testimonials-widget.php:
|
394 |
msgid "Email"
|
395 |
msgstr ""
|
396 |
|
397 |
-
#: lib/class-testimonials-widget-settings.php:
|
398 |
-
#: testimonials-widget.php:
|
399 |
msgid "Location"
|
400 |
msgstr ""
|
401 |
|
402 |
-
#: lib/class-testimonials-widget-settings.php:
|
403 |
-
#: testimonials-widget.php:
|
404 |
msgid "Company"
|
405 |
msgstr ""
|
406 |
|
407 |
-
#: lib/class-testimonials-widget-settings.php:
|
408 |
-
#: testimonials-widget.php:
|
409 |
msgid "URL"
|
410 |
msgstr ""
|
411 |
|
412 |
-
#: lib/class-testimonials-widget-settings.php:
|
413 |
msgid "ORDER BY Order"
|
414 |
msgstr ""
|
415 |
|
416 |
-
#: lib/class-testimonials-widget-settings.php:
|
417 |
msgid "Descending"
|
418 |
msgstr ""
|
419 |
|
420 |
-
#: lib/class-testimonials-widget-settings.php:
|
421 |
msgid "Ascending"
|
422 |
msgstr ""
|
423 |
|
424 |
-
#: lib/class-testimonials-widget-settings.php:
|
425 |
msgid "Allow Comments?"
|
426 |
msgstr ""
|
427 |
|
428 |
-
#: lib/class-testimonials-widget-settings.php:
|
429 |
msgid ""
|
430 |
-
"Only affects the Testimonials
|
431 |
-
"
|
432 |
msgstr ""
|
433 |
|
434 |
-
#: lib/class-testimonials-widget-settings.php:
|
435 |
msgid "URL slug-name for <a href=\"%1s\">testimonials archive</a> page."
|
436 |
msgstr ""
|
437 |
|
438 |
-
#: lib/class-testimonials-widget-settings.php:
|
439 |
msgid "Archive Page URL"
|
440 |
msgstr ""
|
441 |
|
442 |
-
#: lib/class-testimonials-widget-settings.php:
|
443 |
msgid ""
|
444 |
"URL slug-name for testimonial view pages. Shouldn't be the same as the "
|
445 |
"Archive Page URL nor should it match a page URL slug."
|
446 |
msgstr ""
|
447 |
|
448 |
-
#: lib/class-testimonials-widget-settings.php:
|
449 |
msgid "Testimonial Page URL"
|
450 |
msgstr ""
|
451 |
|
452 |
-
#: lib/class-testimonials-widget-settings.php:
|
453 |
-
msgid "Compatiblity Options"
|
454 |
msgstr ""
|
455 |
|
456 |
-
#: lib/class-testimonials-widget-settings.php:
|
457 |
msgid "Don't Use Default Taxonomies?"
|
458 |
msgstr ""
|
459 |
|
460 |
-
#: lib/class-testimonials-widget-settings.php:
|
461 |
-
msgid ""
|
462 |
-
"If checked, use Testimonials Widget's own category and tag taxonomies instead"
|
463 |
-
msgstr ""
|
464 |
-
|
465 |
-
#: lib/class-testimonials-widget-settings.php:538
|
466 |
-
msgid "Export Settings"
|
467 |
-
msgstr ""
|
468 |
-
|
469 |
-
#: lib/class-testimonials-widget-settings.php:540
|
470 |
-
msgid ""
|
471 |
-
"These are your current settings in a serialized format. Copy the contents to "
|
472 |
-
"make a backup of your settings."
|
473 |
-
msgstr ""
|
474 |
-
|
475 |
-
#: lib/class-testimonials-widget-settings.php:548
|
476 |
-
msgid "Import Settings"
|
477 |
-
msgstr ""
|
478 |
-
|
479 |
-
#: lib/class-testimonials-widget-settings.php:550
|
480 |
-
msgid ""
|
481 |
-
"Paste new serialized settings here to overwrite your current configuration."
|
482 |
-
msgstr ""
|
483 |
-
|
484 |
-
#: lib/class-testimonials-widget-settings.php:556
|
485 |
-
msgid "Remove Plugin Data on Deletion?"
|
486 |
-
msgstr ""
|
487 |
-
|
488 |
-
#: lib/class-testimonials-widget-settings.php:560
|
489 |
-
msgid ""
|
490 |
-
"Delete all Testimonials Widget data and options from database on plugin "
|
491 |
-
"deletion"
|
492 |
-
msgstr ""
|
493 |
-
|
494 |
-
#: lib/class-testimonials-widget-settings.php:566
|
495 |
-
msgid "Reset to Defaults?"
|
496 |
-
msgstr ""
|
497 |
-
|
498 |
-
#: lib/class-testimonials-widget-settings.php:570
|
499 |
-
msgid "Check this box to reset options to their defaults"
|
500 |
msgstr ""
|
501 |
|
502 |
-
#: lib/class-testimonials-widget-settings.php:
|
503 |
msgid "Version Based Options"
|
504 |
msgstr ""
|
505 |
|
506 |
-
#: lib/class-testimonials-widget-settings.php:
|
507 |
msgid "Use bxSlider?"
|
508 |
msgstr ""
|
509 |
|
510 |
-
#: lib/class-testimonials-widget-settings.php:
|
511 |
-
msgid ""
|
512 |
-
"Pre 2.15.0, Testimonials Widgets used custom JavaScript for transitions."
|
513 |
msgstr ""
|
514 |
|
515 |
-
#: lib/class-testimonials-widget-settings.php:
|
516 |
msgid "Disable Animation?"
|
517 |
msgstr ""
|
518 |
|
519 |
-
#: lib/class-testimonials-widget-settings.php:
|
520 |
msgid ""
|
521 |
"Pre 2.15.0, Disable animation between testimonial transitions. Useful when "
|
522 |
"stacking widgets."
|
523 |
msgstr ""
|
524 |
|
525 |
-
#: lib/class-testimonials-widget-settings.php:
|
526 |
msgid "Fade Out Speed"
|
527 |
msgstr ""
|
528 |
|
529 |
-
#: lib/class-testimonials-widget-settings.php:
|
530 |
-
#: lib/class-testimonials-widget-settings.php:
|
531 |
msgid ""
|
532 |
"Pre 2.15.0, Transition duration in milliseconds; higher values indicate "
|
533 |
"slower animations, not faster ones."
|
534 |
msgstr ""
|
535 |
|
536 |
-
#: lib/class-testimonials-widget-settings.php:
|
537 |
msgid "Fade In Speed"
|
538 |
msgstr ""
|
539 |
|
540 |
-
#: lib/class-testimonials-widget-settings.php:
|
541 |
msgid "Height"
|
542 |
msgstr ""
|
543 |
|
544 |
-
#: lib/class-testimonials-widget-settings.php:
|
545 |
msgid ""
|
546 |
"Pre 2.15.0, Testimonials height, in pixels. Overrides minimum and maximum "
|
547 |
"height"
|
548 |
msgstr ""
|
549 |
|
550 |
-
#: lib/class-testimonials-widget-settings.php:
|
551 |
msgid "Minimum Height"
|
552 |
msgstr ""
|
553 |
|
554 |
-
#: lib/class-testimonials-widget-settings.php:
|
555 |
msgid "Pre 2.15.0, Set for minimum display height, in pixels"
|
556 |
msgstr ""
|
557 |
|
558 |
-
#: lib/class-testimonials-widget-settings.php:
|
559 |
msgid "Maximum Height"
|
560 |
msgstr ""
|
561 |
|
562 |
-
#: lib/class-testimonials-widget-settings.php:
|
563 |
msgid "Pre 2.15.0, Set for maximum display height, in pixels"
|
564 |
msgstr ""
|
565 |
|
566 |
-
#: lib/class-testimonials-widget-settings.php:
|
567 |
msgid "Always Load CSS?"
|
568 |
msgstr ""
|
569 |
|
570 |
-
#: lib/class-testimonials-widget-settings.php:
|
571 |
-
msgid ""
|
572 |
-
"Pre 2.14.0, Testimonials Widgets CSS was always loaded, whether needed or not"
|
573 |
msgstr ""
|
574 |
|
575 |
-
#: lib/class-testimonials-widget-settings.php:
|
576 |
msgid "Include IE7 CSS?"
|
577 |
msgstr ""
|
578 |
|
579 |
-
#: lib/class-testimonials-widget-settings.php:
|
580 |
msgid "IE7 specific CSS moved to separate CSS file in version 2.13.6."
|
581 |
msgstr ""
|
582 |
|
583 |
-
#: lib/class-testimonials-widget-settings.php:
|
584 |
msgid "Use `<q>` tag?"
|
585 |
msgstr ""
|
586 |
|
587 |
-
#: lib/class-testimonials-widget-settings.php:
|
588 |
msgid "Pre 2.11.0, not HTML5 compliant"
|
589 |
msgstr ""
|
590 |
|
591 |
-
#: lib/class-testimonials-widget-settings.php:
|
592 |
msgid "Remove `.hentry` CSS?"
|
593 |
msgstr ""
|
594 |
|
595 |
-
#: lib/class-testimonials-widget-settings.php:
|
596 |
msgid ""
|
597 |
"Pre 2.6.4, some themes use class `.hentry` in a manner that breaks "
|
598 |
-
"Testimonials
|
599 |
-
msgstr ""
|
600 |
-
|
601 |
-
#: lib/class-testimonials-widget-settings.php:785
|
602 |
-
msgid "Save Changes"
|
603 |
-
msgstr ""
|
604 |
-
|
605 |
-
#: lib/class-testimonials-widget-settings.php:792
|
606 |
-
msgid ""
|
607 |
-
"When ready, <a href=\"%1$s\">view</a> or <a href=\"%2$s\">add</a> "
|
608 |
-
"testimonials."
|
609 |
msgstr ""
|
610 |
|
611 |
-
#: lib/class-testimonials-widget-settings.php:
|
612 |
msgid ""
|
613 |
-
"
|
614 |
-
"Karma\"><img src=\"%2$s\" border=\"0\" alt=\"Donate for Good Karma\" /></a> "
|
615 |
-
"or <a href=\"%3$s\" title=\"purchase Testimonials Widget Premium\">purchase "
|
616 |
-
"Testimonials Widget Premium</a> to help fund further development and <a href="
|
617 |
-
"\"%4$s\" title=\"Support forums\">support</a>."
|
618 |
-
msgstr ""
|
619 |
-
|
620 |
-
#: lib/class-testimonials-widget-settings.php:813
|
621 |
-
msgid "Copyright ©%1$s <a href=\"%2$s\">Aihrus</a>."
|
622 |
-
msgstr ""
|
623 |
-
|
624 |
-
#: lib/class-testimonials-widget-settings.php:1274
|
625 |
-
msgid "Required"
|
626 |
-
msgstr ""
|
627 |
-
|
628 |
-
#: lib/class-testimonials-widget-settings.php:1391
|
629 |
-
msgid ""
|
630 |
-
"These Testimonials Widget Settings establish the default option values for "
|
631 |
"shortcodes, theme functions, and widget instances. Widgets, once created no "
|
632 |
"longer inherit these global settings. Therefore, you'll need to update each "
|
633 |
"widget with the new settings. It might be easier to delete the widget and "
|
634 |
"then recreate it."
|
635 |
msgstr ""
|
636 |
|
637 |
-
#: lib/class-testimonials-widget-settings.php:
|
638 |
msgid "Shortcode option names are listed below each entry."
|
639 |
msgstr ""
|
640 |
|
641 |
-
#: lib/class-testimonials-widget-settings.php:
|
642 |
-
msgid "View the <a href=\"%s\">Testimonials
|
643 |
msgstr ""
|
644 |
|
645 |
-
#: lib/class-testimonials-widget-settings.php:
|
646 |
msgid "Show or hide optional fields."
|
647 |
msgstr ""
|
648 |
|
649 |
-
#: lib/class-testimonials-widget-settings.php:
|
650 |
msgid "Options used to select testimonials."
|
651 |
msgstr ""
|
652 |
|
653 |
-
#: lib/class-testimonials-widget-settings.php:
|
654 |
msgid "Options used to determine displayed testimonials ordering."
|
655 |
msgstr ""
|
656 |
|
657 |
-
#: lib/class-testimonials-widget-settings.php:
|
658 |
msgid "Options related to showing testimonials in widgets."
|
659 |
msgstr ""
|
660 |
|
661 |
-
#: lib/class-testimonials-widget-settings.php:
|
662 |
msgid "Archive and singular page URL related testimonials options."
|
663 |
msgstr ""
|
664 |
|
665 |
-
#: lib/class-testimonials-widget-settings.php:
|
666 |
-
msgid "
|
667 |
msgstr ""
|
668 |
|
669 |
-
#: lib/class-testimonials-widget-
|
670 |
-
msgid "
|
671 |
msgstr ""
|
672 |
|
673 |
-
|
674 |
-
|
675 |
-
#: lib/class-testimonials-widget-widget.php:37
|
676 |
-
msgid "Testimonials Widget"
|
677 |
msgstr ""
|
678 |
|
679 |
-
#: lib/class-testimonials-widget-widget.php:
|
680 |
msgid "CSS Class"
|
681 |
msgstr ""
|
682 |
|
683 |
-
#: lib/class-testimonials-widget-widget.php:
|
684 |
msgid "This widget's unique CSS class for styling"
|
685 |
msgstr ""
|
686 |
|
687 |
-
#:
|
688 |
-
msgid "
|
689 |
msgstr ""
|
690 |
|
691 |
-
#: testimonials-widget.php:
|
692 |
-
msgid ""
|
693 |
-
"If your Testimonials Widget display has gone to funky town, please <a href="
|
694 |
-
"\"%s\">read the FAQ</a> about possible CSS fixes."
|
695 |
msgstr ""
|
696 |
|
697 |
-
#: testimonials-widget.php:
|
698 |
msgid ""
|
699 |
-
"
|
700 |
-
"
|
701 |
msgstr ""
|
702 |
|
703 |
-
#: testimonials-widget.php:
|
704 |
msgid "ID"
|
705 |
msgstr ""
|
706 |
|
707 |
-
#: testimonials-widget.php:
|
708 |
msgid "Image"
|
709 |
msgstr ""
|
710 |
|
711 |
-
#: testimonials-widget.php:
|
712 |
msgid "Shortcodes"
|
713 |
msgstr ""
|
714 |
|
715 |
-
#: testimonials-widget.php:
|
716 |
msgid "Published by"
|
717 |
msgstr ""
|
718 |
|
719 |
-
#: testimonials-widget.php:
|
720 |
msgid "Category"
|
721 |
msgstr ""
|
722 |
|
723 |
-
#: testimonials-widget.php:
|
724 |
msgid "Tags"
|
725 |
msgstr ""
|
726 |
|
727 |
-
#: testimonials-widget.php:
|
728 |
msgid "Add New"
|
729 |
msgstr ""
|
730 |
|
731 |
-
#: testimonials-widget.php:
|
732 |
msgid "Add New Testimonial"
|
733 |
msgstr ""
|
734 |
|
735 |
-
#: testimonials-widget.php:
|
736 |
msgid "Edit Testimonial"
|
737 |
msgstr ""
|
738 |
|
739 |
-
#: testimonials-widget.php:
|
740 |
msgid "No testimonials found"
|
741 |
msgstr ""
|
742 |
|
743 |
-
#: testimonials-widget.php:
|
744 |
msgid "No testimonials found in Trash"
|
745 |
msgstr ""
|
746 |
|
747 |
-
#: testimonials-widget.php:
|
748 |
msgid "Search Testimonials"
|
749 |
msgstr ""
|
750 |
|
751 |
-
#: testimonials-widget.php:
|
752 |
msgid "Testimonial"
|
753 |
msgstr ""
|
754 |
|
755 |
-
#: testimonials-widget.php:
|
756 |
msgid "View Testimonial"
|
757 |
msgstr ""
|
758 |
|
759 |
-
#: testimonials-widget.php:
|
760 |
msgid "…"
|
761 |
msgstr ""
|
762 |
|
763 |
-
#: testimonials-widget.php:
|
764 |
msgid "«"
|
765 |
msgstr ""
|
766 |
|
767 |
-
#: testimonials-widget.php:
|
768 |
msgid "»"
|
769 |
msgstr ""
|
770 |
|
771 |
-
#: testimonials-widget.php:
|
772 |
msgid "Testimonial Data"
|
773 |
msgstr ""
|
774 |
|
775 |
-
#: testimonials-widget.php:
|
776 |
msgid "Enter title here"
|
777 |
msgstr ""
|
778 |
|
779 |
-
#: testimonials-widget.php:
|
780 |
msgid "Enter testimonial source here"
|
781 |
msgstr ""
|
782 |
|
783 |
-
#: testimonials-widget.php:
|
784 |
msgid "Testimonial updated. <a href=\"%s\">View testimonial</a>"
|
785 |
msgstr ""
|
786 |
|
787 |
-
#: testimonials-widget.php:
|
788 |
msgid "Custom field updated."
|
789 |
msgstr ""
|
790 |
|
791 |
-
#: testimonials-widget.php:
|
792 |
msgid "Custom field deleted."
|
793 |
msgstr ""
|
794 |
|
795 |
-
#: testimonials-widget.php:
|
796 |
msgid "Testimonial updated."
|
797 |
msgstr ""
|
798 |
|
799 |
#. translators: %s: date and time of the revision
|
800 |
-
#: testimonials-widget.php:
|
801 |
msgid "Testimonial restored to revision from %s"
|
802 |
msgstr ""
|
803 |
|
804 |
-
#: testimonials-widget.php:
|
805 |
msgid "Testimonial published. <a href=\"%s\">View testimonial</a>"
|
806 |
msgstr ""
|
807 |
|
808 |
-
#: testimonials-widget.php:
|
809 |
msgid "Testimonial saved."
|
810 |
msgstr ""
|
811 |
|
812 |
-
#: testimonials-widget.php:
|
813 |
msgid ""
|
814 |
"Testimonial submitted. <a target=\"_blank\" href=\"%s\">Preview testimonial</"
|
815 |
"a>"
|
816 |
msgstr ""
|
817 |
|
818 |
-
#: testimonials-widget.php:
|
819 |
msgid ""
|
820 |
"Testimonial scheduled for: <strong>%1$s</strong>. <a target=\"_blank\" href="
|
821 |
"\"%2$s\">Preview testimonial</a>"
|
822 |
msgstr ""
|
823 |
|
824 |
-
#: testimonials-widget.php:
|
825 |
msgid ""
|
826 |
"Testimonial draft updated. <a target=\"_blank\" href=\"%s\">Preview "
|
827 |
"testimonial</a>"
|
828 |
msgstr ""
|
829 |
|
830 |
-
#: testimonials-widget.php:
|
831 |
msgid ""
|
832 |
-
"If your Testimonials
|
833 |
-
"\"
|
834 |
msgstr ""
|
835 |
|
836 |
#. Plugin URI of the plugin/theme
|
837 |
-
msgid "http://wordpress.org/
|
838 |
msgstr ""
|
839 |
|
840 |
#. Description of the plugin/theme
|
841 |
msgid ""
|
842 |
-
"Testimonials
|
843 |
-
"
|
844 |
-
"blog."
|
845 |
msgstr ""
|
846 |
|
847 |
#. Author of the plugin/theme
|
@@ -849,5 +900,5 @@ msgid "Michael Cannon"
|
|
849 |
msgstr ""
|
850 |
|
851 |
#. Author URI of the plugin/theme
|
852 |
-
msgid "http://aihr.us/
|
853 |
msgstr ""
|
1 |
+
# Copyright (C) 2013 Testimonials
|
2 |
+
# This file is distributed under the same license as the Testimonials package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Testimonials 2.16.0\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/testimonials-widget\n"
|
7 |
+
"POT-Creation-Date: 2013-11-28 00:45:54+00:00\n"
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
13 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
14 |
|
15 |
+
#: lib/aihrus/class-aihrus-common.php:116
|
16 |
+
msgid "<a href=\"%1$s\">update to</a>"
|
|
|
17 |
msgstr ""
|
18 |
|
19 |
+
#: lib/aihrus/class-aihrus-common.php:121
|
20 |
+
msgid "<a href=\"%1$s\">install</a>"
|
21 |
+
msgstr ""
|
22 |
+
|
23 |
+
#: lib/aihrus/class-aihrus-common.php:124
|
24 |
+
msgid "<a href=\"%1$s\">activate</a>"
|
25 |
+
msgstr ""
|
26 |
+
|
27 |
+
#: lib/aihrus/class-aihrus-common.php:128
|
28 |
+
msgid ""
|
29 |
+
"Plugin %3$s has been deactivated. Please %1$s %4$s version %2$s or newer "
|
30 |
+
"before activating %3$s."
|
31 |
+
msgstr ""
|
32 |
+
|
33 |
+
#: lib/aihrus/class-aihrus-common.php:140
|
34 |
+
msgid ""
|
35 |
+
"<a href=\"%1$s\">%2$s > Settings</a>, <em>Premium</em> tab, <em>License "
|
36 |
+
"Key</em> entry"
|
37 |
+
msgstr ""
|
38 |
+
|
39 |
+
#: lib/aihrus/class-aihrus-common.php:145
|
40 |
+
msgid "<a href=\"%s\">Where's my license key?</a>"
|
41 |
+
msgstr ""
|
42 |
+
|
43 |
+
#: lib/aihrus/class-aihrus-common.php:150
|
44 |
+
msgid "<a href=\"%1$s\">%2$s</a>"
|
45 |
+
msgstr ""
|
46 |
+
|
47 |
+
#: lib/aihrus/class-aihrus-common.php:154
|
48 |
+
msgid ""
|
49 |
+
"Plugin %1$s requires license activation before updating will work. Please "
|
50 |
+
"activate the license key via %2$s. No license key? See %3$s or purchase %4$s."
|
51 |
+
msgstr ""
|
52 |
+
|
53 |
+
#: lib/aihrus/class-aihrus-common.php:200
|
54 |
+
msgid ""
|
55 |
+
"Please donate $5 towards ongoing support and development of the %1$s plugin. "
|
56 |
+
"%2$s"
|
57 |
+
msgstr ""
|
58 |
+
|
59 |
+
#: lib/aihrus/class-aihrus-settings.php:61
|
60 |
+
msgid "Reset"
|
61 |
+
msgstr ""
|
62 |
+
|
63 |
+
#: lib/aihrus/class-aihrus-settings.php:62
|
64 |
+
msgid "About"
|
65 |
+
msgstr ""
|
66 |
+
|
67 |
+
#: lib/aihrus/class-aihrus-settings.php:80
|
68 |
+
msgid "Export Settings"
|
69 |
+
msgstr ""
|
70 |
+
|
71 |
+
#: lib/aihrus/class-aihrus-settings.php:82
|
72 |
+
msgid ""
|
73 |
+
"These are your current settings in a serialized format. Copy the contents to "
|
74 |
+
"make a backup of your settings."
|
75 |
+
msgstr ""
|
76 |
+
|
77 |
+
#: lib/aihrus/class-aihrus-settings.php:90
|
78 |
+
msgid "Import Settings"
|
79 |
+
msgstr ""
|
80 |
+
|
81 |
+
#: lib/aihrus/class-aihrus-settings.php:92
|
82 |
+
msgid ""
|
83 |
+
"Paste new serialized settings here to overwrite your current configuration."
|
84 |
+
msgstr ""
|
85 |
+
|
86 |
+
#: lib/aihrus/class-aihrus-settings.php:98
|
87 |
+
msgid "Remove Plugin Data on Deletion?"
|
88 |
+
msgstr ""
|
89 |
+
|
90 |
+
#: lib/aihrus/class-aihrus-settings.php:101
|
91 |
+
msgid ""
|
92 |
+
"Delete all WordPress Starter data and options from database on plugin "
|
93 |
+
"deletion"
|
94 |
+
msgstr ""
|
95 |
+
|
96 |
+
#: lib/aihrus/class-aihrus-settings.php:107
|
97 |
+
msgid "Reset to Defaults?"
|
98 |
+
msgstr ""
|
99 |
+
|
100 |
+
#: lib/aihrus/class-aihrus-settings.php:110
|
101 |
+
msgid "Check this box to reset options to their defaults"
|
102 |
+
msgstr ""
|
103 |
+
|
104 |
+
#: lib/aihrus/class-aihrus-settings.php:234
|
105 |
+
msgid ""
|
106 |
+
"<img class=\"alignright size-medium\" src=\"%1$s/media/michael-cannon-red-"
|
107 |
+
"square-300x2251.jpg\" alt=\"Michael in Red Square, Moscow, Russia\" width="
|
108 |
+
"\"300\" height=\"225\" /><a href=\"%2$s\">%3$s</a> is by <a href=\"%4$s"
|
109 |
+
"\">Michael Cannon</a>. He's <a href=\"%5$s\">Peichi’s</a> smiling man, an "
|
110 |
+
"adventurous <a href=\"%6$s\" target=\"_blank\">water-rat</a>, <a href=\"%7$s"
|
111 |
+
"\">chief people officer</a>, <a href=\"%8$s\">cyclist</a>, <a href=\"%9$s"
|
112 |
+
"\">full stack developer</a>, <a href=\"%10$s\">poet</a>, <a href=\"%11$s"
|
113 |
+
"\">WWOOF’er</a> and <a href=\"%12$s\">world traveler</a>."
|
114 |
+
msgstr ""
|
115 |
+
|
116 |
+
#: lib/aihrus/class-aihrus-settings.php:276
|
117 |
+
msgid "Save Changes"
|
118 |
+
msgstr ""
|
119 |
+
|
120 |
+
#: lib/aihrus/class-aihrus-settings.php:284
|
121 |
+
msgid ""
|
122 |
+
"If you like this plugin, please <a href=\"%1$s\" title=\"Donate for Good "
|
123 |
+
"Karma\"><img src=\"%2$s\" border=\"0\" alt=\"Donate for Good Karma\" /></a> "
|
124 |
+
"or <a href=\"%3$s\" title=\"purchase premium WordPress plugins from Aihrus "
|
125 |
+
"\">purchase the Premium version</a> to help fund further development and <a "
|
126 |
+
"href=\"%4$s\" title=\"Support forums\">support</a>."
|
127 |
+
msgstr ""
|
128 |
+
|
129 |
+
#: lib/aihrus/class-aihrus-settings.php:295
|
130 |
+
msgid "Copyright ©%1$s <a href=\"%2$s\">Aihrus</a>."
|
131 |
+
msgstr ""
|
132 |
+
|
133 |
+
#: lib/aihrus/class-aihrus-settings.php:596
|
134 |
+
msgid "Required"
|
135 |
+
msgstr ""
|
136 |
+
|
137 |
+
#: lib/aihrus/class-aihrus-widget.php:177
|
138 |
+
msgid "Expand/Collapse All Options"
|
139 |
+
msgstr ""
|
140 |
+
|
141 |
+
#: lib/aihrus/class-aihrus-widget.php:186
|
142 |
+
msgid "Expand/Collapse"
|
143 |
+
msgstr ""
|
144 |
+
|
145 |
+
#: lib/class-testimonials-widget-settings.php:89
|
146 |
+
msgid "Testimonials Settings"
|
147 |
+
msgstr ""
|
148 |
+
|
149 |
+
#: lib/class-testimonials-widget-settings.php:89 testimonials-widget.php:118
|
150 |
msgid "Settings"
|
151 |
msgstr ""
|
152 |
|
153 |
+
#: lib/class-testimonials-widget-settings.php:105
|
154 |
+
#: lib/class-testimonials-widget-settings.php:872
|
155 |
msgid "General"
|
156 |
msgstr ""
|
157 |
|
158 |
+
#: lib/class-testimonials-widget-settings.php:106
|
159 |
+
#: lib/class-testimonials-widget-settings.php:880
|
160 |
msgid "Selection"
|
161 |
msgstr ""
|
162 |
|
163 |
+
#: lib/class-testimonials-widget-settings.php:107
|
164 |
+
#: lib/class-testimonials-widget-settings.php:888
|
165 |
msgid "Ordering"
|
166 |
msgstr ""
|
167 |
|
168 |
+
#: lib/class-testimonials-widget-settings.php:108
|
169 |
+
#: lib/class-testimonials-widget-settings.php:896
|
170 |
msgid "Widget"
|
171 |
msgstr ""
|
172 |
|
173 |
+
#: lib/class-testimonials-widget-settings.php:109
|
174 |
+
#: lib/class-testimonials-widget-settings.php:904
|
175 |
msgid "Post Type"
|
176 |
msgstr ""
|
177 |
|
178 |
+
#: lib/class-testimonials-widget-settings.php:126
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
179 |
msgid "Widget Title"
|
180 |
msgstr ""
|
181 |
|
182 |
+
#. #-#-#-#-# testimonials-widget.pot (Testimonials 2.16.0) #-#-#-#-#
|
183 |
+
#. Plugin Name of the plugin/theme
|
184 |
+
#: lib/class-testimonials-widget-settings.php:127
|
185 |
+
#: lib/class-testimonials-widget-widget.php:29 testimonials-widget.php:484
|
186 |
+
#: testimonials-widget.php:529
|
187 |
msgid "Testimonials"
|
188 |
msgstr ""
|
189 |
|
190 |
+
#: lib/class-testimonials-widget-settings.php:133
|
191 |
msgid "Title Link"
|
192 |
msgstr ""
|
193 |
|
194 |
+
#: lib/class-testimonials-widget-settings.php:134
|
195 |
msgid ""
|
196 |
"URL, path, or post ID to link widget title to. Ex: http://example.com/"
|
197 |
"stuff, /testimonials, 123 or "
|
198 |
msgstr ""
|
199 |
|
200 |
+
#: lib/class-testimonials-widget-settings.php:140
|
201 |
msgid "Character Limit"
|
202 |
msgstr ""
|
203 |
|
204 |
+
#: lib/class-testimonials-widget-settings.php:141
|
205 |
msgid "Number of characters to limit non-single testimonial views to"
|
206 |
msgstr ""
|
207 |
|
208 |
+
#: lib/class-testimonials-widget-settings.php:147
|
209 |
msgid "Rotation Speed"
|
210 |
msgstr ""
|
211 |
|
212 |
+
#: lib/class-testimonials-widget-settings.php:148
|
213 |
msgid ""
|
214 |
"Number of seconds between testimonial rotations or 0 for no rotation at all "
|
215 |
"refresh"
|
216 |
msgstr ""
|
217 |
|
218 |
+
#: lib/class-testimonials-widget-settings.php:160
|
219 |
msgid "Additional Widget Options"
|
220 |
msgstr ""
|
221 |
|
222 |
+
#: lib/class-testimonials-widget-settings.php:166
|
223 |
msgid "Transition Mode?"
|
224 |
msgstr ""
|
225 |
|
226 |
+
#: lib/class-testimonials-widget-settings.php:167
|
227 |
msgid "Type of transition between slides"
|
228 |
msgstr ""
|
229 |
|
230 |
+
#: lib/class-testimonials-widget-settings.php:170
|
231 |
msgid "Fade"
|
232 |
msgstr ""
|
233 |
|
234 |
+
#: lib/class-testimonials-widget-settings.php:171
|
235 |
msgid "Horizontal"
|
236 |
msgstr ""
|
237 |
|
238 |
+
#: lib/class-testimonials-widget-settings.php:172
|
239 |
msgid "Vertical"
|
240 |
msgstr ""
|
241 |
|
242 |
+
#: lib/class-testimonials-widget-settings.php:179
|
243 |
msgid "Show Play/Pause?"
|
244 |
msgstr ""
|
245 |
|
246 |
+
#: lib/class-testimonials-widget-settings.php:180
|
247 |
msgid "Display start and stop buttons underneath the testimonial slider."
|
248 |
msgstr ""
|
249 |
|
250 |
+
#: lib/class-testimonials-widget-settings.php:188
|
251 |
msgid "Enable Video?"
|
252 |
msgstr ""
|
253 |
|
254 |
+
#: lib/class-testimonials-widget-settings.php:189
|
255 |
msgid "Only enable when displaying video content."
|
256 |
msgstr ""
|
257 |
|
258 |
+
#: lib/class-testimonials-widget-settings.php:196
|
259 |
msgid "Keep Whitespace?"
|
260 |
msgstr ""
|
261 |
|
262 |
+
#: lib/class-testimonials-widget-settings.php:197
|
263 |
msgid "Keeps testimonials looking as entered than sans auto-formatting"
|
264 |
msgstr ""
|
265 |
|
266 |
+
#: lib/class-testimonials-widget-settings.php:204
|
267 |
msgid "Testimonial Bottom Text"
|
268 |
msgstr ""
|
269 |
|
270 |
+
#: lib/class-testimonials-widget-settings.php:205
|
271 |
msgid "Custom text or HTML for bottom of testimonials"
|
272 |
msgstr ""
|
273 |
|
274 |
+
#: lib/class-testimonials-widget-settings.php:217
|
275 |
msgid "General Options"
|
276 |
msgstr ""
|
277 |
|
278 |
+
#: lib/class-testimonials-widget-settings.php:221
|
279 |
msgid ""
|
280 |
"Adds HTML tag markup per the <a href=\"%s\">Review schema</a> to "
|
281 |
"testimonials. Search engines including Bing, Google, Yahoo! and Yandex rely "
|
282 |
"on this markup to improve the display of search results."
|
283 |
msgstr ""
|
284 |
|
285 |
+
#: lib/class-testimonials-widget-settings.php:224
|
286 |
msgid "Enable Review Schema?"
|
287 |
msgstr ""
|
288 |
|
289 |
+
#: lib/class-testimonials-widget-settings.php:232
|
290 |
msgid "Reviewed Item?"
|
291 |
msgstr ""
|
292 |
|
293 |
+
#: lib/class-testimonials-widget-settings.php:233
|
294 |
msgid "Name of thing being referenced in testimonials"
|
295 |
msgstr ""
|
296 |
|
297 |
+
#: lib/class-testimonials-widget-settings.php:239
|
298 |
msgid "Reviewed Item URL?"
|
299 |
msgstr ""
|
300 |
|
301 |
+
#: lib/class-testimonials-widget-settings.php:240
|
302 |
msgid "URL of thing being referenced in testimonials"
|
303 |
msgstr ""
|
304 |
|
305 |
+
#: lib/class-testimonials-widget-settings.php:247
|
306 |
msgid "Hide built-in quotes?"
|
307 |
msgstr ""
|
308 |
|
309 |
+
#: lib/class-testimonials-widget-settings.php:248
|
310 |
msgid "Remove open and close quote span tags surrounding testimonial content"
|
311 |
msgstr ""
|
312 |
|
313 |
+
#: lib/class-testimonials-widget-settings.php:254
|
314 |
msgid "Hide \"Testimonials Not Found\"?"
|
315 |
msgstr ""
|
316 |
|
317 |
+
#: lib/class-testimonials-widget-settings.php:260
|
318 |
msgid "Hide Gravatar Image?"
|
319 |
msgstr ""
|
320 |
|
321 |
+
#: lib/class-testimonials-widget-settings.php:266
|
322 |
msgid "Hide Image?"
|
323 |
msgstr ""
|
324 |
|
325 |
+
#: lib/class-testimonials-widget-settings.php:272
|
326 |
msgid "Hide Image in Single View?"
|
327 |
msgstr ""
|
328 |
|
329 |
+
#: lib/class-testimonials-widget-settings.php:279
|
330 |
msgid "Hide Testimonial Content?"
|
331 |
msgstr ""
|
332 |
|
333 |
+
#: lib/class-testimonials-widget-settings.php:285
|
334 |
msgid "Hide Author/Source?"
|
335 |
msgstr ""
|
336 |
|
337 |
+
#: lib/class-testimonials-widget-settings.php:288
|
338 |
msgid "Don't display \"Post Title\" in cite"
|
339 |
msgstr ""
|
340 |
|
341 |
+
#: lib/class-testimonials-widget-settings.php:292
|
342 |
msgid "Hide Email?"
|
343 |
msgstr ""
|
344 |
|
345 |
+
#: lib/class-testimonials-widget-settings.php:299
|
346 |
msgid "Hide Job Title?"
|
347 |
msgstr ""
|
348 |
|
349 |
+
#: lib/class-testimonials-widget-settings.php:305
|
350 |
msgid "Hide Location?"
|
351 |
msgstr ""
|
352 |
|
353 |
+
#: lib/class-testimonials-widget-settings.php:311
|
354 |
msgid "Hide Company?"
|
355 |
msgstr ""
|
356 |
|
357 |
+
#: lib/class-testimonials-widget-settings.php:317
|
358 |
msgid "Hide URL?"
|
359 |
msgstr ""
|
360 |
|
361 |
+
#: lib/class-testimonials-widget-settings.php:323
|
362 |
msgid "URL Target"
|
363 |
msgstr ""
|
364 |
|
365 |
+
#: lib/class-testimonials-widget-settings.php:324
|
366 |
msgid "Add target to all URLs; leave blank if none"
|
367 |
msgstr ""
|
368 |
|
369 |
+
#: lib/class-testimonials-widget-settings.php:329
|
370 |
msgid "Enable Paging?"
|
371 |
msgstr ""
|
372 |
|
373 |
+
#: lib/class-testimonials-widget-settings.php:330
|
374 |
msgid "For `[testimonialswidget_list]`"
|
375 |
msgstr ""
|
376 |
|
377 |
+
#: lib/class-testimonials-widget-settings.php:333
|
378 |
msgid "Disable"
|
379 |
msgstr ""
|
380 |
|
381 |
+
#: lib/class-testimonials-widget-settings.php:334
|
382 |
msgid "Enable"
|
383 |
msgstr ""
|
384 |
|
385 |
+
#: lib/class-testimonials-widget-settings.php:335
|
386 |
msgid "Before testimonials"
|
387 |
msgstr ""
|
388 |
|
389 |
+
#: lib/class-testimonials-widget-settings.php:336
|
390 |
msgid "After testimonials"
|
391 |
msgstr ""
|
392 |
|
393 |
+
#: lib/class-testimonials-widget-settings.php:343
|
394 |
msgid "Do [shortcodes]?"
|
395 |
msgstr ""
|
396 |
|
397 |
+
#: lib/class-testimonials-widget-settings.php:344
|
398 |
msgid "If unchecked, shortcodes are stripped."
|
399 |
msgstr ""
|
400 |
|
401 |
+
#: lib/class-testimonials-widget-settings.php:357
|
402 |
msgid "Selection Options"
|
403 |
msgstr ""
|
404 |
|
405 |
+
#: lib/class-testimonials-widget-settings.php:363
|
406 |
msgid "Category Filter"
|
407 |
msgstr ""
|
408 |
|
409 |
+
#: lib/class-testimonials-widget-settings.php:364
|
410 |
msgid "Comma separated category names. Ex: Category A, Another category"
|
411 |
msgstr ""
|
412 |
|
413 |
+
#: lib/class-testimonials-widget-settings.php:371
|
414 |
msgid "Tags Filter"
|
415 |
msgstr ""
|
416 |
|
417 |
+
#: lib/class-testimonials-widget-settings.php:372
|
418 |
msgid "Comma separated tag names. Ex: Tag A, Another tag"
|
419 |
msgstr ""
|
420 |
|
421 |
+
#: lib/class-testimonials-widget-settings.php:379
|
422 |
msgid "Require All Tags?"
|
423 |
msgstr ""
|
424 |
|
425 |
+
#: lib/class-testimonials-widget-settings.php:380
|
426 |
msgid "Select only testimonials with all of the given tags"
|
427 |
msgstr ""
|
428 |
|
429 |
+
#: lib/class-testimonials-widget-settings.php:387
|
430 |
msgid "Include IDs Filter"
|
431 |
msgstr ""
|
432 |
|
433 |
+
#: lib/class-testimonials-widget-settings.php:388
|
434 |
+
#: lib/class-testimonials-widget-settings.php:395
|
435 |
msgid "Comma separated testimonial IDs. Ex: 3,1,2"
|
436 |
msgstr ""
|
437 |
|
438 |
+
#: lib/class-testimonials-widget-settings.php:394
|
439 |
msgid "Exclude IDs Filter"
|
440 |
msgstr ""
|
441 |
|
442 |
+
#: lib/class-testimonials-widget-settings.php:401
|
443 |
msgid "Limit"
|
444 |
msgstr ""
|
445 |
|
446 |
+
#: lib/class-testimonials-widget-settings.php:402
|
447 |
msgid "Number of testimonials to select per instance"
|
448 |
msgstr ""
|
449 |
|
450 |
+
#: lib/class-testimonials-widget-settings.php:415
|
451 |
msgid "Ordering Options"
|
452 |
msgstr ""
|
453 |
|
454 |
+
#: lib/class-testimonials-widget-settings.php:421
|
455 |
msgid "Random Order?"
|
456 |
msgstr ""
|
457 |
|
458 |
+
#: lib/class-testimonials-widget-settings.php:422
|
459 |
msgid ""
|
460 |
"If checked, ignores ORDER BY, ORDER BY meta_key, and ORDER BY Order. Widgets "
|
461 |
"are random by default automatically"
|
462 |
msgstr ""
|
463 |
|
464 |
+
#: lib/class-testimonials-widget-settings.php:429
|
465 |
msgid "ORDER BY"
|
466 |
msgstr ""
|
467 |
|
468 |
+
#: lib/class-testimonials-widget-settings.php:430
|
469 |
msgid "Used when \"Random Order\" is disabled"
|
470 |
msgstr ""
|
471 |
|
472 |
+
#: lib/class-testimonials-widget-settings.php:433
|
473 |
msgid "Testimonial ID"
|
474 |
msgstr ""
|
475 |
|
476 |
+
#: lib/class-testimonials-widget-settings.php:434
|
477 |
msgid "Author"
|
478 |
msgstr ""
|
479 |
|
480 |
+
#: lib/class-testimonials-widget-settings.php:435 testimonials-widget.php:461
|
481 |
msgid "Date"
|
482 |
msgstr ""
|
483 |
|
484 |
+
#: lib/class-testimonials-widget-settings.php:436
|
485 |
msgid "Menu Order"
|
486 |
msgstr ""
|
487 |
|
488 |
+
#: lib/class-testimonials-widget-settings.php:437 testimonials-widget.php:453
|
489 |
msgid "Source"
|
490 |
msgstr ""
|
491 |
|
492 |
+
#: lib/class-testimonials-widget-settings.php:438
|
493 |
msgid "No order"
|
494 |
msgstr ""
|
495 |
|
496 |
+
#: lib/class-testimonials-widget-settings.php:446
|
497 |
msgid "ORDER BY meta_key"
|
498 |
msgstr ""
|
499 |
|
500 |
+
#: lib/class-testimonials-widget-settings.php:447
|
501 |
msgid ""
|
502 |
"Used when \"Random Order\" is disabled and sorting by a testimonials meta "
|
503 |
"key is needed. Overrides ORDER BY"
|
504 |
msgstr ""
|
505 |
|
506 |
+
#: lib/class-testimonials-widget-settings.php:450
|
507 |
msgid "None"
|
508 |
msgstr ""
|
509 |
|
510 |
+
#: lib/class-testimonials-widget-settings.php:451 testimonials-widget.php:455
|
511 |
+
#: testimonials-widget.php:1638
|
512 |
msgid "Job Title"
|
513 |
msgstr ""
|
514 |
|
515 |
+
#: lib/class-testimonials-widget-settings.php:452 testimonials-widget.php:457
|
516 |
+
#: testimonials-widget.php:1650
|
517 |
msgid "Email"
|
518 |
msgstr ""
|
519 |
|
520 |
+
#: lib/class-testimonials-widget-settings.php:453 testimonials-widget.php:456
|
521 |
+
#: testimonials-widget.php:1644
|
522 |
msgid "Location"
|
523 |
msgstr ""
|
524 |
|
525 |
+
#: lib/class-testimonials-widget-settings.php:454 testimonials-widget.php:458
|
526 |
+
#: testimonials-widget.php:1656
|
527 |
msgid "Company"
|
528 |
msgstr ""
|
529 |
|
530 |
+
#: lib/class-testimonials-widget-settings.php:455 testimonials-widget.php:459
|
531 |
+
#: testimonials-widget.php:1662
|
532 |
msgid "URL"
|
533 |
msgstr ""
|
534 |
|
535 |
+
#: lib/class-testimonials-widget-settings.php:462
|
536 |
msgid "ORDER BY Order"
|
537 |
msgstr ""
|
538 |
|
539 |
+
#: lib/class-testimonials-widget-settings.php:465
|
540 |
msgid "Descending"
|
541 |
msgstr ""
|
542 |
|
543 |
+
#: lib/class-testimonials-widget-settings.php:466
|
544 |
msgid "Ascending"
|
545 |
msgstr ""
|
546 |
|
547 |
+
#: lib/class-testimonials-widget-settings.php:480
|
548 |
msgid "Allow Comments?"
|
549 |
msgstr ""
|
550 |
|
551 |
+
#: lib/class-testimonials-widget-settings.php:481
|
552 |
msgid ""
|
553 |
+
"Only affects the Testimonials post edit page. Your theme controls the front-"
|
554 |
+
"end view."
|
555 |
msgstr ""
|
556 |
|
557 |
+
#: lib/class-testimonials-widget-settings.php:487
|
558 |
msgid "URL slug-name for <a href=\"%1s\">testimonials archive</a> page."
|
559 |
msgstr ""
|
560 |
|
561 |
+
#: lib/class-testimonials-widget-settings.php:493
|
562 |
msgid "Archive Page URL"
|
563 |
msgstr ""
|
564 |
|
565 |
+
#: lib/class-testimonials-widget-settings.php:500
|
566 |
msgid ""
|
567 |
"URL slug-name for testimonial view pages. Shouldn't be the same as the "
|
568 |
"Archive Page URL nor should it match a page URL slug."
|
569 |
msgstr ""
|
570 |
|
571 |
+
#: lib/class-testimonials-widget-settings.php:504
|
572 |
msgid "Testimonial Page URL"
|
573 |
msgstr ""
|
574 |
|
575 |
+
#: lib/class-testimonials-widget-settings.php:514
|
576 |
+
msgid "Reset & Compatiblity Options"
|
577 |
msgstr ""
|
578 |
|
579 |
+
#: lib/class-testimonials-widget-settings.php:520
|
580 |
msgid "Don't Use Default Taxonomies?"
|
581 |
msgstr ""
|
582 |
|
583 |
+
#: lib/class-testimonials-widget-settings.php:523
|
584 |
+
msgid "If checked, use Testimonials' own category and tag taxonomies instead"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
585 |
msgstr ""
|
586 |
|
587 |
+
#: lib/class-testimonials-widget-settings.php:531
|
588 |
msgid "Version Based Options"
|
589 |
msgstr ""
|
590 |
|
591 |
+
#: lib/class-testimonials-widget-settings.php:537
|
592 |
msgid "Use bxSlider?"
|
593 |
msgstr ""
|
594 |
|
595 |
+
#: lib/class-testimonials-widget-settings.php:538
|
596 |
+
msgid "Pre 2.15.0, Testimonials' used custom JavaScript for transitions."
|
|
|
597 |
msgstr ""
|
598 |
|
599 |
+
#: lib/class-testimonials-widget-settings.php:550
|
600 |
msgid "Disable Animation?"
|
601 |
msgstr ""
|
602 |
|
603 |
+
#: lib/class-testimonials-widget-settings.php:551
|
604 |
msgid ""
|
605 |
"Pre 2.15.0, Disable animation between testimonial transitions. Useful when "
|
606 |
"stacking widgets."
|
607 |
msgstr ""
|
608 |
|
609 |
+
#: lib/class-testimonials-widget-settings.php:559
|
610 |
msgid "Fade Out Speed"
|
611 |
msgstr ""
|
612 |
|
613 |
+
#: lib/class-testimonials-widget-settings.php:560
|
614 |
+
#: lib/class-testimonials-widget-settings.php:568
|
615 |
msgid ""
|
616 |
"Pre 2.15.0, Transition duration in milliseconds; higher values indicate "
|
617 |
"slower animations, not faster ones."
|
618 |
msgstr ""
|
619 |
|
620 |
+
#: lib/class-testimonials-widget-settings.php:567
|
621 |
msgid "Fade In Speed"
|
622 |
msgstr ""
|
623 |
|
624 |
+
#: lib/class-testimonials-widget-settings.php:575
|
625 |
msgid "Height"
|
626 |
msgstr ""
|
627 |
|
628 |
+
#: lib/class-testimonials-widget-settings.php:576
|
629 |
msgid ""
|
630 |
"Pre 2.15.0, Testimonials height, in pixels. Overrides minimum and maximum "
|
631 |
"height"
|
632 |
msgstr ""
|
633 |
|
634 |
+
#: lib/class-testimonials-widget-settings.php:582
|
635 |
msgid "Minimum Height"
|
636 |
msgstr ""
|
637 |
|
638 |
+
#: lib/class-testimonials-widget-settings.php:583
|
639 |
msgid "Pre 2.15.0, Set for minimum display height, in pixels"
|
640 |
msgstr ""
|
641 |
|
642 |
+
#: lib/class-testimonials-widget-settings.php:589
|
643 |
msgid "Maximum Height"
|
644 |
msgstr ""
|
645 |
|
646 |
+
#: lib/class-testimonials-widget-settings.php:590
|
647 |
msgid "Pre 2.15.0, Set for maximum display height, in pixels"
|
648 |
msgstr ""
|
649 |
|
650 |
+
#: lib/class-testimonials-widget-settings.php:596
|
651 |
msgid "Always Load CSS?"
|
652 |
msgstr ""
|
653 |
|
654 |
+
#: lib/class-testimonials-widget-settings.php:597
|
655 |
+
msgid "Pre 2.14.0, Testimonials' CSS was always loaded, whether needed or not"
|
|
|
656 |
msgstr ""
|
657 |
|
658 |
+
#: lib/class-testimonials-widget-settings.php:608
|
659 |
msgid "Include IE7 CSS?"
|
660 |
msgstr ""
|
661 |
|
662 |
+
#: lib/class-testimonials-widget-settings.php:609
|
663 |
msgid "IE7 specific CSS moved to separate CSS file in version 2.13.6."
|
664 |
msgstr ""
|
665 |
|
666 |
+
#: lib/class-testimonials-widget-settings.php:621
|
667 |
msgid "Use `<q>` tag?"
|
668 |
msgstr ""
|
669 |
|
670 |
+
#: lib/class-testimonials-widget-settings.php:622
|
671 |
msgid "Pre 2.11.0, not HTML5 compliant"
|
672 |
msgstr ""
|
673 |
|
674 |
+
#: lib/class-testimonials-widget-settings.php:633
|
675 |
msgid "Remove `.hentry` CSS?"
|
676 |
msgstr ""
|
677 |
|
678 |
+
#: lib/class-testimonials-widget-settings.php:634
|
679 |
msgid ""
|
680 |
"Pre 2.6.4, some themes use class `.hentry` in a manner that breaks "
|
681 |
+
"Testimonials' CSS"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
682 |
msgstr ""
|
683 |
|
684 |
+
#: lib/class-testimonials-widget-settings.php:858
|
685 |
msgid ""
|
686 |
+
"These Testimonials Settings establish the default option values for "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
687 |
"shortcodes, theme functions, and widget instances. Widgets, once created no "
|
688 |
"longer inherit these global settings. Therefore, you'll need to update each "
|
689 |
"widget with the new settings. It might be easier to delete the widget and "
|
690 |
"then recreate it."
|
691 |
msgstr ""
|
692 |
|
693 |
+
#: lib/class-testimonials-widget-settings.php:860
|
694 |
msgid "Shortcode option names are listed below each entry."
|
695 |
msgstr ""
|
696 |
|
697 |
+
#: lib/class-testimonials-widget-settings.php:863
|
698 |
+
msgid "View the <a href=\"%s\">Testimonials documentation</a>."
|
699 |
msgstr ""
|
700 |
|
701 |
+
#: lib/class-testimonials-widget-settings.php:873
|
702 |
msgid "Show or hide optional fields."
|
703 |
msgstr ""
|
704 |
|
705 |
+
#: lib/class-testimonials-widget-settings.php:881
|
706 |
msgid "Options used to select testimonials."
|
707 |
msgstr ""
|
708 |
|
709 |
+
#: lib/class-testimonials-widget-settings.php:889
|
710 |
msgid "Options used to determine displayed testimonials ordering."
|
711 |
msgstr ""
|
712 |
|
713 |
+
#: lib/class-testimonials-widget-settings.php:897
|
714 |
msgid "Options related to showing testimonials in widgets."
|
715 |
msgstr ""
|
716 |
|
717 |
+
#: lib/class-testimonials-widget-settings.php:905
|
718 |
msgid "Archive and singular page URL related testimonials options."
|
719 |
msgstr ""
|
720 |
|
721 |
+
#: lib/class-testimonials-widget-settings.php:912
|
722 |
+
msgid "Compatibility & Reset"
|
723 |
msgstr ""
|
724 |
|
725 |
+
#: lib/class-testimonials-widget-settings.php:913
|
726 |
+
msgid "Backwards compatibility, import/export options, and reset options."
|
727 |
msgstr ""
|
728 |
|
729 |
+
#: lib/class-testimonials-widget-widget.php:27
|
730 |
+
msgid "Display testimonials with multiple selection and display options"
|
|
|
|
|
731 |
msgstr ""
|
732 |
|
733 |
+
#: lib/class-testimonials-widget-widget.php:99
|
734 |
msgid "CSS Class"
|
735 |
msgstr ""
|
736 |
|
737 |
+
#: lib/class-testimonials-widget-widget.php:100
|
738 |
msgid "This widget's unique CSS class for styling"
|
739 |
msgstr ""
|
740 |
|
741 |
+
#: testimonials-widget.php:135 testimonials-widget.php:2047
|
742 |
+
msgid "Testimonials Shortcode Examples"
|
743 |
msgstr ""
|
744 |
|
745 |
+
#: testimonials-widget.php:135
|
746 |
+
msgid "E.g. Shortcodes"
|
|
|
|
|
747 |
msgstr ""
|
748 |
|
749 |
+
#: testimonials-widget.php:333
|
750 |
msgid ""
|
751 |
+
"If your Testimonials display has gone to funky town, please <a href=\"%s"
|
752 |
+
"\">read the FAQ</a> about possible CSS fixes."
|
753 |
msgstr ""
|
754 |
|
755 |
+
#: testimonials-widget.php:451
|
756 |
msgid "ID"
|
757 |
msgstr ""
|
758 |
|
759 |
+
#: testimonials-widget.php:452
|
760 |
msgid "Image"
|
761 |
msgstr ""
|
762 |
|
763 |
+
#: testimonials-widget.php:454
|
764 |
msgid "Shortcodes"
|
765 |
msgstr ""
|
766 |
|
767 |
+
#: testimonials-widget.php:460
|
768 |
msgid "Published by"
|
769 |
msgstr ""
|
770 |
|
771 |
+
#: testimonials-widget.php:466 testimonials-widget.php:469
|
772 |
msgid "Category"
|
773 |
msgstr ""
|
774 |
|
775 |
+
#: testimonials-widget.php:467 testimonials-widget.php:470
|
776 |
msgid "Tags"
|
777 |
msgstr ""
|
778 |
|
779 |
+
#: testimonials-widget.php:481
|
780 |
msgid "Add New"
|
781 |
msgstr ""
|
782 |
|
783 |
+
#: testimonials-widget.php:482 testimonials-widget.php:485
|
784 |
msgid "Add New Testimonial"
|
785 |
msgstr ""
|
786 |
|
787 |
+
#: testimonials-widget.php:483
|
788 |
msgid "Edit Testimonial"
|
789 |
msgstr ""
|
790 |
|
791 |
+
#: testimonials-widget.php:486 testimonials-widget.php:893
|
792 |
msgid "No testimonials found"
|
793 |
msgstr ""
|
794 |
|
795 |
+
#: testimonials-widget.php:487
|
796 |
msgid "No testimonials found in Trash"
|
797 |
msgstr ""
|
798 |
|
799 |
+
#: testimonials-widget.php:489
|
800 |
msgid "Search Testimonials"
|
801 |
msgstr ""
|
802 |
|
803 |
+
#: testimonials-widget.php:490 testimonials-widget.php:1750
|
804 |
msgid "Testimonial"
|
805 |
msgstr ""
|
806 |
|
807 |
+
#: testimonials-widget.php:491
|
808 |
msgid "View Testimonial"
|
809 |
msgstr ""
|
810 |
|
811 |
+
#: testimonials-widget.php:1042
|
812 |
msgid "…"
|
813 |
msgstr ""
|
814 |
|
815 |
+
#: testimonials-widget.php:1369
|
816 |
msgid "«"
|
817 |
msgstr ""
|
818 |
|
819 |
+
#: testimonials-widget.php:1378
|
820 |
msgid "»"
|
821 |
msgstr ""
|
822 |
|
823 |
+
#: testimonials-widget.php:1674
|
824 |
msgid "Testimonial Data"
|
825 |
msgstr ""
|
826 |
|
827 |
+
#: testimonials-widget.php:1699
|
828 |
msgid "Enter title here"
|
829 |
msgstr ""
|
830 |
|
831 |
+
#: testimonials-widget.php:1700
|
832 |
msgid "Enter testimonial source here"
|
833 |
msgstr ""
|
834 |
|
835 |
+
#: testimonials-widget.php:1725
|
836 |
msgid "Testimonial updated. <a href=\"%s\">View testimonial</a>"
|
837 |
msgstr ""
|
838 |
|
839 |
+
#: testimonials-widget.php:1726
|
840 |
msgid "Custom field updated."
|
841 |
msgstr ""
|
842 |
|
843 |
+
#: testimonials-widget.php:1727
|
844 |
msgid "Custom field deleted."
|
845 |
msgstr ""
|
846 |
|
847 |
+
#: testimonials-widget.php:1728
|
848 |
msgid "Testimonial updated."
|
849 |
msgstr ""
|
850 |
|
851 |
#. translators: %s: date and time of the revision
|
852 |
+
#: testimonials-widget.php:1730
|
853 |
msgid "Testimonial restored to revision from %s"
|
854 |
msgstr ""
|
855 |
|
856 |
+
#: testimonials-widget.php:1731
|
857 |
msgid "Testimonial published. <a href=\"%s\">View testimonial</a>"
|
858 |
msgstr ""
|
859 |
|
860 |
+
#: testimonials-widget.php:1732
|
861 |
msgid "Testimonial saved."
|
862 |
msgstr ""
|
863 |
|
864 |
+
#: testimonials-widget.php:1733
|
865 |
msgid ""
|
866 |
"Testimonial submitted. <a target=\"_blank\" href=\"%s\">Preview testimonial</"
|
867 |
"a>"
|
868 |
msgstr ""
|
869 |
|
870 |
+
#: testimonials-widget.php:1734
|
871 |
msgid ""
|
872 |
"Testimonial scheduled for: <strong>%1$s</strong>. <a target=\"_blank\" href="
|
873 |
"\"%2$s\">Preview testimonial</a>"
|
874 |
msgstr ""
|
875 |
|
876 |
+
#: testimonials-widget.php:1735
|
877 |
msgid ""
|
878 |
"Testimonial draft updated. <a target=\"_blank\" href=\"%s\">Preview "
|
879 |
"testimonial</a>"
|
880 |
msgstr ""
|
881 |
|
882 |
+
#: testimonials-widget.php:2038
|
883 |
msgid ""
|
884 |
+
"If your Testimonials display has gone to funky town, please <a href=\"%s"
|
885 |
+
"\">read the FAQ</a> about possible fixes."
|
886 |
msgstr ""
|
887 |
|
888 |
#. Plugin URI of the plugin/theme
|
889 |
+
msgid "http://wordpress.org/plugins/testimonials-widget/"
|
890 |
msgstr ""
|
891 |
|
892 |
#. Description of the plugin/theme
|
893 |
msgid ""
|
894 |
+
"Testimonials lets you randomly slide or list selected portfolios, quotes, "
|
895 |
+
"reviews, or text with images or videos on your WordPress site."
|
|
|
896 |
msgstr ""
|
897 |
|
898 |
#. Author of the plugin/theme
|
900 |
msgstr ""
|
901 |
|
902 |
#. Author URI of the plugin/theme
|
903 |
+
msgid "http://aihr.us/resume/"
|
904 |
msgstr ""
|
lib/aihrus/.gitignore
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
000-code-qa.txt
|
2 |
+
diff.txt
|
lib/aihrus/CHANGELOG.md
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# CHANGELOG Aihrus Framework
|
2 |
+
|
3 |
+
## master
|
4 |
+
* Add TODO
|
5 |
+
* Add abstract class Aihrus_Settings
|
6 |
+
* Add abstract class Aihrus_Widget
|
7 |
+
* Add is_true, terms, url validate cases
|
8 |
+
* Add method `create_link( $link )`
|
9 |
+
* Add method `create_nonce( $action )`
|
10 |
+
* Add method `verify_nonce( $nonce, $action )`
|
11 |
+
* Add shortcode id helpers
|
12 |
+
* Allow reset_defaults in widget
|
13 |
+
* Rename no_code to show_code
|
14 |
+
* Settings link with null post_type
|
15 |
+
|
16 |
+
## 0.0.0
|
17 |
+
* Initial code release
|
lib/aihrus/LICENSE
ADDED
@@ -0,0 +1,339 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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.
|
lib/aihrus/README.md
ADDED
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Aihrus Framework
|
2 |
+
|
3 |
+
A helper library for WordPress plugins by Aihrus.
|
4 |
+
|
5 |
+
## Features
|
6 |
+
|
7 |
+
* Donation links
|
8 |
+
* Helper methods
|
9 |
+
* Licensing
|
10 |
+
* Notifications
|
11 |
+
|
12 |
+
## Usage
|
13 |
+
|
14 |
+
* Change to plugin directory that's a Git clone
|
15 |
+
* Load and link the external library
|
16 |
+
|
17 |
+
```
|
18 |
+
git remote add aihrus https://github.com/michael-cannon/aihrus-framework.git
|
19 |
+
git fetch aihrus
|
20 |
+
git subtree add -P lib/aihrus aihrus master
|
21 |
+
git commit -a -m "Readd aihrus framework"
|
22 |
+
git push origin master
|
23 |
+
```
|
24 |
+
|
25 |
+
* Link plugin to libary
|
26 |
+
|
27 |
+
```
|
28 |
+
require_once WPSP_PLUGIN_DIR_LIB . '/aihrus/class-aihrus-common.php';
|
29 |
+
```
|
30 |
+
|
31 |
+
* Extend plugin class to library
|
32 |
+
|
33 |
+
```
|
34 |
+
class Wordpress_Starter extends Aihrus_Common {
|
35 |
+
```
|
36 |
+
|
37 |
+
* Add class static members
|
38 |
+
|
39 |
+
```
|
40 |
+
public static $class;
|
41 |
+
public static $notice_key;
|
42 |
+
```
|
43 |
+
|
44 |
+
* Set notices…
|
45 |
+
|
46 |
+
```
|
47 |
+
…
|
48 |
+
if ( $bad_version )
|
49 |
+
self::set_notice( 'notice_version' );
|
50 |
+
…
|
51 |
+
public static function notice_version( $free_base = null, $free_name = null, $free_slug = null, $free_version = null, $item_name = null ) {
|
52 |
+
$free_base = self::FREE_PLUGIN_BASE;
|
53 |
+
$free_name = 'Testimonials';
|
54 |
+
$free_slug = 'testimonials-widget';
|
55 |
+
$free_version = self::FREE_VERSION;
|
56 |
+
$item_name = self::ITEM_NAME;
|
57 |
+
|
58 |
+
parent::notice_version( $free_base, $free_name, $free_slug, $free_version, $item_name );
|
59 |
+
}
|
60 |
+
```
|
61 |
+
|
62 |
+
* Update the external library
|
63 |
+
|
64 |
+
```
|
65 |
+
git subtree pull -P lib/aihrus aihrus master
|
66 |
+
```
|
67 |
+
|
68 |
+
* Update the plugin repository
|
69 |
+
|
70 |
+
```
|
71 |
+
git push origin master
|
72 |
+
```
|
lib/aihrus/TODO.md
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
# TODO Aihrus Framework
|
2 |
+
|
3 |
+
* TBD
|
lib/aihrus/class-aihrus-common.php
ADDED
@@ -0,0 +1,318 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
Copyright 2013 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 ( ! is_array( $notice ) )
|
91 |
+
add_action( 'admin_notices', array( static::$class, $notice ) );
|
92 |
+
else
|
93 |
+
add_action( 'admin_notices', $notice );
|
94 |
+
}
|
95 |
+
|
96 |
+
self::delete_notices();
|
97 |
+
}
|
98 |
+
|
99 |
+
|
100 |
+
public static function get_notice_key() {
|
101 |
+
if ( is_null( static::$notice_key ) )
|
102 |
+
self::set_notice_key();
|
103 |
+
|
104 |
+
return static::$notice_key;
|
105 |
+
}
|
106 |
+
|
107 |
+
|
108 |
+
public static function set_notice_key() {
|
109 |
+
static::$notice_key = static::SLUG . 'notices';
|
110 |
+
}
|
111 |
+
|
112 |
+
|
113 |
+
public static function notice_version( $free_base, $free_name, $free_slug, $free_version, $item_name ) {
|
114 |
+
$is_active = is_plugin_active( $free_base );
|
115 |
+
if ( $is_active )
|
116 |
+
$link = sprintf( __( '<a href="%1$s">update to</a>', 'testimonials-widget' ), self_admin_url( 'update-core.php' ) );
|
117 |
+
else {
|
118 |
+
$plugins = get_plugins();
|
119 |
+
if ( empty( $plugins[ $free_base ] ) ) {
|
120 |
+
$install = esc_url( wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=' . $free_slug ), 'install-plugin_' . $free_slug ) );
|
121 |
+
$link = sprintf( __( '<a href="%1$s">install</a>', 'testimonials-widget' ), $install );
|
122 |
+
} else {
|
123 |
+
$activate = esc_url( wp_nonce_url( admin_url( 'plugins.php?action=activate&plugin=' . $free_base ), 'activate-plugin_' . $free_base ) );
|
124 |
+
$link = sprintf( __( '<a href="%1$s">activate</a>', 'testimonials-widget' ), $activate );
|
125 |
+
}
|
126 |
+
}
|
127 |
+
|
128 |
+
$text = sprintf( __( 'Plugin %3$s has been deactivated. Please %1$s %4$s version %2$s or newer before activating %3$s.', 'testimonials-widget' ), $link, $free_version, $item_name, $free_name );
|
129 |
+
|
130 |
+
self::notice_error( $text );
|
131 |
+
}
|
132 |
+
|
133 |
+
|
134 |
+
public static function notice_license( $post_type, $settings_id, $free_name, $purchase_url, $item_name ) {
|
135 |
+
if ( empty( $post_type ) )
|
136 |
+
$link = get_admin_url() . 'options-general.php?page=' . $settings_id;
|
137 |
+
else
|
138 |
+
$link = get_admin_url() . 'edit.php?post_type=' . $post_type . '&page=' . $settings_id;
|
139 |
+
|
140 |
+
$text = __( '<a href="%1$s">%2$s > Settings</a>, <em>Premium</em> tab, <em>License Key</em> entry', 'testimonials-widget' );
|
141 |
+
|
142 |
+
$settings_link = sprintf( $text, $link, $free_name );
|
143 |
+
|
144 |
+
$link = esc_url( 'https://aihrus.zendesk.com/entries/28745227-Where-s-my-license-key-' );
|
145 |
+
$text = __( '<a href="%s">Where\'s my license key?</a>', 'testimonials-widget' );
|
146 |
+
|
147 |
+
$faq_link = sprintf( $text, $link );
|
148 |
+
|
149 |
+
$link = esc_url( $purchase_url );
|
150 |
+
$text = __( '<a href="%1$s">%2$s</a>', 'testimonials-widget' );
|
151 |
+
|
152 |
+
$buy_link = sprintf( $text, $link, $item_name );
|
153 |
+
|
154 |
+
$text = sprintf( __( 'Plugin %1$s requires license activation before updating will work. Please activate the license key via %2$s. No license key? See %3$s or purchase %4$s.', 'testimonials-widget' ), $item_name, $settings_link, $faq_link, $buy_link );
|
155 |
+
|
156 |
+
self::notice_error( $text );
|
157 |
+
}
|
158 |
+
|
159 |
+
|
160 |
+
public function version( $version ) {
|
161 |
+
$version .= '-' . static::ID . '-' . static::VERSION;
|
162 |
+
|
163 |
+
return $version;
|
164 |
+
}
|
165 |
+
|
166 |
+
|
167 |
+
/**
|
168 |
+
* flatten an arbitrarily deep multidimensional array
|
169 |
+
* into a list of its scalar values
|
170 |
+
* (may be inefficient for large structures)
|
171 |
+
* (will infinite recurse on self-referential structures)
|
172 |
+
* (could be extended to handle objects)
|
173 |
+
*
|
174 |
+
* @ref http://in1.php.net/manual/en/function.array-values.php#41967
|
175 |
+
*/
|
176 |
+
|
177 |
+
|
178 |
+
public function array_values_recursive( $ary ) {
|
179 |
+
$lst = array();
|
180 |
+
foreach ( array_keys( $ary ) as $k ) {
|
181 |
+
$v = $ary[$k];
|
182 |
+
if ( is_scalar( $v ) ) {
|
183 |
+
$lst[] = $v;
|
184 |
+
} elseif ( is_array( $v ) ) {
|
185 |
+
$lst = array_merge(
|
186 |
+
$lst,
|
187 |
+
self::array_values_recursive( $v )
|
188 |
+
);
|
189 |
+
}
|
190 |
+
}
|
191 |
+
|
192 |
+
return $lst;
|
193 |
+
}
|
194 |
+
|
195 |
+
|
196 |
+
public static function notice_donate( $disable_donate = null, $item_name = null ) {
|
197 |
+
if ( $disable_donate )
|
198 |
+
return;
|
199 |
+
|
200 |
+
$text = sprintf( esc_html__( 'Please donate $5 towards ongoing support and development of the %1$s plugin. %2$s', 'testimonials-widget' ), $item_name, self::$donate_button );
|
201 |
+
|
202 |
+
self::notice_updated( $text );
|
203 |
+
}
|
204 |
+
|
205 |
+
|
206 |
+
public static function notice_error( $text ) {
|
207 |
+
self::notice_updated( $text, 'error' );
|
208 |
+
}
|
209 |
+
|
210 |
+
|
211 |
+
public static function notice_updated( $text, $class = 'updated' ) {
|
212 |
+
if ( 'updated' == $class )
|
213 |
+
$class .= ' fade';
|
214 |
+
|
215 |
+
$content = '';
|
216 |
+
$content .= '<div class="' . $class . '"><p>';
|
217 |
+
$content .= $text;
|
218 |
+
$content .= '</p></div>';
|
219 |
+
|
220 |
+
echo $content;
|
221 |
+
}
|
222 |
+
|
223 |
+
|
224 |
+
public static function get_scripts() {
|
225 |
+
if ( static::$scripts_called )
|
226 |
+
return;
|
227 |
+
|
228 |
+
foreach ( static::$scripts as $script )
|
229 |
+
echo $script;
|
230 |
+
|
231 |
+
static::$scripts_called = true;
|
232 |
+
}
|
233 |
+
|
234 |
+
|
235 |
+
public static function get_styles() {
|
236 |
+
if ( static::$styles_called )
|
237 |
+
return;
|
238 |
+
|
239 |
+
foreach ( static::$styles as $style )
|
240 |
+
echo $style;
|
241 |
+
|
242 |
+
static::$styles_called = true;
|
243 |
+
}
|
244 |
+
|
245 |
+
|
246 |
+
public static function create_nonce( $action ) {
|
247 |
+
$nonce = uniqid();
|
248 |
+
$uid = get_current_user_id();
|
249 |
+
$check = $uid . $action;
|
250 |
+
set_transient( $nonce, $check, HOUR_IN_SECONDS );
|
251 |
+
|
252 |
+
return $nonce;
|
253 |
+
}
|
254 |
+
|
255 |
+
|
256 |
+
public static function verify_nonce( $nonce, $action ) {
|
257 |
+
$active = get_transient( $nonce );
|
258 |
+
$uid = get_current_user_id();
|
259 |
+
$check = $uid . $action;
|
260 |
+
$valid = false;
|
261 |
+
|
262 |
+
if ( $active == $check ) {
|
263 |
+
delete_transient( $nonce );
|
264 |
+
$valid = true;
|
265 |
+
}
|
266 |
+
|
267 |
+
return $valid;
|
268 |
+
}
|
269 |
+
|
270 |
+
|
271 |
+
/**
|
272 |
+
* If incoming link is empty, then get_site_url() is used instead.
|
273 |
+
*/
|
274 |
+
public static function create_link( $link ) {
|
275 |
+
if ( empty( $link ) )
|
276 |
+
$link = get_site_url();
|
277 |
+
|
278 |
+
if ( preg_match( '#^\d+$#', $link ) ) {
|
279 |
+
$permalink = get_permalink( $link );
|
280 |
+
$title = get_the_title( $link );
|
281 |
+
|
282 |
+
$tag = '<a href="';
|
283 |
+
$tag .= $permalink;
|
284 |
+
$tag .= '" title="';
|
285 |
+
$tag .= $title;
|
286 |
+
$tag .= '">';
|
287 |
+
$tag .= $title;
|
288 |
+
$tag .= '</a>';
|
289 |
+
} else {
|
290 |
+
$orig_link = $link;
|
291 |
+
$do_http = true;
|
292 |
+
|
293 |
+
if ( 0 === strpos( $link, '/' ) )
|
294 |
+
$do_http = false;
|
295 |
+
|
296 |
+
if ( $do_http && 0 === preg_match( '#https?://#', $link ) )
|
297 |
+
$link = 'http://' . $link;
|
298 |
+
|
299 |
+
$permalink = $link;
|
300 |
+
|
301 |
+
$tag = '<a href="';
|
302 |
+
$tag .= $permalink;
|
303 |
+
$tag .= '">';
|
304 |
+
$tag .= $orig_link;
|
305 |
+
$tag .= '</a>';
|
306 |
+
}
|
307 |
+
|
308 |
+
return array(
|
309 |
+
'link' => $permalink,
|
310 |
+
'tag' => $tag,
|
311 |
+
);
|
312 |
+
}
|
313 |
+
|
314 |
+
|
315 |
+
}
|
316 |
+
|
317 |
+
|
318 |
+
?>
|
lib/aihrus/class-aihrus-licensing.php
ADDED
@@ -0,0 +1,186 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
Copyright 2013 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 ( empty( $value ) ) {
|
61 |
+
$this->deactivate_license();
|
62 |
+
$this->delete_license();
|
63 |
+
|
64 |
+
return '';
|
65 |
+
}
|
66 |
+
|
67 |
+
$this->set_license( $value );
|
68 |
+
$value = $this->activate_license();
|
69 |
+
$this->set_license( $value );
|
70 |
+
|
71 |
+
return $value;
|
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 ( 32 === strlen( $license ) )
|
88 |
+
return true;
|
89 |
+
|
90 |
+
$license_data = $this->get_license_data();
|
91 |
+
if ( false !== $license_data ) {
|
92 |
+
if ( $license_data->license == 'valid' )
|
93 |
+
return true;
|
94 |
+
}
|
95 |
+
|
96 |
+
return false;
|
97 |
+
}
|
98 |
+
|
99 |
+
|
100 |
+
public function get_api_call( $action ) {
|
101 |
+
$license = $this->get_license();
|
102 |
+
$api_params = array(
|
103 |
+
'edd_action' => $action,
|
104 |
+
'item_name' => $this->item_name,
|
105 |
+
'license' => $license,
|
106 |
+
);
|
107 |
+
|
108 |
+
$api_call = add_query_arg(
|
109 |
+
$api_params,
|
110 |
+
$this->store_url
|
111 |
+
);
|
112 |
+
|
113 |
+
return $api_call;
|
114 |
+
}
|
115 |
+
|
116 |
+
|
117 |
+
public function get_remote_get( $api_call ) {
|
118 |
+
$response = wp_remote_get(
|
119 |
+
$api_call,
|
120 |
+
array(
|
121 |
+
'timeout' => 10,
|
122 |
+
'sslverify' => false,
|
123 |
+
)
|
124 |
+
);
|
125 |
+
|
126 |
+
return $response;
|
127 |
+
}
|
128 |
+
|
129 |
+
|
130 |
+
public function activate_license() {
|
131 |
+
$license_data = $this->get_license_data( 'activate_license' );
|
132 |
+
if ( false !== $license_data ) {
|
133 |
+
if ( $license_data->license == 'valid' ) {
|
134 |
+
$license = $this->get_license();
|
135 |
+
|
136 |
+
return $license;
|
137 |
+
}
|
138 |
+
|
139 |
+
return $license_data->license;
|
140 |
+
}
|
141 |
+
|
142 |
+
return false;
|
143 |
+
}
|
144 |
+
|
145 |
+
|
146 |
+
public function get_license_data( $action = 'check_license' ) {
|
147 |
+
$api_call = $this->get_api_call( $action );
|
148 |
+
$response = $this->get_remote_get( $api_call );
|
149 |
+
if ( is_wp_error( $response ) )
|
150 |
+
return false;
|
151 |
+
|
152 |
+
$license_data = json_decode( wp_remote_retrieve_body( $response ) );
|
153 |
+
|
154 |
+
return $license_data;
|
155 |
+
}
|
156 |
+
|
157 |
+
|
158 |
+
public function deactivate_license() {
|
159 |
+
$license_data = $this->get_license_data( 'deactivate_license' );
|
160 |
+
if ( false !== $license_data ) {
|
161 |
+
if ( $license_data->license == 'deactivated' )
|
162 |
+
return true;
|
163 |
+
|
164 |
+
return $license_data->license;
|
165 |
+
}
|
166 |
+
|
167 |
+
return false;
|
168 |
+
}
|
169 |
+
|
170 |
+
|
171 |
+
public function delete_license() {
|
172 |
+
$this->set_license();
|
173 |
+
}
|
174 |
+
|
175 |
+
|
176 |
+
public function license_notice() {
|
177 |
+
$result = '<p><em>' . esc_html( 'Premium features require licensing to function.' ) . '</em></p>';
|
178 |
+
|
179 |
+
return $result;
|
180 |
+
}
|
181 |
+
|
182 |
+
|
183 |
+
}
|
184 |
+
|
185 |
+
|
186 |
+
?>
|
lib/aihrus/class-aihrus-settings.php
ADDED
@@ -0,0 +1,726 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
Copyright 2013 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 |
+
* WordPress Starter settings class
|
21 |
+
*
|
22 |
+
* Based upon http://alisothegeek.com/2011/01/wordpress-settings-api-tutorial-1/
|
23 |
+
*/
|
24 |
+
|
25 |
+
|
26 |
+
if ( class_exists( 'Aihrus_Settings' ) )
|
27 |
+
return;
|
28 |
+
|
29 |
+
|
30 |
+
abstract class Aihrus_Settings {
|
31 |
+
public static $default = array(
|
32 |
+
'backwards' => array(
|
33 |
+
'version' => null, // below this version number, use std
|
34 |
+
'std' => null,
|
35 |
+
),
|
36 |
+
'choices' => array(), // key => value
|
37 |
+
'class' => null, // warning, etc.
|
38 |
+
'desc' => null,
|
39 |
+
'id' => null,
|
40 |
+
'section' => 'general',
|
41 |
+
'show_code' => false,
|
42 |
+
'std' => null, // default key or value
|
43 |
+
'suggest' => false, // attempt for auto-suggest on inputs
|
44 |
+
'title' => null,
|
45 |
+
'type' => 'text', // textarea, checkbox, radio, select, hidden, heading, password, expand_begin, expand_end
|
46 |
+
'validate' => null, // required, term, slug, slugs, ids, order, single paramater PHP functions
|
47 |
+
'widget' => 1, // show in widget options, 0 off
|
48 |
+
);
|
49 |
+
|
50 |
+
|
51 |
+
public function __construct() {}
|
52 |
+
|
53 |
+
|
54 |
+
public static function load_options() {
|
55 |
+
static::sections();
|
56 |
+
static::settings();
|
57 |
+
}
|
58 |
+
|
59 |
+
|
60 |
+
public static function sections() {
|
61 |
+
static::$sections['reset'] = esc_html__( 'Reset', 'testimonials-widget' );
|
62 |
+
static::$sections['about'] = esc_html__( 'About', 'testimonials-widget' );
|
63 |
+
}
|
64 |
+
|
65 |
+
|
66 |
+
/**
|
67 |
+
*
|
68 |
+
*
|
69 |
+
* @SuppressWarnings(PHPMD.Superglobals)
|
70 |
+
*/
|
71 |
+
public static function settings() {
|
72 |
+
// Reset section defaults
|
73 |
+
$options = get_option( static::ID );
|
74 |
+
if ( ! empty( $options ) ) {
|
75 |
+
$serialized_options = serialize( $options );
|
76 |
+
$_SESSION['export'] = $serialized_options;
|
77 |
+
|
78 |
+
static::$settings['export'] = array(
|
79 |
+
'section' => 'reset',
|
80 |
+
'title' => esc_html__( 'Export Settings', 'testimonials-widget' ),
|
81 |
+
'type' => 'readonly',
|
82 |
+
'desc' => esc_html__( 'These are your current settings in a serialized format. Copy the contents to make a backup of your settings.', 'testimonials-widget' ),
|
83 |
+
'std' => $serialized_options,
|
84 |
+
'widget' => 0,
|
85 |
+
);
|
86 |
+
}
|
87 |
+
|
88 |
+
static::$settings['import'] = array(
|
89 |
+
'section' => 'reset',
|
90 |
+
'title' => esc_html__( 'Import Settings', 'testimonials-widget' ),
|
91 |
+
'type' => 'textarea',
|
92 |
+
'desc' => esc_html__( 'Paste new serialized settings here to overwrite your current configuration.', 'testimonials-widget' ),
|
93 |
+
'widget' => 0,
|
94 |
+
);
|
95 |
+
|
96 |
+
static::$settings['delete_data'] = array(
|
97 |
+
'section' => 'reset',
|
98 |
+
'title' => esc_html__( 'Remove Plugin Data on Deletion?', 'testimonials-widget' ),
|
99 |
+
'type' => 'checkbox',
|
100 |
+
'class' => 'warning',
|
101 |
+
'desc' => esc_html__( 'Delete all WordPress Starter data and options from database on plugin deletion', 'testimonials-widget' ),
|
102 |
+
'widget' => 0,
|
103 |
+
);
|
104 |
+
|
105 |
+
static::$settings['reset_defaults'] = array(
|
106 |
+
'section' => 'reset',
|
107 |
+
'title' => esc_html__( 'Reset to Defaults?', 'testimonials-widget' ),
|
108 |
+
'type' => 'checkbox',
|
109 |
+
'class' => 'warning',
|
110 |
+
'desc' => esc_html__( 'Check this box to reset options to their defaults', 'testimonials-widget' ),
|
111 |
+
);
|
112 |
+
}
|
113 |
+
|
114 |
+
|
115 |
+
public static function get_defaults( $mode = null, $old_version = null ) {
|
116 |
+
if ( empty( static::$defaults ) )
|
117 |
+
static::settings();
|
118 |
+
|
119 |
+
$do_backwards = false;
|
120 |
+
if ( 'backwards' == $mode ) {
|
121 |
+
if ( ! empty( $old_version ) )
|
122 |
+
$do_backwards = true;
|
123 |
+
}
|
124 |
+
|
125 |
+
foreach ( static::$settings as $id => $parts ) {
|
126 |
+
$std = isset( $parts['std'] ) ? $parts['std'] : '';
|
127 |
+
if ( $do_backwards ) {
|
128 |
+
$version = ! empty( $parts['backwards']['version'] ) ? $parts['backwards']['version'] : false;
|
129 |
+
if ( ! empty( $version ) ) {
|
130 |
+
if ( $old_version < $version )
|
131 |
+
$std = $parts['backwards']['std'];
|
132 |
+
}
|
133 |
+
}
|
134 |
+
|
135 |
+
static::$defaults[ $id ] = $std;
|
136 |
+
}
|
137 |
+
|
138 |
+
return static::$defaults;
|
139 |
+
}
|
140 |
+
|
141 |
+
|
142 |
+
public static function get_settings() {
|
143 |
+
if ( empty( static::$settings ) )
|
144 |
+
static::settings();
|
145 |
+
|
146 |
+
return static::$settings;
|
147 |
+
}
|
148 |
+
|
149 |
+
|
150 |
+
public static function initialize_settings( $version = null ) {
|
151 |
+
$defaults = static::get_defaults( 'backwards' );
|
152 |
+
$current = get_option( static::ID );
|
153 |
+
$current = wp_parse_args( $current, $defaults );
|
154 |
+
|
155 |
+
$current['admin_notices'] = $version;
|
156 |
+
$current['version'] = static::$version;
|
157 |
+
|
158 |
+
update_option( static::ID, $current );
|
159 |
+
}
|
160 |
+
|
161 |
+
|
162 |
+
/**
|
163 |
+
*
|
164 |
+
*
|
165 |
+
* @SuppressWarnings(PHPMD.UnusedLocalVariable)
|
166 |
+
*/
|
167 |
+
public static function create_setting( $args = array() ) {
|
168 |
+
extract( $args );
|
169 |
+
|
170 |
+
if ( preg_match( '#(_expand_begin|_expand_end)#', $id ) )
|
171 |
+
return;
|
172 |
+
|
173 |
+
$field_args = array(
|
174 |
+
'choices' => $choices,
|
175 |
+
'class' => $class,
|
176 |
+
'desc' => $desc,
|
177 |
+
'id' => $id,
|
178 |
+
'label_for' => $id,
|
179 |
+
'show_code' => $show_code,
|
180 |
+
'std' => $std,
|
181 |
+
'suggest' => $suggest,
|
182 |
+
'type' => $type,
|
183 |
+
);
|
184 |
+
|
185 |
+
static::$defaults[$id] = $std;
|
186 |
+
|
187 |
+
add_settings_field( $id, $title, array( static::$class, 'display_setting' ), static::ID, $section, $field_args );
|
188 |
+
}
|
189 |
+
|
190 |
+
|
191 |
+
public static function section_scripts() {
|
192 |
+
echo '
|
193 |
+
<script type="text/javascript">
|
194 |
+
jQuery(document).ready(function($) {
|
195 |
+
$( "#' . static::ID . '" ).tabs();
|
196 |
+
// This will make the "warning" checkbox class really stand out when checked.
|
197 |
+
$(".warning").change(function() {
|
198 |
+
if ($(this).is(":checked"))
|
199 |
+
$(this).parent().css("background", "#c00").css("color", "#fff").css("fontWeight", "bold");
|
200 |
+
else
|
201 |
+
$(this).parent().css("background", "inherit").css("color", "inherit").css("fontWeight", "inherit");
|
202 |
+
});
|
203 |
+
});
|
204 |
+
</script>
|
205 |
+
';
|
206 |
+
}
|
207 |
+
|
208 |
+
|
209 |
+
public static function do_settings_sections( $page ) {
|
210 |
+
global $wp_settings_sections, $wp_settings_fields;
|
211 |
+
|
212 |
+
if ( ! isset( $wp_settings_sections ) || !isset( $wp_settings_sections[$page] ) )
|
213 |
+
return;
|
214 |
+
|
215 |
+
foreach ( (array) $wp_settings_sections[$page] as $section ) {
|
216 |
+
if ( $section['callback'] )
|
217 |
+
call_user_func( $section['callback'], $section );
|
218 |
+
|
219 |
+
if ( ! isset( $wp_settings_fields ) || !isset( $wp_settings_fields[$page] ) || !isset( $wp_settings_fields[$page][$section['id']] ) )
|
220 |
+
continue;
|
221 |
+
|
222 |
+
echo '<table id=' . $section['id'] . ' class="form-table">';
|
223 |
+
do_settings_fields( $page, $section['id'] );
|
224 |
+
echo '</table>';
|
225 |
+
}
|
226 |
+
}
|
227 |
+
|
228 |
+
|
229 |
+
public static function display_section() {}
|
230 |
+
|
231 |
+
|
232 |
+
public static function display_about() {
|
233 |
+
$name = str_replace( ' Settings', '', static::ITEM_NAME );
|
234 |
+
$text = __( '<img class="alignright size-medium" src="%1$s/media/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>.', 'testimonials-widget' );
|
235 |
+
|
236 |
+
echo '<div id="about" style="width: 70%; min-height: 225px;"><p>';
|
237 |
+
echo sprintf(
|
238 |
+
$text,
|
239 |
+
static::$plugin_path,
|
240 |
+
esc_url( static::$plugin_url ),
|
241 |
+
$name,
|
242 |
+
esc_url( 'http://aihr.us/resume/' ),
|
243 |
+
esc_url( 'http://peimic.com/t/peichi-liu/' ),
|
244 |
+
esc_url( 'http://www.chinesehoroscope.org/chinese_zodiac/rat/' ),
|
245 |
+
esc_url( 'http://axelerant.com/who-we-are' ),
|
246 |
+
esc_url( 'http://peimic.com/c/biking/' ),
|
247 |
+
esc_url( 'http://aihr.us/about-aihrus/' ),
|
248 |
+
esc_url( 'http://peimic.com/t/poetry/' ),
|
249 |
+
esc_url( 'http://peimic.com/t/WWOOF/' ),
|
250 |
+
esc_url( 'http://peimic.com/c/travel/' )
|
251 |
+
);
|
252 |
+
echo '</p></div>';
|
253 |
+
}
|
254 |
+
|
255 |
+
|
256 |
+
public static function display_page( $disable_donate = false ) {
|
257 |
+
echo '<div class="wrap">
|
258 |
+
<div class="icon32" id="icon-options-general"></div>
|
259 |
+
<h2>' . static::ITEM_NAME . '</h2>';
|
260 |
+
|
261 |
+
echo '<form action="options.php" method="post">';
|
262 |
+
|
263 |
+
settings_fields( static::ID );
|
264 |
+
|
265 |
+
echo '<div id="' . static::ID . '">
|
266 |
+
<ul>';
|
267 |
+
|
268 |
+
foreach ( static::$sections as $section_slug => $section )
|
269 |
+
echo '<li><a href="#' . $section_slug . '">' . $section . '</a></li>';
|
270 |
+
|
271 |
+
echo '</ul>';
|
272 |
+
|
273 |
+
self::do_settings_sections( static::ID );
|
274 |
+
|
275 |
+
echo '
|
276 |
+
<p class="submit"><input name="Submit" type="submit" class="button-primary" value="' . esc_html__( 'Save Changes', 'testimonials-widget' ) . '" /></p>
|
277 |
+
</form>
|
278 |
+
</div>
|
279 |
+
';
|
280 |
+
|
281 |
+
if ( ! $disable_donate ) {
|
282 |
+
echo '<p>' .
|
283 |
+
sprintf(
|
284 |
+
__( '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>.', 'testimonials-widget' ),
|
285 |
+
esc_url( 'http://aihr.us/about-aihrus/donate/' ),
|
286 |
+
esc_url( 'https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif' ),
|
287 |
+
esc_url( 'http://aihr.us/store/' ),
|
288 |
+
esc_url( 'https://aihrus.zendesk.com/home' )
|
289 |
+
) .
|
290 |
+
'</p>';
|
291 |
+
}
|
292 |
+
|
293 |
+
echo '<p class="copyright">' .
|
294 |
+
sprintf(
|
295 |
+
__( 'Copyright ©%1$s <a href="%2$s">Aihrus</a>.', 'testimonials-widget' ),
|
296 |
+
date( 'Y' ),
|
297 |
+
esc_url( 'http://aihr.us' )
|
298 |
+
) .
|
299 |
+
'</p>';
|
300 |
+
|
301 |
+
echo '</div>';
|
302 |
+
|
303 |
+
add_action( 'admin_footer', array( static::$class, 'section_scripts' ) );
|
304 |
+
}
|
305 |
+
|
306 |
+
|
307 |
+
public static function display_setting( $args = array(), $do_echo = true, $input = null ) {
|
308 |
+
$content = '';
|
309 |
+
|
310 |
+
extract( $args );
|
311 |
+
|
312 |
+
if ( is_null( $input ) )
|
313 |
+
$options = get_option( static::ID );
|
314 |
+
else {
|
315 |
+
$options = array();
|
316 |
+
$options[$id] = $input;
|
317 |
+
}
|
318 |
+
|
319 |
+
if ( ! isset( $options[$id] ) && $type != 'checkbox' )
|
320 |
+
$options[$id] = $std;
|
321 |
+
elseif ( ! isset( $options[$id] ) )
|
322 |
+
$options[$id] = 0;
|
323 |
+
|
324 |
+
$field_class = '';
|
325 |
+
if ( ! empty( $class ) )
|
326 |
+
$field_class = ' ' . $class;
|
327 |
+
|
328 |
+
// desc isn't escaped because it's might contain allowed html
|
329 |
+
$choices = array_map( 'esc_attr', $choices );
|
330 |
+
$field_class = esc_attr( $field_class );
|
331 |
+
$id = esc_attr( $id );
|
332 |
+
$options[$id] = esc_attr( $options[$id] );
|
333 |
+
$std = esc_attr( $std );
|
334 |
+
|
335 |
+
switch ( $type ) {
|
336 |
+
case 'checkbox':
|
337 |
+
$content .= '<input class="checkbox' . $field_class . '" type="checkbox" id="' . $id . '" name="' . static::ID . '[' . $id . ']" value="1" ' . checked( $options[$id], 1, false ) . ' /> ';
|
338 |
+
|
339 |
+
if ( ! empty( $desc ) )
|
340 |
+
$content .= '<label for="' . $id . '"><span class="description">' . $desc . '</span></label>';
|
341 |
+
|
342 |
+
if ( $show_code )
|
343 |
+
$content .= '<br /><code>' . $id . '</code>';
|
344 |
+
break;
|
345 |
+
|
346 |
+
case 'file':
|
347 |
+
$content .= '<input class="regular-text' . $field_class . '" type="file" id="' . $id . '" name="' . static::ID . '[' . $id . ']" />';
|
348 |
+
|
349 |
+
if ( ! empty( $desc ) )
|
350 |
+
$content .= '<br /><span class="description">' . $desc . '</span>';
|
351 |
+
|
352 |
+
break;
|
353 |
+
|
354 |
+
case 'heading':
|
355 |
+
$content .= '</td></tr><tr valign="top"><td colspan="2"><h4>' . $desc . '</h4>';
|
356 |
+
break;
|
357 |
+
|
358 |
+
case 'hidden':
|
359 |
+
$content .= '<input type="hidden" id="' . $id . '" name="' . static::ID . '[' . $id . ']" value="' . $options[$id] . '" />';
|
360 |
+
|
361 |
+
break;
|
362 |
+
|
363 |
+
case 'password':
|
364 |
+
$content .= '<input class="regular-text' . $field_class . '" type="password" id="' . $id . '" name="' . static::ID . '[' . $id . ']" value="' . $options[$id] . '" />';
|
365 |
+
|
366 |
+
if ( ! empty( $desc ) )
|
367 |
+
$content .= '<br /><span class="description">' . $desc . '</span>';
|
368 |
+
|
369 |
+
break;
|
370 |
+
|
371 |
+
case 'radio':
|
372 |
+
$i = 1;
|
373 |
+
$count_choices = count( $choices );
|
374 |
+
foreach ( $choices as $value => $label ) {
|
375 |
+
$content .= '<input class="radio' . $field_class . '" type="radio" name="' . static::ID . '[' . $id . ']" id="' . $id . $i . '" value="' . $value . '" ' . checked( $options[$id], $value, false ) . '> <label for="' . $id . $i . '">' . $label . '</label>';
|
376 |
+
|
377 |
+
if ( $i < $count_choices )
|
378 |
+
$content .= '<br />';
|
379 |
+
|
380 |
+
$i++;
|
381 |
+
}
|
382 |
+
|
383 |
+
if ( ! empty( $desc ) )
|
384 |
+
$content .= '<br /><span class="description">' . $desc . '</span>';
|
385 |
+
|
386 |
+
if ( $show_code )
|
387 |
+
$content .= '<br /><code>' . $id . '</code>';
|
388 |
+
break;
|
389 |
+
|
390 |
+
case 'readonly':
|
391 |
+
$content .= '<input class="regular-text' . $field_class . '" type="text" id="' . $id . '" name="' . static::ID . '[' . $id . ']" value="' . $options[$id] . '" readonly="readonly" />';
|
392 |
+
|
393 |
+
if ( ! empty( $desc ) )
|
394 |
+
$content .= '<br /><span class="description">' . $desc . '</span>';
|
395 |
+
|
396 |
+
break;
|
397 |
+
|
398 |
+
case 'select':
|
399 |
+
$content .= '<select class="select' . $field_class . '" id="' . $id . '" name="' . static::ID . '[' . $id . ']">';
|
400 |
+
|
401 |
+
foreach ( $choices as $value => $label )
|
402 |
+
$content .= '<option value="' . $value . '"' . selected( $options[$id], $value, false ) . '>' . $label . '</option>';
|
403 |
+
|
404 |
+
$content .= '</select>';
|
405 |
+
|
406 |
+
if ( ! empty( $desc ) )
|
407 |
+
$content .= '<br /><span class="description">' . $desc . '</span>';
|
408 |
+
|
409 |
+
if ( $show_code )
|
410 |
+
$content .= '<br /><code>' . $id . '</code>';
|
411 |
+
break;
|
412 |
+
|
413 |
+
case 'text':
|
414 |
+
$content .= '<input class="regular-text' . $field_class . '" type="text" id="' . $id . '" name="' . static::ID . '[' . $id . ']" placeholder="' . $std . '" value="' . $options[$id] . '" />';
|
415 |
+
|
416 |
+
if ( ! empty( $desc ) )
|
417 |
+
$content .= '<br /><span class="description">' . $desc . '</span>';
|
418 |
+
|
419 |
+
if ( $show_code )
|
420 |
+
$content .= '<br /><code>' . $id . '</code>';
|
421 |
+
break;
|
422 |
+
|
423 |
+
case 'textarea':
|
424 |
+
$content .= '<textarea class="' . $field_class . '" id="' . $id . '" name="' . static::ID . '[' . $id . ']" placeholder="' . $std . '" rows="5" cols="30">' . wp_htmledit_pre( $options[$id] ) . '</textarea>';
|
425 |
+
|
426 |
+
if ( ! empty( $desc ) )
|
427 |
+
$content .= '<br /><span class="description">' . $desc . '</span>';
|
428 |
+
|
429 |
+
if ( $show_code )
|
430 |
+
$content .= '<br /><code>' . $id . '</code>';
|
431 |
+
break;
|
432 |
+
|
433 |
+
default:
|
434 |
+
break;
|
435 |
+
}
|
436 |
+
|
437 |
+
if ( ! $do_echo )
|
438 |
+
return $content;
|
439 |
+
|
440 |
+
echo $content;
|
441 |
+
}
|
442 |
+
|
443 |
+
|
444 |
+
public static function register_settings() {
|
445 |
+
register_setting( static::ID, static::ID, array( static::$class, 'validate_settings' ) );
|
446 |
+
|
447 |
+
foreach ( static::$sections as $slug => $title ) {
|
448 |
+
if ( $slug == 'about' )
|
449 |
+
add_settings_section( $slug, $title, array( static::$class, 'display_about' ), static::ID );
|
450 |
+
else
|
451 |
+
add_settings_section( $slug, $title, array( static::$class, 'display_section' ), static::ID );
|
452 |
+
}
|
453 |
+
|
454 |
+
foreach ( static::$settings as $id => $setting ) {
|
455 |
+
$setting['id'] = $id;
|
456 |
+
static::create_setting( $setting );
|
457 |
+
}
|
458 |
+
}
|
459 |
+
|
460 |
+
|
461 |
+
public static function scripts() {
|
462 |
+
wp_enqueue_script( 'jquery-ui-tabs' );
|
463 |
+
}
|
464 |
+
|
465 |
+
|
466 |
+
public static function styles() {
|
467 |
+
wp_enqueue_style( 'jquery-style', '//ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/smoothness/jquery-ui.css' );
|
468 |
+
}
|
469 |
+
|
470 |
+
|
471 |
+
/**
|
472 |
+
*
|
473 |
+
*
|
474 |
+
* @SuppressWarnings(PHPMD.Superglobals)
|
475 |
+
*/
|
476 |
+
public static function validate_settings( $input, $options = null, $do_errors = false ) {
|
477 |
+
$errors = array();
|
478 |
+
|
479 |
+
if ( is_null( $options ) ) {
|
480 |
+
$options = self::get_settings();
|
481 |
+
$defaults = static::get_defaults();
|
482 |
+
|
483 |
+
if ( is_admin() ) {
|
484 |
+
if ( ! empty( $input['reset_defaults'] ) ) {
|
485 |
+
foreach ( $defaults as $id => $std )
|
486 |
+
$input[$id] = $std;
|
487 |
+
|
488 |
+
unset( $input['reset_defaults'] );
|
489 |
+
|
490 |
+
$input['resetted'] = true;
|
491 |
+
}
|
492 |
+
|
493 |
+
if ( ! empty( $input['import'] ) && $_SESSION['export'] != $input['import'] ) {
|
494 |
+
$import = $input['import'];
|
495 |
+
$unserialized = unserialize( $import );
|
496 |
+
if ( is_array( $unserialized ) ) {
|
497 |
+
foreach ( $unserialized as $id => $std )
|
498 |
+
$input[$id] = $std;
|
499 |
+
}
|
500 |
+
}
|
501 |
+
}
|
502 |
+
}
|
503 |
+
|
504 |
+
foreach ( $options as $id => $parts ) {
|
505 |
+
$default = $parts['std'];
|
506 |
+
$type = $parts['type'];
|
507 |
+
$validations = ! empty( $parts['validate'] ) ? $parts['validate'] : array();
|
508 |
+
if ( ! empty( $validations ) )
|
509 |
+
$validations = explode( ',', $validations );
|
510 |
+
|
511 |
+
if ( ! isset( $input[ $id ] ) ) {
|
512 |
+
if ( 'checkbox' != $type )
|
513 |
+
$input[ $id ] = $default;
|
514 |
+
else
|
515 |
+
$input[ $id ] = 0;
|
516 |
+
}
|
517 |
+
|
518 |
+
if ( $default == $input[ $id ] && ! in_array( 'required', $validations ) )
|
519 |
+
continue;
|
520 |
+
|
521 |
+
if ( 'checkbox' == $type ) {
|
522 |
+
if ( self::is_true( $input[ $id ] ) )
|
523 |
+
$input[ $id ] = 1;
|
524 |
+
else
|
525 |
+
$input[ $id ] = 0;
|
526 |
+
} elseif ( in_array( $type, array( 'radio', 'select' ) ) ) {
|
527 |
+
// single choices only
|
528 |
+
$keys = array_keys( $parts['choices'] );
|
529 |
+
|
530 |
+
if ( ! in_array( $input[ $id ], $keys ) ) {
|
531 |
+
if ( self::is_true( $input[ $id ] ) )
|
532 |
+
$input[ $id ] = 1;
|
533 |
+
else
|
534 |
+
$input[ $id ] = 0;
|
535 |
+
}
|
536 |
+
}
|
537 |
+
|
538 |
+
if ( ! empty( $validations ) ) {
|
539 |
+
foreach ( $validations as $validate )
|
540 |
+
self::validators( $validate, $id, $input, $default, $errors );
|
541 |
+
}
|
542 |
+
}
|
543 |
+
|
544 |
+
unset( $input['export'] );
|
545 |
+
unset( $input['import'] );
|
546 |
+
|
547 |
+
if ( empty( $do_errors ) ) {
|
548 |
+
$validated = $input;
|
549 |
+
} else {
|
550 |
+
$validated = array(
|
551 |
+
'input' => $input,
|
552 |
+
'errors' => $errors,
|
553 |
+
);
|
554 |
+
}
|
555 |
+
|
556 |
+
return $validated;
|
557 |
+
}
|
558 |
+
|
559 |
+
|
560 |
+
public static function validators( $validate, $id, &$input, $default, &$errors ) {
|
561 |
+
switch ( $validate ) {
|
562 |
+
case 'absint':
|
563 |
+
case 'intval':
|
564 |
+
if ( '' !== $input[ $id ] )
|
565 |
+
$input[ $id ] = $validate( $input[ $id ] );
|
566 |
+
else
|
567 |
+
$input[ $id ] = $default;
|
568 |
+
break;
|
569 |
+
|
570 |
+
case 'ids':
|
571 |
+
$input[ $id ] = self::validate_ids( $input[ $id ], $default );
|
572 |
+
break;
|
573 |
+
|
574 |
+
case 'is_true':
|
575 |
+
$input[ $id ] = self::is_true( $input[ $id ] );
|
576 |
+
break;
|
577 |
+
|
578 |
+
case 'min1':
|
579 |
+
$input[ $id ] = intval( $input[ $id ] );
|
580 |
+
if ( 0 >= $input[ $id ] )
|
581 |
+
$input[ $id ] = $default;
|
582 |
+
break;
|
583 |
+
|
584 |
+
case 'nozero':
|
585 |
+
$input[ $id ] = intval( $input[ $id ] );
|
586 |
+
if ( 0 === $input[ $id ] )
|
587 |
+
$input[ $id ] = $default;
|
588 |
+
break;
|
589 |
+
|
590 |
+
case 'order':
|
591 |
+
$input[ $id ] = self::validate_order( $input[ $id ], $default );
|
592 |
+
break;
|
593 |
+
|
594 |
+
case 'required':
|
595 |
+
if ( empty( $input[ $id ] ) )
|
596 |
+
$errors[ $id ] = esc_html__( 'Required', 'testimonials-widget' );
|
597 |
+
break;
|
598 |
+
|
599 |
+
case 'slug':
|
600 |
+
$input[ $id ] = self::validate_slug( $input[ $id ], $default );
|
601 |
+
$input[ $id ] = strtolower( $input[ $id ] );
|
602 |
+
break;
|
603 |
+
|
604 |
+
case 'slugs':
|
605 |
+
$input[ $id ] = self::validate_slugs( $input[ $id ], $default );
|
606 |
+
$input[ $id ] = strtolower( $input[ $id ] );
|
607 |
+
break;
|
608 |
+
|
609 |
+
case 'term':
|
610 |
+
$input[ $id ] = self::validate_term( $input[ $id ], $default );
|
611 |
+
$input[ $id ] = strtolower( $input[ $id ] );
|
612 |
+
break;
|
613 |
+
|
614 |
+
case 'terms':
|
615 |
+
$input[ $id ] = self::validate_terms( $input[ $id ], $default );
|
616 |
+
break;
|
617 |
+
|
618 |
+
case 'trim':
|
619 |
+
$options = explode( "\n", $input[ $id ] );
|
620 |
+
foreach ( $options as $key => $value )
|
621 |
+
$options[ $key ] = trim( $value );
|
622 |
+
|
623 |
+
$input[ $id ] = implode( "\n", $options );
|
624 |
+
break;
|
625 |
+
|
626 |
+
case 'url':
|
627 |
+
$input[ $id ] = self::validate_url( $input[ $id ], $default );
|
628 |
+
break;
|
629 |
+
|
630 |
+
default:
|
631 |
+
$input[ $id ] = $validate( $input[ $id ] );
|
632 |
+
break;
|
633 |
+
}
|
634 |
+
}
|
635 |
+
|
636 |
+
|
637 |
+
public static function validate_ids( $input, $default ) {
|
638 |
+
if ( preg_match( '#^\d+(,\s?\d+)*$#', $input ) )
|
639 |
+
return preg_replace( '#\s#', '', $input );
|
640 |
+
|
641 |
+
return $default;
|
642 |
+
}
|
643 |
+
|
644 |
+
|
645 |
+
public static function validate_order( $input, $default ) {
|
646 |
+
if ( preg_match( '#^desc|asc$#i', $input ) )
|
647 |
+
return $input;
|
648 |
+
|
649 |
+
return $default;
|
650 |
+
}
|
651 |
+
|
652 |
+
|
653 |
+
public static function validate_slugs( $input, $default ) {
|
654 |
+
if ( preg_match( '#^[\w-]+(,\s?[\w-]+)*$#', $input ) )
|
655 |
+
return preg_replace( '#\s#', '', $input );
|
656 |
+
|
657 |
+
return $default;
|
658 |
+
}
|
659 |
+
|
660 |
+
|
661 |
+
public static function validate_slug( $input, $default ) {
|
662 |
+
if ( preg_match( '#^[\w-]+$#', $input ) )
|
663 |
+
return $input;
|
664 |
+
|
665 |
+
return $default;
|
666 |
+
}
|
667 |
+
|
668 |
+
|
669 |
+
public static function validate_term( $input, $default ) {
|
670 |
+
if ( preg_match( '#^\w+$#', $input ) )
|
671 |
+
return $input;
|
672 |
+
|
673 |
+
return $default;
|
674 |
+
}
|
675 |
+
|
676 |
+
|
677 |
+
/**
|
678 |
+
* Let values like true, 'true', 1, 'on', and 'yes' to be true. Else, false
|
679 |
+
*/
|
680 |
+
public static function is_true( $value = null, $return_boolean = true ) {
|
681 |
+
if ( true === $value || 'true' == strtolower( $value ) || 1 == $value || 'on' == strtolower( $value ) || 'yes' == strtolower( $value ) ) {
|
682 |
+
if ( $return_boolean )
|
683 |
+
return true;
|
684 |
+
else
|
685 |
+
return 1;
|
686 |
+
} else {
|
687 |
+
if ( $return_boolean )
|
688 |
+
return false;
|
689 |
+
else
|
690 |
+
return 0;
|
691 |
+
}
|
692 |
+
}
|
693 |
+
|
694 |
+
|
695 |
+
public static function validate_terms( $input, $default ) {
|
696 |
+
if ( preg_match( '#^(([\w- ]+)(,\s?)?)+$#', $input ) )
|
697 |
+
return preg_replace( '#,\s*$#', '', $input );
|
698 |
+
|
699 |
+
return $default;
|
700 |
+
}
|
701 |
+
|
702 |
+
|
703 |
+
public static function validate_url( $input, $default ) {
|
704 |
+
if ( filter_var( $input, FILTER_VALIDATE_URL ) )
|
705 |
+
return $input;
|
706 |
+
|
707 |
+
return $default;
|
708 |
+
}
|
709 |
+
|
710 |
+
|
711 |
+
public static function get_scripts() {
|
712 |
+
foreach ( static::$scripts as $script )
|
713 |
+
echo $script;
|
714 |
+
}
|
715 |
+
|
716 |
+
|
717 |
+
public static function get_styles() {
|
718 |
+
foreach ( static::$styles as $style )
|
719 |
+
echo $style;
|
720 |
+
}
|
721 |
+
|
722 |
+
|
723 |
+
}
|
724 |
+
|
725 |
+
|
726 |
+
?>
|
lib/aihrus/class-aihrus-widget.php
ADDED
@@ -0,0 +1,289 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
Copyright 2013 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 |
+
// Display the widget title if one was input (before and after defined by themes)
|
65 |
+
if ( ! empty( $title ) ) {
|
66 |
+
if ( ! empty( $instance['title_link'] ) ) {
|
67 |
+
// revise title with title_link link creation
|
68 |
+
$title_link = $instance['title_link'];
|
69 |
+
|
70 |
+
if ( preg_match( '#^\d+$#', $title_link ) ) {
|
71 |
+
$new_title = '<a href="';
|
72 |
+
$new_title .= get_permalink( $title_link );
|
73 |
+
$new_title .= '" title="';
|
74 |
+
$new_title .= get_the_title( $title_link );
|
75 |
+
$new_title .= '">';
|
76 |
+
$new_title .= $title;
|
77 |
+
$new_title .= '</a>';
|
78 |
+
|
79 |
+
$title = $new_title;
|
80 |
+
} else {
|
81 |
+
$do_http = true;
|
82 |
+
|
83 |
+
if ( 0 === strpos( $title_link, '/' ) )
|
84 |
+
$do_http = false;
|
85 |
+
|
86 |
+
if ( $do_http && 0 === preg_match( '#https?://#', $title_link ) ) {
|
87 |
+
$title_link = 'http://' . $title_link;
|
88 |
+
}
|
89 |
+
|
90 |
+
$new_title = '<a href="';
|
91 |
+
$new_title .= $title_link;
|
92 |
+
$new_title .= '" title="';
|
93 |
+
$new_title .= $title;
|
94 |
+
$new_title .= '"';
|
95 |
+
|
96 |
+
$new_title .= '>';
|
97 |
+
$new_title .= $title;
|
98 |
+
$new_title .= '</a>';
|
99 |
+
|
100 |
+
$title = $new_title;
|
101 |
+
|
102 |
+
if ( ! empty( $instance['target'] ) )
|
103 |
+
$title = links_add_target( $title, $instance['target'] );
|
104 |
+
}
|
105 |
+
}
|
106 |
+
|
107 |
+
echo $before_title . $title . $after_title;
|
108 |
+
}
|
109 |
+
|
110 |
+
// Display Widget
|
111 |
+
echo $content;
|
112 |
+
|
113 |
+
// After widget (defined by themes)
|
114 |
+
echo $after_widget;
|
115 |
+
}
|
116 |
+
|
117 |
+
|
118 |
+
/**
|
119 |
+
*
|
120 |
+
*
|
121 |
+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
122 |
+
*/
|
123 |
+
|
124 |
+
|
125 |
+
public function update( $new_instance, $old_instance ) {
|
126 |
+
$instance = static::validate_settings( $new_instance );
|
127 |
+
|
128 |
+
return $instance;
|
129 |
+
}
|
130 |
+
|
131 |
+
|
132 |
+
public function form( $instance ) {
|
133 |
+
$instance = static::form_instance( $instance );
|
134 |
+
$defaults = static::get_defaults();
|
135 |
+
$instance = wp_parse_args( $instance, $defaults );
|
136 |
+
|
137 |
+
$form_parts = static::form_parts( $instance, $this->number );
|
138 |
+
foreach ( $form_parts as $key => $part ) {
|
139 |
+
$part[ 'id' ] = $key;
|
140 |
+
$this->display_setting( $part, $instance );
|
141 |
+
}
|
142 |
+
}
|
143 |
+
|
144 |
+
|
145 |
+
public static function widget_options( $options ) {
|
146 |
+
foreach ( $options as $id => $parts ) {
|
147 |
+
// remove non-widget parts
|
148 |
+
if ( empty( $parts['widget'] ) )
|
149 |
+
unset( $options[ $id ] );
|
150 |
+
}
|
151 |
+
|
152 |
+
return $options;
|
153 |
+
}
|
154 |
+
|
155 |
+
|
156 |
+
/**
|
157 |
+
*
|
158 |
+
*
|
159 |
+
* @SuppressWarnings(PHPMD.UnusedLocalVariable)
|
160 |
+
*/
|
161 |
+
public function display_setting( $args = array(), $options ) {
|
162 |
+
extract( $args );
|
163 |
+
|
164 |
+
$do_return = false;
|
165 |
+
switch ( $type ) {
|
166 |
+
case 'heading':
|
167 |
+
if ( ! empty( $desc ) )
|
168 |
+
echo '<h3>' . $desc . '</h3>';
|
169 |
+
|
170 |
+
$do_return = true;
|
171 |
+
break;
|
172 |
+
|
173 |
+
case 'expand_all':
|
174 |
+
if ( ! empty( $desc ) )
|
175 |
+
echo '<h3>' . $desc . '</h3>';
|
176 |
+
|
177 |
+
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', 'testimonials-widget' ) . ' »</a>';
|
178 |
+
|
179 |
+
$do_return = true;
|
180 |
+
break;
|
181 |
+
|
182 |
+
case 'expand_begin':
|
183 |
+
if ( ! empty( $desc ) )
|
184 |
+
echo '<h3>' . $desc . '</h3>';
|
185 |
+
|
186 |
+
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', 'testimonials-widget' ) . ' »</a>';
|
187 |
+
echo '<div id="' . $this->get_field_id( $id ) . '" style="display:none" class="tw-collapsible">';
|
188 |
+
|
189 |
+
$do_return = true;
|
190 |
+
break;
|
191 |
+
|
192 |
+
case 'expand_end':
|
193 |
+
echo '</div>';
|
194 |
+
|
195 |
+
$do_return = true;
|
196 |
+
break;
|
197 |
+
|
198 |
+
default:
|
199 |
+
break;
|
200 |
+
}
|
201 |
+
|
202 |
+
if ( $do_return )
|
203 |
+
return;
|
204 |
+
|
205 |
+
if ( ! isset( $options[$id] ) && $type != 'checkbox' )
|
206 |
+
$options[$id] = $std;
|
207 |
+
elseif ( ! isset( $options[$id] ) )
|
208 |
+
$options[$id] = 0;
|
209 |
+
|
210 |
+
$field_class = '';
|
211 |
+
if ( ! empty( $class ) )
|
212 |
+
$field_class = ' ' . $class;
|
213 |
+
|
214 |
+
echo '<p>';
|
215 |
+
|
216 |
+
switch ( $type ) {
|
217 |
+
case 'checkbox':
|
218 |
+
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 ) . ' /> ';
|
219 |
+
|
220 |
+
echo '<label for="' . $this->get_field_id( $id ) . '">' . $title . '</label>';
|
221 |
+
break;
|
222 |
+
|
223 |
+
case 'select':
|
224 |
+
echo '<label for="' . $this->get_field_id( $id ) . '">' . $title . '</label>';
|
225 |
+
echo '<select id="' . $this->get_field_id( $id ) . '"class="select' . $field_class . '" name="' . $this->get_field_name( $id ) . '">';
|
226 |
+
|
227 |
+
foreach ( $choices as $value => $label )
|
228 |
+
echo '<option value="' . esc_attr( $value ) . '"' . selected( $options[$id], $value, false ) . '>' . $label . '</option>';
|
229 |
+
|
230 |
+
echo '</select>';
|
231 |
+
break;
|
232 |
+
|
233 |
+
case 'radio':
|
234 |
+
$i = 0;
|
235 |
+
$count_options = count( $options ) - 1;
|
236 |
+
|
237 |
+
foreach ( $choices as $value => $label ) {
|
238 |
+
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>';
|
239 |
+
if ( $i < $count_options )
|
240 |
+
echo '<br />';
|
241 |
+
$i++;
|
242 |
+
}
|
243 |
+
|
244 |
+
echo '<label for="' . $this->get_field_id( $id ) . '">' . $title . '</label>';
|
245 |
+
break;
|
246 |
+
|
247 |
+
case 'textarea':
|
248 |
+
echo '<label for="' . $this->get_field_id( $id ) . '">' . $title . '</label>';
|
249 |
+
|
250 |
+
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>';
|
251 |
+
break;
|
252 |
+
|
253 |
+
case 'password':
|
254 |
+
echo '<label for="' . $this->get_field_id( $id ) . '">' . $title . '</label>';
|
255 |
+
|
256 |
+
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] ) . '" />';
|
257 |
+
break;
|
258 |
+
|
259 |
+
case 'readonly':
|
260 |
+
echo '<label for="' . $this->get_field_id( $id ) . '">' . $title . '</label>';
|
261 |
+
|
262 |
+
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" />';
|
263 |
+
break;
|
264 |
+
|
265 |
+
case 'text':
|
266 |
+
echo '<label for="' . $this->get_field_id( $id ) . '">' . $title . '</label>';
|
267 |
+
|
268 |
+
$suggest_id = 'suggest_' . self::$suggest_id++;
|
269 |
+
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] ) . '" />';
|
270 |
+
|
271 |
+
if ( $suggest )
|
272 |
+
echo static::get_suggest( $id, $suggest_id );
|
273 |
+
break;
|
274 |
+
|
275 |
+
default:
|
276 |
+
break;
|
277 |
+
}
|
278 |
+
|
279 |
+
if ( ! empty( $desc ) )
|
280 |
+
echo '<br /><span class="setting-description"><small>' . $desc . '</small></span>';
|
281 |
+
|
282 |
+
echo '</p>';
|
283 |
+
}
|
284 |
+
|
285 |
+
|
286 |
+
}
|
287 |
+
|
288 |
+
|
289 |
+
?>
|
lib/aihrus/interface-aihrus-common.php
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
Copyright 2013 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 |
+
?>
|
lib/aihrus/interface-aihrus-licensing.php
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
Copyright 2013 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 |
+
?>
|
lib/aihrus/interface-aihrus-widget.php
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
Copyright 2013 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 |
+
?>
|
lib/class-testimonials-widget-settings.php
CHANGED
@@ -17,96 +17,87 @@
|
|
17 |
*/
|
18 |
|
19 |
/**
|
20 |
-
* Testimonials
|
21 |
*
|
22 |
* Based upon http://alisothegeek.com/2011/01/wordpress-settings-api-tutorial-1/
|
23 |
*/
|
24 |
|
25 |
|
26 |
-
|
27 |
-
const ID = 'testimonialswidget_settings';
|
28 |
|
29 |
-
|
30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
'backwards' => array(
|
32 |
-
'version' =>
|
33 |
-
'std' =>
|
34 |
),
|
35 |
'choices' => array(), // key => value
|
36 |
-
'class' =>
|
37 |
-
'desc' =>
|
38 |
-
'id' =>
|
39 |
'section' => 'general',
|
40 |
-
'
|
|
|
41 |
'suggest' => false, // attempt for auto-suggest on inputs
|
42 |
-
'title' =>
|
43 |
'type' => 'text', // textarea, checkbox, radio, select, hidden, heading, password, expand_begin, expand_end
|
44 |
-
'validate' =>
|
45 |
'widget' => 1, // show in widget options, 0 off
|
46 |
);
|
47 |
|
48 |
-
public static $defaults = array();
|
49 |
-
public static $sections = array();
|
50 |
-
public static $settings = array();
|
51 |
-
public static $suggest_id = 0;
|
52 |
-
public static $version = null;
|
53 |
-
|
54 |
-
|
55 |
public function __construct() {
|
56 |
-
add_action( 'admin_init', array(
|
57 |
-
add_action( 'admin_menu', array(
|
58 |
-
|
59 |
}
|
60 |
|
61 |
|
62 |
-
public function admin_init() {
|
63 |
-
add_filter( 'wp_unique_post_slug_is_bad_hierarchical_slug', array(
|
64 |
-
add_filter( 'wp_unique_post_slug_is_bad_flat_slug', array(
|
65 |
|
66 |
$version = tw_get_option( 'version' );
|
67 |
self::$version = Testimonials_Widget::VERSION;
|
68 |
self::$version = apply_filters( 'testimonials_widget_version', self::$version );
|
69 |
|
70 |
if ( $version != self::$version )
|
71 |
-
|
72 |
|
73 |
-
if ( !
|
74 |
return;
|
75 |
|
76 |
-
self::
|
77 |
-
self::
|
78 |
-
|
79 |
-
$this->register_settings();
|
80 |
}
|
81 |
|
82 |
|
83 |
-
public function admin_menu() {
|
84 |
-
self::$admin_page = add_submenu_page( 'edit.php?post_type=' . Testimonials_Widget::PT, esc_html__( 'Testimonials
|
85 |
|
86 |
-
add_action( 'admin_print_scripts-' . self::$admin_page, array(
|
87 |
-
add_action( 'admin_print_styles-' . self::$admin_page, array(
|
88 |
-
add_action( 'load-' . self::$admin_page, array(
|
89 |
}
|
90 |
|
91 |
|
92 |
-
|
93 |
-
|
94 |
-
*
|
95 |
-
* @SuppressWarnings(PHPMD.Superglobals)
|
96 |
-
*/
|
97 |
-
public static function do_load() {
|
98 |
-
$do_load = false;
|
99 |
-
if ( ! empty( $GLOBALS['pagenow'] ) && in_array( $GLOBALS['pagenow'], array( 'options.php' ) ) ) {
|
100 |
-
$do_load = true;
|
101 |
-
} elseif ( ! empty( $_REQUEST['post_type'] ) && Testimonials_Widget::PT == $_REQUEST['post_type'] ) {
|
102 |
-
if ( ! empty( $GLOBALS['pagenow'] ) && in_array( $GLOBALS['pagenow'], array( 'edit.php' ) ) ) {
|
103 |
-
$do_load = true;
|
104 |
-
} elseif ( ! empty( $_REQUEST['page'] ) && self::ID == $_REQUEST['page'] ) {
|
105 |
-
$do_load = true;
|
106 |
-
}
|
107 |
-
}
|
108 |
|
109 |
-
|
110 |
}
|
111 |
|
112 |
|
@@ -116,8 +107,8 @@ class Testimonials_Widget_Settings {
|
|
116 |
self::$sections['ordering'] = esc_html__( 'Ordering', 'testimonials-widget' );
|
117 |
self::$sections['widget'] = esc_html__( 'Widget', 'testimonials-widget' );
|
118 |
self::$sections['post_type'] = esc_html__( 'Post Type', 'testimonials-widget' );
|
119 |
-
|
120 |
-
|
121 |
|
122 |
self::$sections = apply_filters( 'testimonials_widget_sections', self::$sections );
|
123 |
}
|
@@ -159,6 +150,11 @@ class Testimonials_Widget_Settings {
|
|
159 |
'validate' => 'absint',
|
160 |
);
|
161 |
|
|
|
|
|
|
|
|
|
|
|
162 |
self::$settings['widget_expand_begin'] = array(
|
163 |
'section' => 'widget',
|
164 |
'desc' => esc_html__( 'Additional Widget Options', 'testimonials-widget' ),
|
@@ -482,7 +478,7 @@ class Testimonials_Widget_Settings {
|
|
482 |
self::$settings['allow_comments'] = array(
|
483 |
'section' => 'post_type',
|
484 |
'title' => esc_html__( 'Allow Comments?', 'testimonials-widget' ),
|
485 |
-
'desc' => esc_html__( 'Only affects the Testimonials
|
486 |
'type' => 'checkbox',
|
487 |
'validate' => 'is_true',
|
488 |
'widget' => 0,
|
@@ -515,7 +511,7 @@ class Testimonials_Widget_Settings {
|
|
515 |
// Reset
|
516 |
self::$settings['reset_expand_begin'] = array(
|
517 |
'section' => 'reset',
|
518 |
-
'desc' => esc_html__( 'Compatiblity Options', 'testimonials-widget' ),
|
519 |
'type' => 'expand_begin',
|
520 |
);
|
521 |
|
@@ -524,52 +520,11 @@ class Testimonials_Widget_Settings {
|
|
524 |
'title' => esc_html__( 'Don\'t Use Default Taxonomies?', 'testimonials-widget' ),
|
525 |
'type' => 'checkbox',
|
526 |
'validate' => 'is_true',
|
527 |
-
'desc' => esc_html__( 'If checked, use Testimonials
|
528 |
-
'widget' => 0,
|
529 |
-
);
|
530 |
-
|
531 |
-
$options = get_option( self::ID );
|
532 |
-
if ( ! empty( $options ) ) {
|
533 |
-
$serialized_options = serialize( $options );
|
534 |
-
$_SESSION['export'] = $serialized_options;
|
535 |
-
|
536 |
-
self::$settings['export'] = array(
|
537 |
-
'section' => 'reset',
|
538 |
-
'title' => esc_html__( 'Export Settings', 'testimonials-widget' ),
|
539 |
-
'type' => 'readonly',
|
540 |
-
'desc' => esc_html__( 'These are your current settings in a serialized format. Copy the contents to make a backup of your settings.', 'testimonials-widget' ),
|
541 |
-
'std' => $serialized_options,
|
542 |
-
'widget' => 0,
|
543 |
-
);
|
544 |
-
}
|
545 |
-
|
546 |
-
self::$settings['import'] = array(
|
547 |
-
'section' => 'reset',
|
548 |
-
'title' => esc_html__( 'Import Settings', 'testimonials-widget' ),
|
549 |
-
'type' => 'textarea',
|
550 |
-
'desc' => esc_html__( 'Paste new serialized settings here to overwrite your current configuration.', 'testimonials-widget' ),
|
551 |
-
'widget' => 0,
|
552 |
-
);
|
553 |
-
|
554 |
-
self::$settings['delete_data'] = array(
|
555 |
-
'section' => 'reset',
|
556 |
-
'title' => esc_html__( 'Remove Plugin Data on Deletion?', 'testimonials-widget' ),
|
557 |
-
'type' => 'checkbox',
|
558 |
-
'validate' => 'is_true',
|
559 |
-
'class' => 'warning', // Custom class for CSS
|
560 |
-
'desc' => esc_html__( 'Delete all Testimonials Widget data and options from database on plugin deletion', 'testimonials-widget' ),
|
561 |
'widget' => 0,
|
562 |
);
|
563 |
|
564 |
-
|
565 |
-
'section' => 'reset',
|
566 |
-
'title' => esc_html__( 'Reset to Defaults?', 'testimonials-widget' ),
|
567 |
-
'type' => 'checkbox',
|
568 |
-
'validate' => 'is_true',
|
569 |
-
'class' => 'warning', // Custom class for CSS
|
570 |
-
'desc' => esc_html__( 'Check this box to reset options to their defaults', 'testimonials-widget' ),
|
571 |
-
'widget' => 0,
|
572 |
-
);
|
573 |
|
574 |
self::$settings['version_options_heading'] = array(
|
575 |
'section' => 'reset',
|
@@ -580,7 +535,7 @@ class Testimonials_Widget_Settings {
|
|
580 |
self::$settings['use_bxslider'] = array(
|
581 |
'section' => 'reset',
|
582 |
'title' => esc_html__( 'Use bxSlider?', 'testimonials-widget' ),
|
583 |
-
'desc' => esc_html__( 'Pre 2.15.0, Testimonials
|
584 |
'type' => 'checkbox',
|
585 |
'validate' => 'is_true',
|
586 |
'backwards' => array(
|
@@ -639,7 +594,7 @@ class Testimonials_Widget_Settings {
|
|
639 |
self::$settings['force_css_loading'] = array(
|
640 |
'section' => 'reset',
|
641 |
'title' => esc_html__( 'Always Load CSS?', 'testimonials-widget' ),
|
642 |
-
'desc' => esc_html__( 'Pre 2.14.0, Testimonials
|
643 |
'type' => 'checkbox',
|
644 |
'validate' => 'is_true',
|
645 |
'backwards' => array(
|
@@ -676,7 +631,7 @@ class Testimonials_Widget_Settings {
|
|
676 |
self::$settings['remove_hentry'] = array(
|
677 |
'section' => 'reset',
|
678 |
'title' => esc_html__( 'Remove `.hentry` CSS?', 'testimonials-widget' ),
|
679 |
-
'desc' => esc_html__( 'Pre 2.6.4, some themes use class `.hentry` in a manner that breaks Testimonials
|
680 |
'type' => 'checkbox',
|
681 |
'validate' => 'is_true',
|
682 |
'backwards' => array(
|
@@ -692,183 +647,22 @@ class Testimonials_Widget_Settings {
|
|
692 |
|
693 |
self::$settings = apply_filters( 'testimonials_widget_settings', self::$settings );
|
694 |
|
695 |
-
foreach ( self::$settings as $id => $parts )
|
696 |
self::$settings[ $id ] = wp_parse_args( $parts, self::$default );
|
697 |
-
}
|
698 |
-
}
|
699 |
-
|
700 |
-
|
701 |
-
public static function get_defaults( $mode = null ) {
|
702 |
-
if ( empty( self::$defaults ) )
|
703 |
-
self::settings();
|
704 |
-
|
705 |
-
$do_backwards = false;
|
706 |
-
if ( 'backwards' == $mode ) {
|
707 |
-
$old_version = tw_get_option( 'version' );
|
708 |
-
if ( ! empty( $old_version ) )
|
709 |
-
$do_backwards = true;
|
710 |
-
}
|
711 |
-
|
712 |
-
foreach ( self::$settings as $id => $parts ) {
|
713 |
-
$std = isset( $parts['std'] ) ? $parts['std'] : '';
|
714 |
-
if ( $do_backwards ) {
|
715 |
-
$version = ! empty( $parts['backwards']['version'] ) ? $parts['backwards']['version'] : false;
|
716 |
-
if ( ! empty( $version ) ) {
|
717 |
-
if ( $old_version < $version )
|
718 |
-
$std = $parts['backwards']['std'];
|
719 |
-
}
|
720 |
-
}
|
721 |
-
|
722 |
-
self::$defaults[ $id ] = $std;
|
723 |
-
}
|
724 |
-
|
725 |
-
return self::$defaults;
|
726 |
}
|
727 |
|
728 |
|
729 |
-
public static function
|
730 |
-
|
731 |
-
self::settings();
|
732 |
|
733 |
-
return
|
734 |
}
|
735 |
|
736 |
|
737 |
-
|
738 |
-
*
|
739 |
-
*
|
740 |
-
* @SuppressWarnings(PHPMD.UnusedLocalVariable)
|
741 |
-
*/
|
742 |
-
public function create_setting( $args = array() ) {
|
743 |
-
extract( $args );
|
744 |
-
|
745 |
-
if ( preg_match( '#(_expand_begin|_expand_end)#', $id ) )
|
746 |
-
return;
|
747 |
-
|
748 |
-
$field_args = array(
|
749 |
-
'choices' => $choices,
|
750 |
-
'class' => $class,
|
751 |
-
'desc' => $desc,
|
752 |
-
'id' => $id,
|
753 |
-
'label_for' => $id,
|
754 |
-
'std' => $std,
|
755 |
-
'suggest' => $suggest,
|
756 |
-
'type' => $type,
|
757 |
-
);
|
758 |
-
|
759 |
-
self::$defaults[$id] = $std;
|
760 |
-
|
761 |
-
add_settings_field( $id, $title, array( $this, 'display_setting' ), self::ID, $section, $field_args );
|
762 |
-
}
|
763 |
-
|
764 |
-
|
765 |
-
public static function display_page() {
|
766 |
-
echo '<div class="wrap">
|
767 |
-
<div class="icon32" id="icon-options-general"></div>
|
768 |
-
<h2>' . esc_html__( 'Testimonials Widget Settings', 'testimonials-widget' ) . '</h2>';
|
769 |
-
|
770 |
-
echo '<form action="options.php" method="post">';
|
771 |
-
|
772 |
-
settings_fields( self::ID );
|
773 |
-
|
774 |
-
echo '<div id="' . self::ID . '">
|
775 |
-
<ul>';
|
776 |
-
|
777 |
-
foreach ( self::$sections as $section_slug => $section )
|
778 |
-
echo '<li><a href="#' . $section_slug . '">' . $section . '</a></li>';
|
779 |
-
|
780 |
-
echo '</ul>';
|
781 |
-
|
782 |
-
self::do_settings_sections( self::ID );
|
783 |
-
|
784 |
-
echo '
|
785 |
-
<p class="submit"><input name="Submit" type="submit" class="button-primary" value="' . esc_html__( 'Save Changes', 'testimonials-widget' ) . '" /></p>
|
786 |
-
</form>
|
787 |
-
</div>
|
788 |
-
';
|
789 |
-
|
790 |
-
echo '<p>' .
|
791 |
-
sprintf(
|
792 |
-
__( 'When ready, <a href="%1$s">view</a> or <a href="%2$s">add</a> testimonials.', 'testimonials-widget' ),
|
793 |
-
esc_url( get_admin_url() . 'edit.php?post_type=testimonials-widget' ),
|
794 |
-
esc_url( get_admin_url() . 'post-new.php?post_type=testimonials-widget' )
|
795 |
-
) .
|
796 |
-
'</p>';
|
797 |
-
|
798 |
$disable_donate = tw_get_option( 'disable_donate' );
|
799 |
-
if ( ! $disable_donate ) {
|
800 |
-
echo '<p>' .
|
801 |
-
sprintf(
|
802 |
-
__( '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 Testimonials Widget Premium">purchase Testimonials Widget Premium</a> to help fund further development and <a href="%4$s" title="Support forums">support</a>.', 'testimonials-widget' ),
|
803 |
-
esc_url( 'http://aihr.us/about-aihrus/donate/' ),
|
804 |
-
esc_url( 'https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif' ),
|
805 |
-
esc_url( 'http://aihr.us/downloads/testimonials-widget-premium-wordpress-plugin/' ),
|
806 |
-
esc_url( 'https://aihrus.zendesk.com/categories/20104507-Testimonials-Widget' )
|
807 |
-
) .
|
808 |
-
'</p>';
|
809 |
-
}
|
810 |
-
|
811 |
-
echo '<p class="copyright">' .
|
812 |
-
sprintf(
|
813 |
-
__( 'Copyright ©%1$s <a href="%2$s">Aihrus</a>.', 'testimonials-widget' ),
|
814 |
-
date( 'Y' ),
|
815 |
-
esc_url( 'http://aihr.us' )
|
816 |
-
) .
|
817 |
-
'</p>';
|
818 |
|
819 |
-
|
820 |
-
|
821 |
-
echo '</div>';
|
822 |
-
}
|
823 |
-
|
824 |
-
|
825 |
-
public static function section_scripts() {
|
826 |
-
echo '
|
827 |
-
<script type="text/javascript">
|
828 |
-
jQuery(document).ready(function($) {
|
829 |
-
$( "#' . self::ID . '" ).tabs();
|
830 |
-
// This will make the "warning" checkbox class really stand out when checked.
|
831 |
-
$(".warning").change(function() {
|
832 |
-
if ($(this).is(":checked"))
|
833 |
-
$(this).parent().css("background", "#c00").css("color", "#fff").css("fontWeight", "bold");
|
834 |
-
else
|
835 |
-
$(this).parent().css("background", "inherit").css("color", "inherit").css("fontWeight", "inherit");
|
836 |
-
});
|
837 |
-
});
|
838 |
-
</script>
|
839 |
-
';
|
840 |
-
}
|
841 |
-
|
842 |
-
|
843 |
-
public static function do_settings_sections( $page ) {
|
844 |
-
global $wp_settings_sections, $wp_settings_fields;
|
845 |
-
|
846 |
-
if ( ! isset( $wp_settings_sections ) || !isset( $wp_settings_sections[$page] ) )
|
847 |
-
return;
|
848 |
-
|
849 |
-
foreach ( (array) $wp_settings_sections[$page] as $section ) {
|
850 |
-
if ( $section['callback'] )
|
851 |
-
call_user_func( $section['callback'], $section );
|
852 |
-
|
853 |
-
if ( ! isset( $wp_settings_fields ) || !isset( $wp_settings_fields[$page] ) || !isset( $wp_settings_fields[$page][$section['id']] ) )
|
854 |
-
continue;
|
855 |
-
|
856 |
-
echo '<table id=' . $section['id'] . ' class="form-table">';
|
857 |
-
do_settings_fields( $page, $section['id'] );
|
858 |
-
echo '</table>';
|
859 |
-
}
|
860 |
-
}
|
861 |
-
|
862 |
-
|
863 |
-
public function display_section() {}
|
864 |
-
|
865 |
-
|
866 |
-
public function display_about_section() {
|
867 |
-
echo '
|
868 |
-
<div id="about" style="width: 70%; min-height: 225px;">
|
869 |
-
<p><img class="alignright size-medium" title="Michael in Red Square, Moscow, Russia" src="' . WP_PLUGIN_URL . '/testimonials-widget/media/michael-cannon-red-square-300x2251.jpg" alt="Michael in Red Square, Moscow, Russia" width="300" height="225" /><a href="http://wordpress.org/extend/plugins/testimonials-widget/">Testimonials Widget</a> is by <a href="http://aihr.us/about-aihrus/michael-cannon-resume/">Michael Cannon</a>. He\'s <a title="Lot\'s of stuff about Peichi Liu…" href="http://peimic.com/t/peichi-liu/">Peichi’s</a> smiling man, an adventurous <a title="Water rat" href="http://www.chinesehoroscope.org/chinese_zodiac/rat/" target="_blank">water-rat</a>, <a title="Axelerant – Open Source. Engineered." href="http://axelerant.com/who-we-are">chief people officer</a>, <a title="Road biker, cyclist, biking; whatever you call, I love to ride" href="http://peimic.com/c/biking/">cyclist</a>, <a title="Aihrus – website support made easy since 1999" href="http://aihr.us/about-aihrus/">full stack developer</a>, <a title="Michael\'s poetic like literary ramblings" href="http://peimic.com/t/poetry/">poet</a>, <a title="World Wide Opportunities on Organic Farms" href="http://peimic.com/t/WWOOF/">WWOOF’er</a> and <a title="My traveled to country list, is more than my age." href="http://peimic.com/c/travel/">world traveler</a>.</p>
|
870 |
-
</div>
|
871 |
-
';
|
872 |
}
|
873 |
|
874 |
|
@@ -879,143 +673,48 @@ class Testimonials_Widget_Settings {
|
|
879 |
*/
|
880 |
public static function display_setting( $args = array(), $do_echo = true, $input = null ) {
|
881 |
$content = '';
|
|
|
|
|
|
|
882 |
|
883 |
-
|
884 |
-
|
885 |
-
|
886 |
-
|
887 |
-
|
888 |
-
if ( is_null( $input ) ) {
|
889 |
-
$options = get_option( self::ID );
|
890 |
-
} else {
|
891 |
-
$options = array();
|
892 |
-
$options[$id] = $input;
|
893 |
-
}
|
894 |
-
|
895 |
-
if ( ! isset( $options[$id] ) && $type != 'checkbox' )
|
896 |
-
$options[$id] = $std;
|
897 |
-
elseif ( ! isset( $options[$id] ) )
|
898 |
-
$options[$id] = 0;
|
899 |
-
|
900 |
-
$field_class = '';
|
901 |
-
if ( ! empty( $class ) )
|
902 |
-
$field_class = ' ' . $class;
|
903 |
-
|
904 |
-
// desc isn't escaped because it's might contain allowed html
|
905 |
-
$choices = array_map( 'esc_attr', $choices );
|
906 |
-
$field_class = esc_attr( $field_class );
|
907 |
-
$id = esc_attr( $id );
|
908 |
-
$options[$id] = esc_attr( $options[$id] );
|
909 |
-
$std = esc_attr( $std );
|
910 |
-
|
911 |
-
switch ( $type ) {
|
912 |
-
case 'checkbox':
|
913 |
-
$content .= '<input class="checkbox' . $field_class . '" type="checkbox" id="' . $id . '" name="' . self::ID . '[' . $id . ']" value="1" ' . checked( $options[$id], 1, false ) . ' /> ';
|
914 |
-
|
915 |
-
if ( ! empty( $desc ) )
|
916 |
-
$content .= '<label for="' . $id . '"><span class="description">' . $desc . '</span></label>';
|
917 |
-
|
918 |
-
if ( ! $no_code )
|
919 |
-
$content .= '<br /><code>' . $id . '</code>';
|
920 |
-
break;
|
921 |
-
|
922 |
-
case 'file':
|
923 |
-
$content .= '<input class="regular-text' . $field_class . '" type="file" id="' . $id . '" name="' . self::ID . '[' . $id . ']" />';
|
924 |
-
|
925 |
-
if ( ! empty( $desc ) )
|
926 |
-
$content .= '<br /><span class="description">' . $desc . '</span>';
|
927 |
-
|
928 |
-
break;
|
929 |
-
|
930 |
-
case 'heading':
|
931 |
-
$content .= '</td></tr><tr valign="top"><td colspan="2"><h4>' . $desc . '</h4>';
|
932 |
-
break;
|
933 |
-
|
934 |
-
case 'hidden':
|
935 |
-
$content .= '<input type="hidden" id="' . $id . '" name="' . self::ID . '[' . $id . ']" value="' . $options[$id] . '" />';
|
936 |
-
|
937 |
-
break;
|
938 |
-
|
939 |
-
case 'password':
|
940 |
-
$content .= '<input class="regular-text' . $field_class . '" type="password" id="' . $id . '" name="' . self::ID . '[' . $id . ']" value="' . $options[$id] . '" />';
|
941 |
-
|
942 |
-
if ( ! empty( $desc ) )
|
943 |
-
$content .= '<br /><span class="description">' . $desc . '</span>';
|
944 |
-
|
945 |
-
break;
|
946 |
-
|
947 |
-
case 'radio':
|
948 |
-
$i = 1;
|
949 |
-
$count_choices = count( $choices );
|
950 |
-
foreach ( $choices as $value => $label ) {
|
951 |
-
$content .= '<input class="radio' . $field_class . '" type="radio" name="' . self::ID . '[' . $id . ']" id="' . $id . $i . '" value="' . $value . '" ' . checked( $options[$id], $value, false ) . '> <label for="' . $id . $i . '">' . $label . '</label>';
|
952 |
-
|
953 |
-
if ( $i < $count_choices )
|
954 |
-
$content .= '<br />';
|
955 |
-
|
956 |
-
$i++;
|
957 |
}
|
958 |
|
959 |
-
if ( !
|
960 |
-
$
|
961 |
|
962 |
-
|
963 |
-
|
964 |
-
|
965 |
|
966 |
-
|
967 |
-
$content .= '<input class="regular-text' . $field_class . '" type="text" id="' . $id . '" name="' . self::ID . '[' . $id . ']" value="' . $options[$id] . '" readonly="readonly" />';
|
968 |
|
969 |
-
if ( ! empty( $desc ) )
|
970 |
-
$content .= '<br /><span class="description">' . $desc . '</span>';
|
971 |
-
|
972 |
-
break;
|
973 |
-
|
974 |
-
case 'select':
|
975 |
-
$content .= '<select class="select' . $field_class . '" name="' . self::ID . '[' . $id . ']">';
|
976 |
-
|
977 |
-
foreach ( $choices as $value => $label )
|
978 |
-
$content .= '<option value="' . $value . '"' . selected( $options[$id], $value, false ) . '>' . $label . '</option>';
|
979 |
-
|
980 |
-
$content .= '</select>';
|
981 |
-
|
982 |
-
if ( ! empty( $desc ) )
|
983 |
-
$content .= '<br /><span class="description">' . $desc . '</span>';
|
984 |
-
|
985 |
-
if ( ! $no_code )
|
986 |
-
$content .= '<br /><code>' . $id . '</code>';
|
987 |
-
break;
|
988 |
-
|
989 |
-
case 'text':
|
990 |
$suggest_id = 'suggest_' . self::$suggest_id++;
|
991 |
|
992 |
$content .= '<input class="regular-text' . $field_class . ' ' . $suggest_id . '" type="text" id="' . $id . '" name="' . self::ID . '[' . $id . ']" placeholder="' . $std . '" value="' . $options[$id] . '" />';
|
993 |
|
994 |
-
if ( $suggest )
|
995 |
$content .= self::get_suggest( $id, $suggest_id );
|
996 |
|
997 |
if ( ! empty( $desc ) )
|
998 |
$content .= '<br /><span class="description">' . $desc . '</span>';
|
999 |
|
1000 |
-
if (
|
1001 |
-
$content .= '<br /><code>' . $id . '</code>';
|
1002 |
-
break;
|
1003 |
-
|
1004 |
-
case 'textarea':
|
1005 |
-
$content .= '<textarea class="' . $field_class . '" id="' . $id . '" name="' . self::ID . '[' . $id . ']" placeholder="' . $std . '" rows="5" cols="30">' . wp_htmledit_pre( $options[$id] ) . '</textarea>';
|
1006 |
-
|
1007 |
-
if ( ! empty( $desc ) )
|
1008 |
-
$content .= '<br /><span class="description">' . $desc . '</span>';
|
1009 |
-
|
1010 |
-
if ( ! $no_code )
|
1011 |
$content .= '<br /><code>' . $id . '</code>';
|
1012 |
break;
|
1013 |
|
1014 |
default:
|
1015 |
-
$content = apply_filters( 'testimonials_widget_display_setting',
|
1016 |
break;
|
1017 |
}
|
1018 |
|
|
|
|
|
|
|
1019 |
if ( ! $do_echo )
|
1020 |
return $content;
|
1021 |
|
@@ -1023,41 +722,10 @@ class Testimonials_Widget_Settings {
|
|
1023 |
}
|
1024 |
|
1025 |
|
1026 |
-
public function initialize_settings() {
|
1027 |
-
$
|
1028 |
-
$current = get_option( self::ID );
|
1029 |
-
$current = wp_parse_args( $current, $defaults );
|
1030 |
-
$current['admin_notices'] = tw_get_option( 'version', self::$version );
|
1031 |
-
$current['version'] = self::$version;
|
1032 |
-
|
1033 |
-
update_option( self::ID, $current );
|
1034 |
-
}
|
1035 |
-
|
1036 |
-
|
1037 |
-
public function register_settings() {
|
1038 |
-
register_setting( self::ID, self::ID, array( $this, 'validate_settings' ) );
|
1039 |
|
1040 |
-
|
1041 |
-
if ( $slug == 'about' )
|
1042 |
-
add_settings_section( $slug, $title, array( $this, 'display_about_section' ), self::ID );
|
1043 |
-
else
|
1044 |
-
add_settings_section( $slug, $title, array( $this, 'display_section' ), self::ID );
|
1045 |
-
}
|
1046 |
-
|
1047 |
-
foreach ( self::$settings as $id => $setting ) {
|
1048 |
-
$setting['id'] = $id;
|
1049 |
-
$this->create_setting( $setting );
|
1050 |
-
}
|
1051 |
-
}
|
1052 |
-
|
1053 |
-
|
1054 |
-
public function scripts() {
|
1055 |
-
wp_enqueue_script( 'jquery-ui-tabs' );
|
1056 |
-
}
|
1057 |
-
|
1058 |
-
|
1059 |
-
public function styles() {
|
1060 |
-
wp_enqueue_style( 'jquery-style', '//ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/smoothness/jquery-ui.css' );
|
1061 |
}
|
1062 |
|
1063 |
|
@@ -1067,70 +735,14 @@ class Testimonials_Widget_Settings {
|
|
1067 |
* @SuppressWarnings(PHPMD.Superglobals)
|
1068 |
*/
|
1069 |
public static function validate_settings( $input, $options = null, $do_errors = false ) {
|
1070 |
-
$
|
1071 |
-
|
1072 |
-
if ( is_null( $options ) ) {
|
1073 |
-
$options = self::get_settings();
|
1074 |
-
$defaults = self::get_defaults();
|
1075 |
-
|
1076 |
-
if ( is_admin() ) {
|
1077 |
-
if ( ! empty( $input['reset_defaults'] ) ) {
|
1078 |
-
foreach ( $defaults as $id => $std ) {
|
1079 |
-
$input[$id] = $std;
|
1080 |
-
}
|
1081 |
-
|
1082 |
-
unset( $input['reset_defaults'] );
|
1083 |
-
}
|
1084 |
-
|
1085 |
-
if ( ! empty( $input['import'] ) && $_SESSION['export'] != $input['import'] ) {
|
1086 |
-
$import = $input['import'];
|
1087 |
-
$unserialized = unserialize( $import );
|
1088 |
-
if ( is_array( $unserialized ) ) {
|
1089 |
-
foreach ( $unserialized as $id => $std )
|
1090 |
-
$input[$id] = $std;
|
1091 |
-
}
|
1092 |
-
}
|
1093 |
-
}
|
1094 |
-
}
|
1095 |
-
|
1096 |
-
foreach ( $options as $id => $parts ) {
|
1097 |
-
$default = $parts['std'];
|
1098 |
-
$type = $parts['type'];
|
1099 |
-
$validations = ! empty( $parts['validate'] ) ? $parts['validate'] : array();
|
1100 |
-
if ( ! empty( $validations ) )
|
1101 |
-
$validations = explode( ',', $validations );
|
1102 |
-
|
1103 |
-
if ( ! isset( $input[ $id ] ) ) {
|
1104 |
-
if ( 'checkbox' != $type )
|
1105 |
-
$input[ $id ] = $default;
|
1106 |
-
else
|
1107 |
-
$input[ $id ] = 0;
|
1108 |
-
}
|
1109 |
-
|
1110 |
-
if ( $default == $input[ $id ] && ! in_array( 'required', $validations ) )
|
1111 |
-
continue;
|
1112 |
-
|
1113 |
-
if ( 'checkbox' == $type ) {
|
1114 |
-
if ( self::is_true( $input[ $id ] ) )
|
1115 |
-
$input[ $id ] = 1;
|
1116 |
-
else
|
1117 |
-
$input[ $id ] = 0;
|
1118 |
-
} elseif ( in_array( $type, array( 'radio', 'select' ) ) ) {
|
1119 |
-
// single choices only
|
1120 |
-
$keys = array_keys( $parts['choices'] );
|
1121 |
-
|
1122 |
-
if ( ! in_array( $input[ $id ], $keys ) ) {
|
1123 |
-
if ( self::is_true( $input[ $id ] ) )
|
1124 |
-
$input[ $id ] = 1;
|
1125 |
-
else
|
1126 |
-
$input[ $id ] = 0;
|
1127 |
-
}
|
1128 |
-
}
|
1129 |
|
1130 |
-
|
1131 |
-
|
1132 |
-
|
1133 |
-
|
|
|
|
|
1134 |
}
|
1135 |
|
1136 |
if ( ! empty( $input['has_archive'] ) )
|
@@ -1163,14 +775,11 @@ class Testimonials_Widget_Settings {
|
|
1163 |
|
1164 |
$input['version'] = self::$version;
|
1165 |
$input['donate_version'] = Testimonials_Widget::VERSION;
|
1166 |
-
$input = apply_filters( 'testimonials_widget_validate_settings', $input, $errors );
|
1167 |
-
|
1168 |
-
unset( $input['export'] );
|
1169 |
-
unset( $input['import'] );
|
1170 |
|
1171 |
-
|
|
|
1172 |
$validated = $input;
|
1173 |
-
|
1174 |
$validated = array(
|
1175 |
'input' => $input,
|
1176 |
'errors' => $errors,
|
@@ -1209,7 +818,7 @@ class Testimonials_Widget_Settings {
|
|
1209 |
* @SuppressWarnings(PHPMD.LongVariable)
|
1210 |
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
1211 |
*/
|
1212 |
-
public function is_bad_hierarchical_slug( $is_bad_hierarchical_slug, $slug, $post_type, $post_parent ) {
|
1213 |
// This post has no parent and is a "base" post
|
1214 |
if ( ! $post_parent && self::is_cpt_slug( $slug ) )
|
1215 |
return true;
|
@@ -1223,7 +832,7 @@ class Testimonials_Widget_Settings {
|
|
1223 |
*
|
1224 |
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
1225 |
*/
|
1226 |
-
public function is_bad_flat_slug( $is_bad_flat_slug, $slug, $post_type ) {
|
1227 |
if ( self::is_cpt_slug( $slug ) )
|
1228 |
return true;
|
1229 |
|
@@ -1239,161 +848,19 @@ class Testimonials_Widget_Settings {
|
|
1239 |
}
|
1240 |
|
1241 |
|
1242 |
-
public static function
|
1243 |
-
switch ( $validate ) {
|
1244 |
-
case 'absint':
|
1245 |
-
case 'intval':
|
1246 |
-
if ( '' !== $input[ $id ] )
|
1247 |
-
$input[ $id ] = $validate( $input[ $id ] );
|
1248 |
-
else
|
1249 |
-
$input[ $id ] = $default;
|
1250 |
-
break;
|
1251 |
-
|
1252 |
-
case 'ids':
|
1253 |
-
$input[ $id ] = self::validate_ids( $input[ $id ], $default );
|
1254 |
-
break;
|
1255 |
-
|
1256 |
-
case 'min1':
|
1257 |
-
$input[ $id ] = intval( $input[ $id ] );
|
1258 |
-
if ( 0 >= $input[ $id ] )
|
1259 |
-
$input[ $id ] = $default;
|
1260 |
-
break;
|
1261 |
-
|
1262 |
-
case 'nozero':
|
1263 |
-
$input[ $id ] = intval( $input[ $id ] );
|
1264 |
-
if ( 0 === $input[ $id ] )
|
1265 |
-
$input[ $id ] = $default;
|
1266 |
-
break;
|
1267 |
-
|
1268 |
-
case 'order':
|
1269 |
-
$input[ $id ] = self::validate_order( $input[ $id ], $default );
|
1270 |
-
break;
|
1271 |
-
|
1272 |
-
case 'required':
|
1273 |
-
if ( empty( $input[ $id ] ) )
|
1274 |
-
$errors[ $id ] = esc_html__( 'Required', 'testimonials-widget' );
|
1275 |
-
break;
|
1276 |
-
|
1277 |
-
case 'slug':
|
1278 |
-
$input[ $id ] = self::validate_slug( $input[ $id ], $default );
|
1279 |
-
$input[ $id ] = strtolower( $input[ $id ] );
|
1280 |
-
break;
|
1281 |
-
|
1282 |
-
case 'slugs':
|
1283 |
-
$input[ $id ] = self::validate_slugs( $input[ $id ], $default );
|
1284 |
-
$input[ $id ] = strtolower( $input[ $id ] );
|
1285 |
-
break;
|
1286 |
-
|
1287 |
-
case 'term':
|
1288 |
-
$input[ $id ] = self::validate_term( $input[ $id ], $default );
|
1289 |
-
break;
|
1290 |
-
|
1291 |
-
case 'terms':
|
1292 |
-
$input[ $id ] = self::validate_terms( $input[ $id ], $default );
|
1293 |
-
break;
|
1294 |
-
|
1295 |
-
case 'url':
|
1296 |
-
$input[ $id ] = self::validate_url( $input[ $id ], $default );
|
1297 |
-
break;
|
1298 |
-
|
1299 |
-
case 'is_true':
|
1300 |
-
$input[ $id ] = self::is_true( $input[ $id ] );
|
1301 |
-
break;
|
1302 |
-
|
1303 |
-
default:
|
1304 |
-
$input[ $id ] = $validate( $input[ $id ] );
|
1305 |
-
break;
|
1306 |
-
}
|
1307 |
-
}
|
1308 |
-
|
1309 |
-
|
1310 |
-
public static function validate_ids( $input, $default ) {
|
1311 |
-
if ( preg_match( '#^\d+(,\s?\d+)*$#', $input ) )
|
1312 |
-
return preg_replace( '#\s#', '', $input );
|
1313 |
-
|
1314 |
-
return $default;
|
1315 |
-
}
|
1316 |
-
|
1317 |
-
|
1318 |
-
public static function validate_order( $input, $default ) {
|
1319 |
-
if ( preg_match( '#^desc|asc$#i', $input ) )
|
1320 |
-
return $input;
|
1321 |
-
|
1322 |
-
return $default;
|
1323 |
-
}
|
1324 |
-
|
1325 |
-
|
1326 |
-
public static function validate_slugs( $input, $default ) {
|
1327 |
-
if ( preg_match( '#^[\w-]+(,\s?[\w-]+)*$#', $input ) )
|
1328 |
-
return preg_replace( '#\s#', '', $input );
|
1329 |
-
|
1330 |
-
return $default;
|
1331 |
-
}
|
1332 |
-
|
1333 |
-
|
1334 |
-
public static function validate_slug( $input, $default ) {
|
1335 |
-
if ( preg_match( '#^[\w-]+$#', $input ) )
|
1336 |
-
return $input;
|
1337 |
-
|
1338 |
-
return $default;
|
1339 |
-
}
|
1340 |
-
|
1341 |
-
|
1342 |
-
public static function validate_term( $input, $default ) {
|
1343 |
-
if ( preg_match( '#^\w+$#', $input ) )
|
1344 |
-
return $input;
|
1345 |
-
|
1346 |
-
return $default;
|
1347 |
-
}
|
1348 |
-
|
1349 |
-
|
1350 |
-
public static function validate_terms( $input, $default ) {
|
1351 |
-
if ( preg_match( '#^(([\w- ]+)(,\s?)?)+$#', $input ) )
|
1352 |
-
return preg_replace( '#,\s*$#', '', $input );
|
1353 |
-
|
1354 |
-
return $default;
|
1355 |
-
}
|
1356 |
-
|
1357 |
-
|
1358 |
-
public static function validate_url( $input, $default ) {
|
1359 |
-
if ( filter_var( $input, FILTER_VALIDATE_URL ) )
|
1360 |
-
return $input;
|
1361 |
-
|
1362 |
-
return $default;
|
1363 |
-
}
|
1364 |
-
|
1365 |
-
|
1366 |
-
/**
|
1367 |
-
* Let values like "true, 'true', 1, and 'yes'" to be true. Else, false
|
1368 |
-
*/
|
1369 |
-
public static function is_true( $value = null, $return_boolean = true ) {
|
1370 |
-
if ( true === $value || 'true' == strtolower( $value ) || 1 == $value || 'yes' == strtolower( $value ) ) {
|
1371 |
-
if ( $return_boolean )
|
1372 |
-
return true;
|
1373 |
-
else
|
1374 |
-
return 1;
|
1375 |
-
} else {
|
1376 |
-
if ( $return_boolean )
|
1377 |
-
return false;
|
1378 |
-
else
|
1379 |
-
return 0;
|
1380 |
-
}
|
1381 |
-
}
|
1382 |
-
|
1383 |
-
|
1384 |
-
public function settings_add_help_tabs() {
|
1385 |
$screen = get_current_screen();
|
1386 |
if ( self::$admin_page != $screen->id )
|
1387 |
return;
|
1388 |
|
1389 |
$screen->set_help_sidebar(
|
1390 |
'<p>' .
|
1391 |
-
esc_html__( 'These Testimonials
|
1392 |
'</p><p>' .
|
1393 |
esc_html__( 'Shortcode option names are listed below each entry.', 'testimonials-widget' ) .
|
1394 |
'</p><p>' .
|
1395 |
sprintf(
|
1396 |
-
__( 'View the <a href="%s">Testimonials
|
1397 |
esc_url( 'http://wordpress.org/plugins/testimonials-widget/' )
|
1398 |
) .
|
1399 |
'</p>'
|
17 |
*/
|
18 |
|
19 |
/**
|
20 |
+
* Testimonials settings class
|
21 |
*
|
22 |
* Based upon http://alisothegeek.com/2011/01/wordpress-settings-api-tutorial-1/
|
23 |
*/
|
24 |
|
25 |
|
26 |
+
require_once TW_PLUGIN_DIR_LIB . '/aihrus/class-aihrus-settings.php';
|
|
|
27 |
|
28 |
+
|
29 |
+
class Testimonials_Widget_Settings extends Aihrus_Settings {
|
30 |
+
const ID = 'testimonialswidget_settings';
|
31 |
+
const ITEM_NAME = 'Testimonials Settings';
|
32 |
+
|
33 |
+
public static $admin_page = '';
|
34 |
+
public static $class = __CLASS__;
|
35 |
+
public static $defaults = array();
|
36 |
+
public static $plugin_path = array();
|
37 |
+
public static $plugin_url = 'http://wordpress.org/plugins/testimonials-widget/';
|
38 |
+
public static $sections = array();
|
39 |
+
public static $settings = array();
|
40 |
+
public static $suggest_id = 0;
|
41 |
+
public static $version;
|
42 |
+
|
43 |
+
public static $default = array(
|
44 |
'backwards' => array(
|
45 |
+
'version' => null, // below this version number, use std
|
46 |
+
'std' => null,
|
47 |
),
|
48 |
'choices' => array(), // key => value
|
49 |
+
'class' => null, // warning, etc.
|
50 |
+
'desc' => null,
|
51 |
+
'id' => null,
|
52 |
'section' => 'general',
|
53 |
+
'show_code' => true,
|
54 |
+
'std' => null, // default key or value
|
55 |
'suggest' => false, // attempt for auto-suggest on inputs
|
56 |
+
'title' => null,
|
57 |
'type' => 'text', // textarea, checkbox, radio, select, hidden, heading, password, expand_begin, expand_end
|
58 |
+
'validate' => null, // required, term, slug, slugs, ids, order, single paramater PHP functions
|
59 |
'widget' => 1, // show in widget options, 0 off
|
60 |
);
|
61 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
public function __construct() {
|
63 |
+
add_action( 'admin_init', array( __CLASS__, 'admin_init' ) );
|
64 |
+
add_action( 'admin_menu', array( __CLASS__, 'admin_menu' ) );
|
65 |
+
add_action( 'init', array( __CLASS__, 'init' ) );
|
66 |
}
|
67 |
|
68 |
|
69 |
+
public static function admin_init() {
|
70 |
+
add_filter( 'wp_unique_post_slug_is_bad_hierarchical_slug', array( __CLASS__, 'is_bad_hierarchical_slug' ), 10, 4 );
|
71 |
+
add_filter( 'wp_unique_post_slug_is_bad_flat_slug', array( __CLASS__, 'is_bad_flat_slug' ), 10, 3 );
|
72 |
|
73 |
$version = tw_get_option( 'version' );
|
74 |
self::$version = Testimonials_Widget::VERSION;
|
75 |
self::$version = apply_filters( 'testimonials_widget_version', self::$version );
|
76 |
|
77 |
if ( $version != self::$version )
|
78 |
+
self::initialize_settings();
|
79 |
|
80 |
+
if ( ! Testimonials_Widget::do_load() )
|
81 |
return;
|
82 |
|
83 |
+
self::load_options();
|
84 |
+
self::register_settings();
|
|
|
|
|
85 |
}
|
86 |
|
87 |
|
88 |
+
public static function admin_menu() {
|
89 |
+
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' ) );
|
90 |
|
91 |
+
add_action( 'admin_print_scripts-' . self::$admin_page, array( __CLASS__, 'scripts' ) );
|
92 |
+
add_action( 'admin_print_styles-' . self::$admin_page, array( __CLASS__, 'styles' ) );
|
93 |
+
add_action( 'load-' . self::$admin_page, array( __CLASS__, 'settings_add_help_tabs' ) );
|
94 |
}
|
95 |
|
96 |
|
97 |
+
public static function init() {
|
98 |
+
load_plugin_textdomain( 'testimonials-widget', false, '/testimonials-widget/languages/' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
|
100 |
+
self::$plugin_path = plugins_url( '', dirname( __FILE__ ) );
|
101 |
}
|
102 |
|
103 |
|
107 |
self::$sections['ordering'] = esc_html__( 'Ordering', 'testimonials-widget' );
|
108 |
self::$sections['widget'] = esc_html__( 'Widget', 'testimonials-widget' );
|
109 |
self::$sections['post_type'] = esc_html__( 'Post Type', 'testimonials-widget' );
|
110 |
+
|
111 |
+
parent::sections();
|
112 |
|
113 |
self::$sections = apply_filters( 'testimonials_widget_sections', self::$sections );
|
114 |
}
|
150 |
'validate' => 'absint',
|
151 |
);
|
152 |
|
153 |
+
self::$settings['widget_expand_all'] = array(
|
154 |
+
'section' => 'widget',
|
155 |
+
'type' => 'expand_all',
|
156 |
+
);
|
157 |
+
|
158 |
self::$settings['widget_expand_begin'] = array(
|
159 |
'section' => 'widget',
|
160 |
'desc' => esc_html__( 'Additional Widget Options', 'testimonials-widget' ),
|
478 |
self::$settings['allow_comments'] = array(
|
479 |
'section' => 'post_type',
|
480 |
'title' => esc_html__( 'Allow Comments?', 'testimonials-widget' ),
|
481 |
+
'desc' => esc_html__( 'Only affects the Testimonials post edit page. Your theme controls the front-end view.', 'testimonials-widget' ),
|
482 |
'type' => 'checkbox',
|
483 |
'validate' => 'is_true',
|
484 |
'widget' => 0,
|
511 |
// Reset
|
512 |
self::$settings['reset_expand_begin'] = array(
|
513 |
'section' => 'reset',
|
514 |
+
'desc' => esc_html__( 'Reset & Compatiblity Options', 'testimonials-widget' ),
|
515 |
'type' => 'expand_begin',
|
516 |
);
|
517 |
|
520 |
'title' => esc_html__( 'Don\'t Use Default Taxonomies?', 'testimonials-widget' ),
|
521 |
'type' => 'checkbox',
|
522 |
'validate' => 'is_true',
|
523 |
+
'desc' => esc_html__( 'If checked, use Testimonials\' own category and tag taxonomies instead', 'testimonials-widget' ),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
524 |
'widget' => 0,
|
525 |
);
|
526 |
|
527 |
+
parent::settings();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
528 |
|
529 |
self::$settings['version_options_heading'] = array(
|
530 |
'section' => 'reset',
|
535 |
self::$settings['use_bxslider'] = array(
|
536 |
'section' => 'reset',
|
537 |
'title' => esc_html__( 'Use bxSlider?', 'testimonials-widget' ),
|
538 |
+
'desc' => esc_html__( 'Pre 2.15.0, Testimonials\' used custom JavaScript for transitions.', 'testimonials-widget' ),
|
539 |
'type' => 'checkbox',
|
540 |
'validate' => 'is_true',
|
541 |
'backwards' => array(
|
594 |
self::$settings['force_css_loading'] = array(
|
595 |
'section' => 'reset',
|
596 |
'title' => esc_html__( 'Always Load CSS?', 'testimonials-widget' ),
|
597 |
+
'desc' => esc_html__( 'Pre 2.14.0, Testimonials\' CSS was always loaded, whether needed or not', 'testimonials-widget' ),
|
598 |
'type' => 'checkbox',
|
599 |
'validate' => 'is_true',
|
600 |
'backwards' => array(
|
631 |
self::$settings['remove_hentry'] = array(
|
632 |
'section' => 'reset',
|
633 |
'title' => esc_html__( 'Remove `.hentry` CSS?', 'testimonials-widget' ),
|
634 |
+
'desc' => esc_html__( 'Pre 2.6.4, some themes use class `.hentry` in a manner that breaks Testimonials\' CSS', 'testimonials-widget' ),
|
635 |
'type' => 'checkbox',
|
636 |
'validate' => 'is_true',
|
637 |
'backwards' => array(
|
647 |
|
648 |
self::$settings = apply_filters( 'testimonials_widget_settings', self::$settings );
|
649 |
|
650 |
+
foreach ( self::$settings as $id => $parts )
|
651 |
self::$settings[ $id ] = wp_parse_args( $parts, self::$default );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
652 |
}
|
653 |
|
654 |
|
655 |
+
public static function get_defaults( $mode = null, $old_version = null ) {
|
656 |
+
$old_version = tw_get_option( 'version' );
|
|
|
657 |
|
658 |
+
return parent::get_defaults( $mode, $old_version );
|
659 |
}
|
660 |
|
661 |
|
662 |
+
public static function display_page( $disable_donate = false ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
663 |
$disable_donate = tw_get_option( 'disable_donate' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
664 |
|
665 |
+
parent::display_page( $disable_donate );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
666 |
}
|
667 |
|
668 |
|
673 |
*/
|
674 |
public static function display_setting( $args = array(), $do_echo = true, $input = null ) {
|
675 |
$content = '';
|
676 |
+
switch ( $args['type'] ) {
|
677 |
+
case 'text':
|
678 |
+
extract( $args );
|
679 |
|
680 |
+
if ( is_null( $input ) )
|
681 |
+
$options = get_option( self::ID );
|
682 |
+
else {
|
683 |
+
$options = array();
|
684 |
+
$options[$id] = $input;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
685 |
}
|
686 |
|
687 |
+
if ( ! isset( $options[$id] ) )
|
688 |
+
$options[$id] = $std;
|
689 |
|
690 |
+
$field_class = '';
|
691 |
+
if ( ! empty( $class ) )
|
692 |
+
$field_class = ' ' . $class;
|
693 |
|
694 |
+
$field_class = esc_attr( $field_class );
|
|
|
695 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
696 |
$suggest_id = 'suggest_' . self::$suggest_id++;
|
697 |
|
698 |
$content .= '<input class="regular-text' . $field_class . ' ' . $suggest_id . '" type="text" id="' . $id . '" name="' . self::ID . '[' . $id . ']" placeholder="' . $std . '" value="' . $options[$id] . '" />';
|
699 |
|
700 |
+
if ( ! empty( $suggest ) )
|
701 |
$content .= self::get_suggest( $id, $suggest_id );
|
702 |
|
703 |
if ( ! empty( $desc ) )
|
704 |
$content .= '<br /><span class="description">' . $desc . '</span>';
|
705 |
|
706 |
+
if ( $show_code )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
707 |
$content .= '<br /><code>' . $id . '</code>';
|
708 |
break;
|
709 |
|
710 |
default:
|
711 |
+
$content = apply_filters( 'testimonials_widget_display_setting', $content, $args, $input );
|
712 |
break;
|
713 |
}
|
714 |
|
715 |
+
if ( empty( $content ) )
|
716 |
+
$content = parent::display_setting( $args, false, $input );
|
717 |
+
|
718 |
if ( ! $do_echo )
|
719 |
return $content;
|
720 |
|
722 |
}
|
723 |
|
724 |
|
725 |
+
public static function initialize_settings( $version = null ) {
|
726 |
+
$version = tw_get_option( 'version', self::$version );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
727 |
|
728 |
+
parent::initialize_settings( $version );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
729 |
}
|
730 |
|
731 |
|
735 |
* @SuppressWarnings(PHPMD.Superglobals)
|
736 |
*/
|
737 |
public static function validate_settings( $input, $options = null, $do_errors = false ) {
|
738 |
+
$validated = parent::validate_settings( $input, $options, $do_errors );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
739 |
|
740 |
+
if ( empty( $do_errors ) ) {
|
741 |
+
$input = $validated;
|
742 |
+
$errors = array();
|
743 |
+
} else {
|
744 |
+
$input = $validated['input'];
|
745 |
+
$errors = $validated['errors'];
|
746 |
}
|
747 |
|
748 |
if ( ! empty( $input['has_archive'] ) )
|
775 |
|
776 |
$input['version'] = self::$version;
|
777 |
$input['donate_version'] = Testimonials_Widget::VERSION;
|
|
|
|
|
|
|
|
|
778 |
|
779 |
+
$input = apply_filters( 'testimonials_widget_validate_settings', $input, $errors );
|
780 |
+
if ( empty( $do_errors ) )
|
781 |
$validated = $input;
|
782 |
+
else {
|
783 |
$validated = array(
|
784 |
'input' => $input,
|
785 |
'errors' => $errors,
|
818 |
* @SuppressWarnings(PHPMD.LongVariable)
|
819 |
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
820 |
*/
|
821 |
+
public static function is_bad_hierarchical_slug( $is_bad_hierarchical_slug, $slug, $post_type, $post_parent ) {
|
822 |
// This post has no parent and is a "base" post
|
823 |
if ( ! $post_parent && self::is_cpt_slug( $slug ) )
|
824 |
return true;
|
832 |
*
|
833 |
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
834 |
*/
|
835 |
+
public static function is_bad_flat_slug( $is_bad_flat_slug, $slug, $post_type ) {
|
836 |
if ( self::is_cpt_slug( $slug ) )
|
837 |
return true;
|
838 |
|
848 |
}
|
849 |
|
850 |
|
851 |
+
public static function settings_add_help_tabs() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
852 |
$screen = get_current_screen();
|
853 |
if ( self::$admin_page != $screen->id )
|
854 |
return;
|
855 |
|
856 |
$screen->set_help_sidebar(
|
857 |
'<p>' .
|
858 |
+
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' ) .
|
859 |
'</p><p>' .
|
860 |
esc_html__( 'Shortcode option names are listed below each entry.', 'testimonials-widget' ) .
|
861 |
'</p><p>' .
|
862 |
sprintf(
|
863 |
+
__( 'View the <a href="%s">Testimonials documentation</a>.', 'testimonials-widget' ),
|
864 |
esc_url( 'http://wordpress.org/plugins/testimonials-widget/' )
|
865 |
) .
|
866 |
'</p>'
|
lib/class-testimonials-widget-widget.php
CHANGED
@@ -16,127 +16,49 @@
|
|
16 |
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
17 |
*/
|
18 |
|
19 |
-
|
|
|
|
|
|
|
20 |
const ID = 'testimonials_widget';
|
21 |
|
22 |
-
public function __construct() {
|
23 |
-
|
24 |
-
$
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
// Widget control settings
|
30 |
-
$control_ops = array(
|
31 |
-
'id_base' => self::ID,
|
32 |
-
);
|
33 |
-
|
34 |
-
// Create the widget
|
35 |
-
$this->WP_Widget(
|
36 |
-
self::ID,
|
37 |
-
esc_html__( 'Testimonials Widget', 'testimonials-widget' ),
|
38 |
-
$widget_ops,
|
39 |
-
$control_ops
|
40 |
-
);
|
41 |
}
|
42 |
|
43 |
|
44 |
-
public function get_testimonials_css() {
|
45 |
Testimonials_Widget::get_testimonials_css();
|
46 |
}
|
47 |
|
48 |
|
49 |
-
public function get_testimonials_scripts() {
|
50 |
Testimonials_Widget::get_testimonials_scripts();
|
51 |
}
|
52 |
|
53 |
|
54 |
-
public function
|
55 |
-
|
56 |
-
|
57 |
-
$args = wp_parse_args( $args, Testimonials_Widget::get_defaults() );
|
58 |
-
extract( $args );
|
59 |
-
|
60 |
-
// Our variables from the widget settings
|
61 |
-
$title = apply_filters( 'widget_title', $instance['title'], null );
|
62 |
-
|
63 |
-
$testimonials = Testimonials_Widget::testimonialswidget_widget( $instance, $this->number );
|
64 |
-
|
65 |
-
// Before widget (defined by themes)
|
66 |
-
echo $before_widget;
|
67 |
-
|
68 |
-
// Display the widget title if one was input (before and after defined by themes)
|
69 |
-
if ( ! empty( $title ) ) {
|
70 |
-
if ( ! empty( $instance['title_link'] ) ) {
|
71 |
-
// revise title with title_link link creation
|
72 |
-
$title_link = $instance['title_link'];
|
73 |
-
|
74 |
-
if ( preg_match( '#^\d+$#', $title_link ) ) {
|
75 |
-
$new_title = '<a href="';
|
76 |
-
$new_title .= get_permalink( $title_link );
|
77 |
-
$new_title .= '" title="';
|
78 |
-
$new_title .= get_the_title( $title_link );
|
79 |
-
$new_title .= '">';
|
80 |
-
$new_title .= $title;
|
81 |
-
$new_title .= '</a>';
|
82 |
-
|
83 |
-
$title = $new_title;
|
84 |
-
} else {
|
85 |
-
$do_http = true;
|
86 |
-
|
87 |
-
if ( 0 === strpos( $title_link, '/' ) )
|
88 |
-
$do_http = false;
|
89 |
-
|
90 |
-
if ( $do_http && 0 === preg_match( '#https?://#', $title_link ) ) {
|
91 |
-
$title_link = 'http://' . $title_link;
|
92 |
-
}
|
93 |
-
|
94 |
-
$new_title = '<a href="';
|
95 |
-
$new_title .= $title_link;
|
96 |
-
$new_title .= '" title="';
|
97 |
-
$new_title .= $title;
|
98 |
-
$new_title .= '"';
|
99 |
-
|
100 |
-
$new_title .= '>';
|
101 |
-
$new_title .= $title;
|
102 |
-
$new_title .= '</a>';
|
103 |
-
|
104 |
-
$title = $new_title;
|
105 |
-
|
106 |
-
if ( ! empty( $instance['target'] ) )
|
107 |
-
$title = links_add_target( $title, $instance['target'] );
|
108 |
-
}
|
109 |
-
}
|
110 |
-
|
111 |
-
echo $before_title . $title . $after_title;
|
112 |
-
}
|
113 |
-
|
114 |
-
// Display Widget
|
115 |
-
echo $testimonials;
|
116 |
-
|
117 |
-
// After widget (defined by themes)
|
118 |
-
echo $after_widget;
|
119 |
}
|
120 |
|
121 |
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
126 |
-
*/
|
127 |
-
|
128 |
|
129 |
-
public function update( $new_instance, $old_instance ) {
|
130 |
-
$instance = Testimonials_Widget_Settings::validate_settings( $new_instance );
|
131 |
|
132 |
-
|
|
|
133 |
}
|
134 |
|
135 |
|
136 |
-
public function
|
137 |
-
$defaults = Testimonials_Widget::get_defaults();
|
138 |
$do_number = true;
|
139 |
-
|
140 |
if ( empty( $instance ) ) {
|
141 |
$do_number = false;
|
142 |
|
@@ -146,15 +68,30 @@ class Testimonials_Widget_Widget extends WP_Widget {
|
|
146 |
if ( empty( $defaults['random'] ) )
|
147 |
$defaults['random'] = 1;
|
148 |
|
|
|
|
|
149 |
$instance = array();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
150 |
}
|
151 |
|
152 |
-
$instance
|
|
|
|
|
|
|
|
|
|
|
|
|
153 |
$form_parts = Testimonials_Widget_Settings::get_settings();
|
154 |
|
155 |
-
if ( $do_number ) {
|
156 |
-
$
|
157 |
-
$std = ' .' . Testimonials_Widget::ID . $number;
|
158 |
|
159 |
$form_parts['css_class'] = array(
|
160 |
'section' => 'widget',
|
@@ -168,144 +105,20 @@ class Testimonials_Widget_Widget extends WP_Widget {
|
|
168 |
|
169 |
$form_parts = self::widget_options( $form_parts );
|
170 |
|
171 |
-
|
172 |
-
$part[ 'id' ] = $key;
|
173 |
-
$this->display_setting( $part, $instance );
|
174 |
-
}
|
175 |
}
|
176 |
|
177 |
|
178 |
public static function widget_options( $options ) {
|
179 |
-
|
180 |
-
// remove non-widget parts
|
181 |
-
if ( empty( $parts['widget'] ) )
|
182 |
-
unset( $options[ $id ] );
|
183 |
-
}
|
184 |
-
|
185 |
$options = apply_filters( 'testimonials_widget_widget_options', $options );
|
186 |
|
187 |
return $options;
|
188 |
}
|
189 |
|
190 |
|
191 |
-
|
192 |
-
|
193 |
-
*
|
194 |
-
* @SuppressWarnings(PHPMD.UnusedLocalVariable)
|
195 |
-
*/
|
196 |
-
public function display_setting( $args = array(), $options ) {
|
197 |
-
extract( $args );
|
198 |
-
|
199 |
-
$do_return = false;
|
200 |
-
switch ( $type ) {
|
201 |
-
case 'heading':
|
202 |
-
if ( ! empty( $desc ) )
|
203 |
-
echo '<h3>' . $desc . '</h3>';
|
204 |
-
|
205 |
-
$do_return = true;
|
206 |
-
break;
|
207 |
-
|
208 |
-
case 'expand_begin':
|
209 |
-
if ( ! empty( $desc ) )
|
210 |
-
echo '<h3>' . $desc . '</h3>';
|
211 |
-
|
212 |
-
echo '<a id="' . $this->get_field_id( $id ) . '" style="cursor:pointer;" onclick="jQuery( \'div#' . $this->get_field_id( $id ) . '\' ) . slideToggle();">' . esc_html__( 'Expand/Collapse', 'testimonials-widget' ) . ' »</a>';
|
213 |
-
echo '<div id="' . $this->get_field_id( $id ) . '" style="display:none">';
|
214 |
-
|
215 |
-
$do_return = true;
|
216 |
-
break;
|
217 |
-
|
218 |
-
case 'expand_end':
|
219 |
-
echo '</div>';
|
220 |
-
|
221 |
-
$do_return = true;
|
222 |
-
break;
|
223 |
-
|
224 |
-
default:
|
225 |
-
break;
|
226 |
-
}
|
227 |
-
|
228 |
-
if ( $do_return )
|
229 |
-
return;
|
230 |
-
|
231 |
-
if ( ! isset( $options[$id] ) && $type != 'checkbox' )
|
232 |
-
$options[$id] = $std;
|
233 |
-
elseif ( ! isset( $options[$id] ) )
|
234 |
-
$options[$id] = 0;
|
235 |
-
|
236 |
-
$field_class = '';
|
237 |
-
if ( ! empty( $class ) )
|
238 |
-
$field_class = ' ' . $class;
|
239 |
-
|
240 |
-
echo '<p>';
|
241 |
-
|
242 |
-
switch ( $type ) {
|
243 |
-
case 'checkbox':
|
244 |
-
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 ) . ' /> ';
|
245 |
-
|
246 |
-
echo '<label for="' . $this->get_field_id( $id ) . '">' . $title . '</label>';
|
247 |
-
break;
|
248 |
-
|
249 |
-
case 'select':
|
250 |
-
echo '<label for="' . $this->get_field_id( $id ) . '">' . $title . '</label>';
|
251 |
-
echo '<select id="' . $this->get_field_id( $id ) . '"class="select' . $field_class . '" name="' . $this->get_field_name( $id ) . '">';
|
252 |
-
|
253 |
-
foreach ( $choices as $value => $label )
|
254 |
-
echo '<option value="' . esc_attr( $value ) . '"' . selected( $options[$id], $value, false ) . '>' . $label . '</option>';
|
255 |
-
|
256 |
-
echo '</select>';
|
257 |
-
break;
|
258 |
-
|
259 |
-
case 'radio':
|
260 |
-
$i = 0;
|
261 |
-
$count_options = count( $options ) - 1;
|
262 |
-
|
263 |
-
foreach ( $choices as $value => $label ) {
|
264 |
-
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>';
|
265 |
-
if ( $i < $count_options )
|
266 |
-
echo '<br />';
|
267 |
-
$i++;
|
268 |
-
}
|
269 |
-
|
270 |
-
echo '<label for="' . $this->get_field_id( $id ) . '">' . $title . '</label>';
|
271 |
-
break;
|
272 |
-
|
273 |
-
case 'textarea':
|
274 |
-
echo '<label for="' . $this->get_field_id( $id ) . '">' . $title . '</label>';
|
275 |
-
|
276 |
-
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>';
|
277 |
-
break;
|
278 |
-
|
279 |
-
case 'password':
|
280 |
-
echo '<label for="' . $this->get_field_id( $id ) . '">' . $title . '</label>';
|
281 |
-
|
282 |
-
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] ) . '" />';
|
283 |
-
break;
|
284 |
-
|
285 |
-
case 'readonly':
|
286 |
-
echo '<label for="' . $this->get_field_id( $id ) . '">' . $title . '</label>';
|
287 |
-
|
288 |
-
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" />';
|
289 |
-
break;
|
290 |
-
|
291 |
-
case 'text':
|
292 |
-
echo '<label for="' . $this->get_field_id( $id ) . '">' . $title . '</label>';
|
293 |
-
|
294 |
-
$suggest_id = 'suggest_' . Testimonials_Widget_Settings::$suggest_id++;
|
295 |
-
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] ) . '" />';
|
296 |
-
|
297 |
-
if ( $suggest )
|
298 |
-
echo Testimonials_Widget_Settings::get_suggest( $id, $suggest_id );
|
299 |
-
break;
|
300 |
-
|
301 |
-
default:
|
302 |
-
break;
|
303 |
-
}
|
304 |
-
|
305 |
-
if ( ! empty( $desc ) )
|
306 |
-
echo '<br /><span class="setting-description"><small>' . $desc . '</small></span>';
|
307 |
-
|
308 |
-
echo '</p>';
|
309 |
}
|
310 |
|
311 |
|
16 |
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
17 |
*/
|
18 |
|
19 |
+
require_once TW_PLUGIN_DIR_LIB . '/aihrus/class-aihrus-widget.php';
|
20 |
+
|
21 |
+
|
22 |
+
class Testimonials_Widget_Widget extends Aihrus_Widget {
|
23 |
const ID = 'testimonials_widget';
|
24 |
|
25 |
+
public function __construct( $classname = null, $description = null, $id_base = null, $title = null ) {
|
26 |
+
$classname = 'Testimonials_Widget_Widget';
|
27 |
+
$description = esc_html__( 'Display testimonials with multiple selection and display options', 'testimonials-widget' );
|
28 |
+
$id_base = self::ID;
|
29 |
+
$title = esc_html__( 'Testimonials', 'testimonials-widget' );
|
30 |
+
|
31 |
+
parent::__construct( $classname, $description, $id_base, $title );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
}
|
33 |
|
34 |
|
35 |
+
public static function get_testimonials_css() {
|
36 |
Testimonials_Widget::get_testimonials_css();
|
37 |
}
|
38 |
|
39 |
|
40 |
+
public static function get_testimonials_scripts() {
|
41 |
Testimonials_Widget::get_testimonials_scripts();
|
42 |
}
|
43 |
|
44 |
|
45 |
+
public static function get_defaults() {
|
46 |
+
return Testimonials_Widget::get_defaults();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
}
|
48 |
|
49 |
|
50 |
+
public static function get_content( $instance, $widget_number ) {
|
51 |
+
return Testimonials_Widget::testimonialswidget_widget( $instance, $widget_number );
|
52 |
+
}
|
|
|
|
|
|
|
53 |
|
|
|
|
|
54 |
|
55 |
+
public static function validate_settings( $instance ) {
|
56 |
+
return Testimonials_Widget_Settings::validate_settings( $instance );
|
57 |
}
|
58 |
|
59 |
|
60 |
+
public static function form_instance( $instance ) {
|
|
|
61 |
$do_number = true;
|
|
|
62 |
if ( empty( $instance ) ) {
|
63 |
$do_number = false;
|
64 |
|
68 |
if ( empty( $defaults['random'] ) )
|
69 |
$defaults['random'] = 1;
|
70 |
|
71 |
+
$defaults['enable_schema'] = 0;
|
72 |
+
|
73 |
$instance = array();
|
74 |
+
} elseif ( ! empty( $instance['resetted'] ) ) {
|
75 |
+
if ( empty( $instance['char_limit'] ) )
|
76 |
+
$instance['char_limit'] = 500;
|
77 |
+
|
78 |
+
if ( empty( $instance['random'] ) )
|
79 |
+
$instance['random'] = 1;
|
80 |
+
|
81 |
+
$instance['enable_schema'] = 0;
|
82 |
}
|
83 |
|
84 |
+
$instance['do_number'] = $do_number;
|
85 |
+
|
86 |
+
return $instance;
|
87 |
+
}
|
88 |
+
|
89 |
+
|
90 |
+
public static function form_parts( $instance, $number ) {
|
91 |
$form_parts = Testimonials_Widget_Settings::get_settings();
|
92 |
|
93 |
+
if ( ! empty( $instance['do_number'] ) ) {
|
94 |
+
$std = ' .' . Testimonials_Widget::ID . $number;
|
|
|
95 |
|
96 |
$form_parts['css_class'] = array(
|
97 |
'section' => 'widget',
|
105 |
|
106 |
$form_parts = self::widget_options( $form_parts );
|
107 |
|
108 |
+
return $form_parts;
|
|
|
|
|
|
|
109 |
}
|
110 |
|
111 |
|
112 |
public static function widget_options( $options ) {
|
113 |
+
$options = parent::widget_options( $options );
|
|
|
|
|
|
|
|
|
|
|
114 |
$options = apply_filters( 'testimonials_widget_widget_options', $options );
|
115 |
|
116 |
return $options;
|
117 |
}
|
118 |
|
119 |
|
120 |
+
public static function get_suggest( $id, $suggest_id ) {
|
121 |
+
return Testimonials_Widget_Settings::get_suggest( $id, $suggest_id );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
122 |
}
|
123 |
|
124 |
|
readme.txt
CHANGED
@@ -1,27 +1,27 @@
|
|
1 |
-
=== Testimonials
|
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.8.0
|
8 |
-
Stable tag: 2.
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
12 |
-
Testimonials
|
13 |
|
14 |
|
15 |
== Description ==
|
16 |
|
17 |
-
Testimonials
|
18 |
|
19 |
[youtube http://www.youtube.com/watch?v=bhUhuQ-2m8s]
|
20 |
**[Video introduction](http://youtu.be/bhUhuQ-2m8s)**
|
21 |
|
22 |
-
**View a [Live Testimonials
|
23 |
|
24 |
-
=
|
25 |
|
26 |
* Slide Images - responsive image slideshow
|
27 |
* Slide Videos - video slideshow
|
@@ -34,13 +34,13 @@ Testimonials Widget plugin allows you to display random or selected portfolio, q
|
|
34 |
* Fade and slide transitions
|
35 |
* Filter slideshow content by WordPress' built in categories, tags, or post-ID
|
36 |
|
37 |
-
More than one Testimonials
|
38 |
|
39 |
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.
|
40 |
|
41 |
-
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
|
42 |
|
43 |
-
The single testimonial view supports image, source, title, location, email, company and URL details.
|
44 |
|
45 |
= Primary Features =
|
46 |
|
@@ -48,6 +48,7 @@ The single testimonial view supports image, source, title, location, email, comp
|
|
48 |
* Admin interface to add, edit and manage testimonials
|
49 |
* Capable of handling multiple widgets per page or post
|
50 |
* Fields for source, testimonial, image, title, location, email, company and URL details
|
|
|
51 |
* Multiple paging options for testimonials listings
|
52 |
* Schema.org microdata format for improved search engine results
|
53 |
* Settings export/import
|
@@ -58,9 +59,9 @@ The single testimonial view supports image, source, title, location, email, comp
|
|
58 |
* Use custom taxonomy or WordPress's own for categories and tags
|
59 |
* Use's [bxSlider](http://bxslider.com) for transitions
|
60 |
|
61 |
-
= Testimonials
|
62 |
|
63 |
-
Testimonials
|
64 |
|
65 |
= Primary Premium Features =
|
66 |
|
@@ -82,13 +83,12 @@ Testimonials Widget Premium adds onto the best WordPress testimonials plugin the
|
|
82 |
* List of testimonial source and title linking to full entry `[[testimonialswidgetpremium_link_list]]`
|
83 |
* Testimonials entry form `[[testimonialswidgetpremium_form]]`
|
84 |
|
85 |
-
[Buy Testimonials
|
86 |
|
87 |
= Additional Features =
|
88 |
|
89 |
* Adjustable animation speed
|
90 |
* Archive Page URL and Testimonial Page URL are prevented from being the same or matching existing pages.
|
91 |
-
* Auto-migration from pre-2.0.0 custom table to new Testimonials Widget custom post type
|
92 |
* Auto-suggest for category and tag options
|
93 |
* Automatic linking of email and URL fields via source or company fields
|
94 |
* Clickable widget titles
|
@@ -122,7 +122,7 @@ Testimonials Widget Premium adds onto the best WordPress testimonials plugin the
|
|
122 |
* Supports [WP-PageNavi](http://wordpress.org/extend/plugins/wp-pagenavi/)
|
123 |
* Testimonial content supports HTML
|
124 |
* Testimonial, email, and URL fields are clickable – URL requires `http://` or `https://` prefix
|
125 |
-
* Testimonials
|
126 |
* Testimonials output is completely customizable via filters
|
127 |
* Testimonials support styling based upon CSS classes for category, tags and post id
|
128 |
* URLs can be opened in new windows
|
@@ -237,21 +237,21 @@ Further, global settings are the baseline for shortcodes. If you want to alter t
|
|
237 |
|
238 |
**Post Type**
|
239 |
|
240 |
-
* Allow Comments? – Only affects the Testimonials
|
241 |
* Archive Page URL – URL slug-name for testimonials archive page. After changing, you must click "Save Changes" on Permalink Settings to update them.
|
242 |
* Testimonial Page URL – URL slug-name for testimonial view pages. After changing, you must click "Save Changes" on Permalink Settings to update them.
|
243 |
|
244 |
**Compatibility & Reset**
|
245 |
|
246 |
-
* Don't Use Default Taxonomies? – If checked, use Testimonials
|
247 |
* Export Settings – These are your current settings in a serialized format. Copy the contents to make a backup of your settings.
|
248 |
* Import Settings – Paste new serialized settings here to overwrite your current configuration.
|
249 |
-
* Remove Plugin Data on Deletion? - Delete all Testimonials
|
250 |
* Reset to Defaults? – Check this box to reset options to their defaults
|
251 |
|
252 |
**Version Based Options**
|
253 |
|
254 |
-
* Use bxSlider? - Pre 2.15.0, Testimonials
|
255 |
* Disable Animation? - Disable animation between testimonial transitions. Useful when stacking.
|
256 |
* `disable_animation` - default false; disable_animation=true
|
257 |
* Fade Out Speed - Transition duration in milliseconds; higher values indicate slower animations, not faster ones.
|
@@ -264,44 +264,33 @@ Further, global settings are the baseline for shortcodes. If you want to alter t
|
|
264 |
* `min_height` - default none; min_height=100
|
265 |
* Maximum Height - Set for maximum display height, in pixels
|
266 |
* `max_height` - default none; max_height=250
|
267 |
-
* Always Load CSS? - Pre 2.14.0. Testimonials
|
268 |
* Include IE7 CSS? - IE7 specific CSS moved to separate CSS file in version 2.13.6.
|
269 |
* Use `<q>` tag? – Pre 2.11.0. Not HTML5 compliant
|
270 |
* `use_quote_tag` - default none; use_quote_tag=true
|
271 |
-
* Remove `.hentry` CSS? – Some themes use class `.hentry` in a manner that breaks Testimonials
|
272 |
* `remove_hentry` - default none; remove_hentry=true
|
273 |
|
274 |
= Shortcode Examples =
|
275 |
|
276 |
**[[testimonialswidget_list]]**
|
277 |
|
278 |
-
* Testimonial list by category
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
* Show 3 full-length testimonials, with opening and closing quote marks removed
|
283 |
-
|
284 |
-
*
|
285 |
-
|
286 |
-
*
|
287 |
-
|
288 |
-
* Show 15 testimonials, in company order
|
289 |
-
* [[testimonialswidget_list meta_key=testimonials-widget-company order=asc limit=15]]
|
290 |
-
* List testimonials by post title
|
291 |
-
* [[testimonialswidget_list order=ASC orderby=title]]
|
292 |
-
* Select testimonials tagged with either "test" or "fun", in random order, but ignore those of the excluded ids
|
293 |
-
* [[testimonialswidget_list tags="test,fun" random=true exclude="2,22,333"]]
|
294 |
-
* Show all testimonials on one page
|
295 |
-
* [[testimonialswidget_list char_limit=0 limit=-1]]
|
296 |
|
297 |
**[[testimonialswidget_widget]]**
|
298 |
|
299 |
-
* Show rotating testimonials, in a fixed height container, of the product category, lowest post ids first
|
300 |
-
|
301 |
-
*
|
302 |
-
* [[testimonialswidget_widget min_height=250 max_height=500]]
|
303 |
-
* Show rotating, random testimonials having tag "sometag"
|
304 |
-
* [[testimonialswidget_widget tags=sometag random=true]]
|
305 |
|
306 |
= Theme Functions =
|
307 |
|
@@ -310,15 +299,12 @@ Further, global settings are the baseline for shortcodes. If you want to alter t
|
|
310 |
|
311 |
= API =
|
312 |
|
313 |
-
* Read the [Testimonials
|
314 |
|
315 |
= Notes =
|
316 |
|
317 |
* Review schema [structured data testing tool](http://www.google.com/webmasters/tools/richsnippets)
|
318 |
-
*
|
319 |
-
* Company, URL and email details are attempted to be identified and placed properly
|
320 |
-
* Public testimonials are saved as Published. Non-public, are marked as Private.
|
321 |
-
* Ignores already imported
|
322 |
* Default and Gravatar image size is based upon Thumbnail size in Media Settings
|
323 |
* When plugin is uninstalled, all data and settings are deleted
|
324 |
|
@@ -337,9 +323,9 @@ See the FAQ for further localization tips.
|
|
337 |
|
338 |
= Background & Thanks =
|
339 |
|
340 |
-
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
|
341 |
|
342 |
-
Version 2.0.0 of Testimonials
|
343 |
|
344 |
A cool thanks to RedRokk Library for the [redrokk_metabox_class](https://gist.github.com/1880770). It makes configuring meta boxes for your posts, pages or custom post types a snap.
|
345 |
|
@@ -347,22 +333,22 @@ Prior to version 2.0.0, this plugin was a fork of [Quotes Collection](http://sri
|
|
347 |
|
348 |
= Support =
|
349 |
|
350 |
-
Please visit the [Testimonials
|
351 |
|
352 |
-
If you want to contribute and I hope you do, visit the [Testimonials
|
353 |
|
354 |
|
355 |
== Installation ==
|
356 |
|
357 |
1. Via WordPress Admin > Plugins > Add New, Upload the `testimonials-widget.zip` file
|
358 |
1. Alternately, via FTP, upload `testimonials-widget` directory to the `/wp-content/plugins/` directory
|
359 |
-
1. Activate the 'Testimonials
|
360 |
|
361 |
= Usage =
|
362 |
|
363 |
1. Add and manage the quotes through the 'Testimonials' menu in the WordPress admin area
|
364 |
-
1. To display testimonials in the sidebar, go to 'Widgets' menu and drag the 'Testimonials
|
365 |
-
1. Configure the 'Testimonials
|
366 |
1. Use the `[[testimonialswidget_list]]` or `[[testimonialswidget_widget]]` shortcodes to display testimonials on a page or in a post
|
367 |
1. Read FAQ 1 for `testimonialswidget_list()` and `testimonialswidget_widget()` theme functions usage
|
368 |
|
@@ -371,6 +357,7 @@ If you want to contribute and I hope you do, visit the [Testimonials Widget Gith
|
|
371 |
|
372 |
= Most Common Resolutions =
|
373 |
|
|
|
374 |
1. [How do I change my widget's rotation speed or other options?](https://aihrus.zendesk.com/entries/27714083-How-do-I-change-my-widget-s-rotation-speed-or-other-options-)
|
375 |
1. [Debug common theme and plugin conflicts](https://aihrus.zendesk.com/entries/25119302-How-do-you-debug-common-issues-)
|
376 |
1. [Change or debug CSS](https://aihrus.zendesk.com/entries/24910733-How-to-Correct-Testimonials-Widget-CSS-Issues) AKA "What's up with these quotes?"
|
@@ -382,14 +369,14 @@ If you want to contribute and I hope you do, visit the [Testimonials Widget Gith
|
|
382 |
|
383 |
= Still Stuck? =
|
384 |
|
385 |
-
Please visit the [Testimonials
|
386 |
|
387 |
|
388 |
== Screenshots ==
|
389 |
|
390 |
1. Testimonials admin interface
|
391 |
-
2. Collapsed Testimonials
|
392 |
-
3. Expanded 'General Options' in Testimonials
|
393 |
4. Testimonial widget in the sidebar
|
394 |
5. [[testimonialswidget_list]] in post
|
395 |
6. [[testimonialswidget_list]] results with paging
|
@@ -397,15 +384,16 @@ Please visit the [Testimonials Widget Knowledge Base](https://aihrus.zendesk.com
|
|
397 |
8. Widget with clickable title and custom text/HTML on bottom
|
398 |
9. [WP-PageNavi compatible](http://wordpress.org/extend/plugins/wp-pagenavi/) for page numbers than default arrows
|
399 |
10. Poedit Catalog properties
|
400 |
-
11. Testimonials
|
401 |
-
12. Expanded 'Selection Options' in Testimonials
|
402 |
-
13. Expanded 'Ordering Options' in Testimonials
|
403 |
-
14. Testimonials
|
404 |
-
15. Testimonials
|
405 |
-
16. Testimonials
|
406 |
-
17. Testimonials
|
407 |
18. Dashboard > Right Now "Testimonials" count
|
408 |
19. Using Review and AggregateRating schema data structures
|
|
|
409 |
|
410 |
|
411 |
== Changelog ==
|
@@ -498,13 +486,13 @@ See [Changelog](https://github.com/michael-cannon/testimonials-widget/blob/maste
|
|
498 |
|
499 |
== Beta Testers Needed ==
|
500 |
|
501 |
-
I really want Testimonials
|
502 |
|
503 |
-
I need beta testers to help with ensuring pending releases of Testimonials
|
504 |
|
505 |
[Please contact me directly](http://aihr.us/contact-aihrus/).
|
506 |
|
507 |
-
Beta testers benefit directly with latest versions, a free 1-site license for Testimonials
|
508 |
|
509 |
== TODO ==
|
510 |
|
1 |
+
=== Testimonials ===
|
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.8.0
|
8 |
+
Stable tag: 2.16.0
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
12 |
+
Testimonials 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 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, the [Review schema](http://schema.org/Review) for improved search engine results is built-in.
|
18 |
|
19 |
[youtube http://www.youtube.com/watch?v=bhUhuQ-2m8s]
|
20 |
**[Video introduction](http://youtu.be/bhUhuQ-2m8s)**
|
21 |
|
22 |
+
**View a [Live Testimonials Demo](http://aihr.us/good-work-deserves-good-words-testimonials-widget-examples/)**
|
23 |
|
24 |
+
= It's Beyond Just Testimonials Slider Capabilities! =
|
25 |
|
26 |
* Slide Images - responsive image slideshow
|
27 |
* Slide Videos - video slideshow
|
34 |
* Fade and slide transitions
|
35 |
* Filter slideshow content by WordPress' built in categories, tags, or post-ID
|
36 |
|
37 |
+
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.
|
38 |
|
39 |
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.
|
40 |
|
41 |
+
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.
|
42 |
|
43 |
+
The single testimonial view supports image, source, title, location, email, company and URL details with optional Review schema.
|
44 |
|
45 |
= Primary Features =
|
46 |
|
48 |
* Admin interface to add, edit and manage testimonials
|
49 |
* Capable of handling multiple widgets per page or post
|
50 |
* Fields for source, testimonial, image, title, location, email, company and URL details
|
51 |
+
* Minimalist CSS styling for easier theming
|
52 |
* Multiple paging options for testimonials listings
|
53 |
* Schema.org microdata format for improved search engine results
|
54 |
* Settings export/import
|
59 |
* Use custom taxonomy or WordPress's own for categories and tags
|
60 |
* Use's [bxSlider](http://bxslider.com) for transitions
|
61 |
|
62 |
+
= Testimonials Premium =
|
63 |
|
64 |
+
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/downloads/testimonials-widget-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.
|
65 |
|
66 |
= Primary Premium Features =
|
67 |
|
83 |
* List of testimonial source and title linking to full entry `[[testimonialswidgetpremium_link_list]]`
|
84 |
* Testimonials entry form `[[testimonialswidgetpremium_form]]`
|
85 |
|
86 |
+
[Buy Testimonials Premium](http://aihr.us/downloads/testimonials-widget-premium-wordpress-plugin/) plugin for WordPress.
|
87 |
|
88 |
= Additional Features =
|
89 |
|
90 |
* Adjustable animation speed
|
91 |
* Archive Page URL and Testimonial Page URL are prevented from being the same or matching existing pages.
|
|
|
92 |
* Auto-suggest for category and tag options
|
93 |
* Automatic linking of email and URL fields via source or company fields
|
94 |
* Clickable widget titles
|
122 |
* Supports [WP-PageNavi](http://wordpress.org/extend/plugins/wp-pagenavi/)
|
123 |
* Testimonial content supports HTML
|
124 |
* Testimonial, email, and URL fields are clickable – URL requires `http://` or `https://` prefix
|
125 |
+
* Testimonials widget displays static and rotating testimonials
|
126 |
* Testimonials output is completely customizable via filters
|
127 |
* Testimonials support styling based upon CSS classes for category, tags and post id
|
128 |
* URLs can be opened in new windows
|
237 |
|
238 |
**Post Type**
|
239 |
|
240 |
+
* Allow Comments? – Only affects the Testimonials post edit page. Your theme controls the front-end view.
|
241 |
* Archive Page URL – URL slug-name for testimonials archive page. After changing, you must click "Save Changes" on Permalink Settings to update them.
|
242 |
* Testimonial Page URL – URL slug-name for testimonial view pages. After changing, you must click "Save Changes" on Permalink Settings to update them.
|
243 |
|
244 |
**Compatibility & Reset**
|
245 |
|
246 |
+
* Don't Use Default Taxonomies? – If checked, use Testimonials' own category and tag taxonomies instead
|
247 |
* Export Settings – These are your current settings in a serialized format. Copy the contents to make a backup of your settings.
|
248 |
* Import Settings – Paste new serialized settings here to overwrite your current configuration.
|
249 |
+
* Remove Plugin Data on Deletion? - Delete all Testimonials data and options from database on plugin deletion
|
250 |
* Reset to Defaults? – Check this box to reset options to their defaults
|
251 |
|
252 |
**Version Based Options**
|
253 |
|
254 |
+
* Use bxSlider? - Pre 2.15.0, Testimonials' used custom JavaScript for transitions.
|
255 |
* Disable Animation? - Disable animation between testimonial transitions. Useful when stacking.
|
256 |
* `disable_animation` - default false; disable_animation=true
|
257 |
* Fade Out Speed - Transition duration in milliseconds; higher values indicate slower animations, not faster ones.
|
264 |
* `min_height` - default none; min_height=100
|
265 |
* Maximum Height - Set for maximum display height, in pixels
|
266 |
* `max_height` - default none; max_height=250
|
267 |
+
* Always Load CSS? - Pre 2.14.0. Testimonials' CSS was always loaded, whether needed or not
|
268 |
* Include IE7 CSS? - IE7 specific CSS moved to separate CSS file in version 2.13.6.
|
269 |
* Use `<q>` tag? – Pre 2.11.0. Not HTML5 compliant
|
270 |
* `use_quote_tag` - default none; use_quote_tag=true
|
271 |
+
* Remove `.hentry` CSS? – Some themes use class `.hentry` in a manner that breaks Testimonials' CSS
|
272 |
* `remove_hentry` - default none; remove_hentry=true
|
273 |
|
274 |
= Shortcode Examples =
|
275 |
|
276 |
**[[testimonialswidget_list]]**
|
277 |
|
278 |
+
* `[[testimonialswidget_list category="category-name"]]` - Testimonial list by category
|
279 |
+
* `[[testimonialswidget_list category=product hide_not_found=true]]` - Testimonial list by category and hide "No testimonials found" message
|
280 |
+
* `[[testimonialswidget_list category=product tags=widget limit=5]]` - Testimonial list by tag, showing 5 at most
|
281 |
+
* `[[testimonialswidget_list char_limit=0 limit=-1]]` - Show all testimonials on one page
|
282 |
+
* `[[testimonialswidget_list char_limit=0 target=_new limit=3 disable_quotes=true]]` - Show 3 full-length testimonials, with opening and closing quote marks removed
|
283 |
+
* `[[testimonialswidget_list hide_source=true hide_url=true]]` - Show testimonial list with source and urls hidden
|
284 |
+
* `[[testimonialswidget_list ids="1,11,111" paging=false]]` - Show only these 3 testimonials
|
285 |
+
* `[[testimonialswidget_list meta_key=testimonials-widget-company order=asc limit=15]]` - Show 15 testimonials, in company order
|
286 |
+
* `[[testimonialswidget_list order=ASC orderby=title]]` - List testimonials by post title
|
287 |
+
* `[[testimonialswidget_list 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
288 |
|
289 |
**[[testimonialswidget_widget]]**
|
290 |
|
291 |
+
* `[[testimonialswidget_widget category=product order=asc height=300]]` - Show rotating testimonials, in a fixed height container, of the product category, lowest post ids first
|
292 |
+
* `[[testimonialswidget_widget min_height=250 max_height=500]]` - Show rotating testimonials in a box no smaller or bigger than 250 to 500 pixels in height
|
293 |
+
* `[[testimonialswidget_widget tags=sometag random=true]]` - Show rotating, random testimonials having tag "sometag"
|
|
|
|
|
|
|
294 |
|
295 |
= Theme Functions =
|
296 |
|
299 |
|
300 |
= API =
|
301 |
|
302 |
+
* Read the [Testimonials API](https://github.com/michael-cannon/testimonials-widget/blob/master/API.md).
|
303 |
|
304 |
= Notes =
|
305 |
|
306 |
* Review schema [structured data testing tool](http://www.google.com/webmasters/tools/richsnippets)
|
307 |
+
* If migration from from pre-2.0.0 custom table to new custom post type is needed, then install Testimonials Widget 2.15.1 for that capability before updating to the latest Testimonials Widget plugin.
|
|
|
|
|
|
|
308 |
* Default and Gravatar image size is based upon Thumbnail size in Media Settings
|
309 |
* When plugin is uninstalled, all data and settings are deleted
|
310 |
|
323 |
|
324 |
= Background & Thanks =
|
325 |
|
326 |
+
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.
|
327 |
|
328 |
+
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.
|
329 |
|
330 |
A cool thanks to RedRokk Library for the [redrokk_metabox_class](https://gist.github.com/1880770). It makes configuring meta boxes for your posts, pages or custom post types a snap.
|
331 |
|
333 |
|
334 |
= Support =
|
335 |
|
336 |
+
Please visit the [Testimonials Knowledge Base](https://aihrus.zendesk.com/categories/20104507-Testimonials-Widget) for frequently asked questions, sending ideas, or getting support.
|
337 |
|
338 |
+
If you want to contribute and I hope you do, visit the [Testimonials Github repository](https://github.com/michael-cannon/testimonials-widget).
|
339 |
|
340 |
|
341 |
== Installation ==
|
342 |
|
343 |
1. Via WordPress Admin > Plugins > Add New, Upload the `testimonials-widget.zip` file
|
344 |
1. Alternately, via FTP, upload `testimonials-widget` directory to the `/wp-content/plugins/` directory
|
345 |
+
1. Activate the 'Testimonials' plugin after uploading or through WordPress Admin > Plugins
|
346 |
|
347 |
= Usage =
|
348 |
|
349 |
1. Add and manage the quotes through the 'Testimonials' menu in the WordPress admin area
|
350 |
+
1. To display testimonials in the sidebar, go to 'Widgets' menu and drag the 'Testimonials' into the desired widget area
|
351 |
+
1. Configure the 'Testimonials' to select quotes and display as needed
|
352 |
1. Use the `[[testimonialswidget_list]]` or `[[testimonialswidget_widget]]` shortcodes to display testimonials on a page or in a post
|
353 |
1. Read FAQ 1 for `testimonialswidget_list()` and `testimonialswidget_widget()` theme functions usage
|
354 |
|
357 |
|
358 |
= Most Common Resolutions =
|
359 |
|
360 |
+
1. [How do I create a testimonial record?](https://aihrus.zendesk.com/entries/30602506-How-do-I-create-a-testimonial-record-)
|
361 |
1. [How do I change my widget's rotation speed or other options?](https://aihrus.zendesk.com/entries/27714083-How-do-I-change-my-widget-s-rotation-speed-or-other-options-)
|
362 |
1. [Debug common theme and plugin conflicts](https://aihrus.zendesk.com/entries/25119302-How-do-you-debug-common-issues-)
|
363 |
1. [Change or debug CSS](https://aihrus.zendesk.com/entries/24910733-How-to-Correct-Testimonials-Widget-CSS-Issues) AKA "What's up with these quotes?"
|
369 |
|
370 |
= Still Stuck? =
|
371 |
|
372 |
+
Please visit the [Testimonials Knowledge Base](https://aihrus.zendesk.com/categories/20104507-Testimonials-Widget) for more frequently asked questions, sending ideas, or getting support.
|
373 |
|
374 |
|
375 |
== Screenshots ==
|
376 |
|
377 |
1. Testimonials admin interface
|
378 |
+
2. Collapsed Testimonials options
|
379 |
+
3. Expanded 'General Options' in Testimonials options
|
380 |
4. Testimonial widget in the sidebar
|
381 |
5. [[testimonialswidget_list]] in post
|
382 |
6. [[testimonialswidget_list]] results with paging
|
384 |
8. Widget with clickable title and custom text/HTML on bottom
|
385 |
9. [WP-PageNavi compatible](http://wordpress.org/extend/plugins/wp-pagenavi/) for page numbers than default arrows
|
386 |
10. Poedit Catalog properties
|
387 |
+
11. Testimonials Settings > General tab
|
388 |
+
12. Expanded 'Selection Options' in Testimonials options
|
389 |
+
13. Expanded 'Ordering Options' in Testimonials options
|
390 |
+
14. Testimonials Settings > Selection tab
|
391 |
+
15. Testimonials Settings > Post Type tab
|
392 |
+
16. Testimonials Settings > Widget tab
|
393 |
+
17. Testimonials Settings > Compatibility & Reset tab
|
394 |
18. Dashboard > Right Now "Testimonials" count
|
395 |
19. Using Review and AggregateRating schema data structures
|
396 |
+
20. Testimonials Shortcode Examples page
|
397 |
|
398 |
|
399 |
== Changelog ==
|
486 |
|
487 |
== Beta Testers Needed ==
|
488 |
|
489 |
+
I really want Testimonials and Testimonials Premium to be the best WordPress plugins of their type. However, it's beyond me to do it alone.
|
490 |
|
491 |
+
I need beta testers to help with ensuring pending releases of Testimonials and Testimonials Premium are solid. This would benefit us all by helping reduce the number of releases and raise code quality.
|
492 |
|
493 |
[Please contact me directly](http://aihr.us/contact-aihrus/).
|
494 |
|
495 |
+
Beta testers benefit directly with latest versions, a free 1-site license for Testimonials Premium, and personalized support assistance.
|
496 |
|
497 |
== TODO ==
|
498 |
|
testimonials-widget.php
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Plugin Name: Testimonials
|
4 |
-
* Plugin URI: http://wordpress.org/
|
5 |
-
* Description: Testimonials
|
6 |
-
* Version: 2.
|
7 |
* Author: Michael Cannon
|
8 |
-
* Author URI: http://aihr.us/
|
9 |
* License: GPLv2 or later
|
10 |
*/
|
11 |
|
@@ -23,27 +23,38 @@
|
|
23 |
* along with this program; if not, write to the Free Software
|
24 |
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
25 |
*/
|
26 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
const ID = 'testimonials-widget-testimonials';
|
28 |
-
const
|
29 |
-
const
|
30 |
-
const PLUGIN_FILE = 'testimonials-widget/testimonials-widget.php';
|
31 |
const PT = 'testimonials-widget';
|
32 |
-
const
|
|
|
33 |
|
34 |
-
private static $base = null;
|
35 |
private static $found_posts = 0;
|
36 |
private static $max_num_pages = 0;
|
37 |
private static $post_count = 0;
|
38 |
-
private static $wp_query
|
39 |
|
|
|
40 |
public static $cpt_category = '';
|
41 |
public static $cpt_tags = '';
|
42 |
public static $css = array();
|
43 |
public static $css_called = false;
|
44 |
-
public static $donate_button = '';
|
45 |
public static $instance_number = 0;
|
46 |
public static $instance_widget = 0;
|
|
|
|
|
|
|
47 |
public static $scripts = array();
|
48 |
public static $scripts_called = false;
|
49 |
public static $settings_link = '';
|
@@ -90,7 +101,10 @@ class Testimonials_Widget {
|
|
90 |
|
91 |
|
92 |
public function __construct() {
|
|
|
|
|
93 |
add_action( 'admin_init', array( $this, 'admin_init' ) );
|
|
|
94 |
add_action( 'init', array( $this, 'init' ) );
|
95 |
add_action( 'widgets_init', array( $this, 'widgets_init' ) );
|
96 |
add_shortcode( 'testimonialswidget_list', array( $this, 'testimonialswidget_list' ) );
|
@@ -99,19 +113,13 @@ class Testimonials_Widget {
|
|
99 |
|
100 |
|
101 |
public function admin_init() {
|
102 |
-
self
|
103 |
-
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
|
104 |
-
<input type="hidden" name="cmd" value="_s-xclick">
|
105 |
-
<input type="hidden" name="hosted_button_id" value="WM4F995W9LHXE">
|
106 |
-
<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!">
|
107 |
-
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
|
108 |
-
</form>
|
109 |
-
EOD;
|
110 |
|
111 |
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>';
|
112 |
|
113 |
$this->add_meta_box_testimonials_widget();
|
114 |
$this->update();
|
|
|
115 |
add_action( 'gettext', array( $this, 'gettext_testimonials' ) );
|
116 |
add_action( 'manage_' . self::PT . '_posts_custom_column', array( $this, 'manage_posts_custom_column' ), 10, 2 );
|
117 |
add_action( 'right_now_content_table_end', array( $this, 'right_now_content_table_end' ) );
|
@@ -120,16 +128,22 @@ EOD;
|
|
120 |
add_filter( 'plugin_row_meta', array( $this, 'plugin_row_meta' ), 10, 2 );
|
121 |
add_filter( 'post_updated_messages', array( $this, 'post_updated_messages' ) );
|
122 |
add_filter( 'pre_get_posts', array( $this, 'pre_get_posts_author' ) );
|
123 |
-
|
|
|
|
|
|
|
|
|
124 |
}
|
125 |
|
126 |
|
127 |
public function init() {
|
128 |
add_filter( 'the_content', array( $this, 'get_single' ) );
|
|
|
129 |
load_plugin_textdomain( self::PT, false, 'testimonials-widget/languages' );
|
130 |
-
|
131 |
self::$cpt_category = self::PT . '-category';
|
132 |
self::$cpt_tags = self::PT . '-post_tag';
|
|
|
133 |
self::init_post_type();
|
134 |
|
135 |
$force_css_loading = tw_get_option( 'force_css_loading' );
|
@@ -138,8 +152,8 @@ EOD;
|
|
138 |
}
|
139 |
|
140 |
|
141 |
-
public function plugin_action_links( $links, $file ) {
|
142 |
-
if (
|
143 |
array_unshift( $links, self::$settings_link );
|
144 |
|
145 |
return $links;
|
@@ -230,7 +244,7 @@ EOD;
|
|
230 |
if ( ! current_user_can( 'activate_plugins' ) )
|
231 |
return;
|
232 |
|
233 |
-
require_once '
|
234 |
self::init();
|
235 |
flush_rewrite_rules();
|
236 |
}
|
@@ -241,6 +255,7 @@ EOD;
|
|
241 |
return;
|
242 |
|
243 |
flush_rewrite_rules();
|
|
|
244 |
}
|
245 |
|
246 |
|
@@ -250,11 +265,10 @@ EOD;
|
|
250 |
|
251 |
global $wpdb;
|
252 |
|
253 |
-
require_once '
|
254 |
$delete_data = tw_get_option( 'delete_data', false );
|
255 |
if ( $delete_data ) {
|
256 |
delete_option( Testimonials_Widget_Settings::ID );
|
257 |
-
delete_option( self::OLD_NAME );
|
258 |
$wpdb->query( 'OPTIMIZE TABLE `' . $wpdb->options . '`' );
|
259 |
|
260 |
Testimonials_Widget::delete_testimonials();
|
@@ -297,7 +311,7 @@ EOD;
|
|
297 |
|
298 |
|
299 |
public static function plugin_row_meta( $input, $file ) {
|
300 |
-
if (
|
301 |
return $input;
|
302 |
|
303 |
$disable_donate = tw_get_option( 'disable_donate' );
|
@@ -305,8 +319,8 @@ EOD;
|
|
305 |
return $input;
|
306 |
|
307 |
$links = array(
|
308 |
-
|
309 |
-
'<a href="http://aihr.us/downloads/testimonials-widget-premium-wordpress-plugin/">Purchase Testimonials
|
310 |
);
|
311 |
|
312 |
$input = array_merge( $input, $links );
|
@@ -315,21 +329,17 @@ EOD;
|
|
315 |
}
|
316 |
|
317 |
|
318 |
-
public function
|
319 |
-
$
|
320 |
-
$content .= sprintf( __( 'If your Testimonials Widget 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' ) );
|
321 |
-
$content .= '</p></div>';
|
322 |
|
323 |
-
|
324 |
}
|
325 |
|
326 |
|
327 |
-
public function
|
328 |
-
$
|
329 |
-
$content .= sprintf( esc_html__( 'Please donate $5 towards development and support of this Testimonials Widget plugin. %s', 'testimonials-widget' ), self::$donate_button );
|
330 |
-
$content .= '</p></div>';
|
331 |
|
332 |
-
|
333 |
}
|
334 |
|
335 |
|
@@ -337,10 +347,10 @@ EOD;
|
|
337 |
$prior_version = tw_get_option( 'admin_notices' );
|
338 |
if ( $prior_version ) {
|
339 |
if ( $prior_version < '2.12.0' )
|
340 |
-
|
341 |
|
342 |
if ( $prior_version < '2.15.0' )
|
343 |
-
|
344 |
|
345 |
if ( $prior_version < self::VERSION )
|
346 |
do_action( 'testimonials_widget_update' );
|
@@ -351,103 +361,9 @@ EOD;
|
|
351 |
// display donate on major/minor version release
|
352 |
$donate_version = tw_get_option( 'donate_version', false );
|
353 |
if ( ! $donate_version || ( $donate_version != self::VERSION && preg_match( '#\.0$#', self::VERSION ) ) ) {
|
354 |
-
|
355 |
tw_set_option( 'donate_version', self::VERSION );
|
356 |
}
|
357 |
-
|
358 |
-
$options = get_option( self::OLD_NAME );
|
359 |
-
if ( true !== $options['migrated'] )
|
360 |
-
$this->migrate();
|
361 |
-
}
|
362 |
-
|
363 |
-
|
364 |
-
public function migrate() {
|
365 |
-
global $wpdb;
|
366 |
-
|
367 |
-
$table_name = $wpdb->prefix . self::OLD_NAME;
|
368 |
-
$meta_key = '_' . self::PT . ':testimonial_id';
|
369 |
-
$has_table_query = "SELECT table_name FROM information_schema.tables WHERE table_schema='{$wpdb->dbname}' AND table_name='{$table_name}'";
|
370 |
-
$has_table_result = $wpdb->get_col( $has_table_query );
|
371 |
-
|
372 |
-
if ( ! empty( $has_table_result ) ) {
|
373 |
-
// check that db table exists and has entries
|
374 |
-
$query = 'SELECT `testimonial_id`, `testimonial`, `author`, `source`, `tags`, `public`, `time_added`, `time_updated` FROM `' . $table_name . '`';
|
375 |
-
|
376 |
-
// ignore already imported
|
377 |
-
$done_import_query = 'SELECT meta_value FROM ' . $wpdb->postmeta . ' WHERE meta_key = "' . $meta_key . '"';
|
378 |
-
$done_import = $wpdb->get_col( $done_import_query );
|
379 |
-
|
380 |
-
if ( ! empty( $done_import ) ) {
|
381 |
-
$done_import = array_unique( $done_import );
|
382 |
-
$query .= ' WHERE testimonial_id NOT IN ( ' . implode( ',', $done_import ) . ' )';
|
383 |
-
}
|
384 |
-
|
385 |
-
$results = $wpdb->get_results( $query );
|
386 |
-
if ( ! empty( $results ) ) {
|
387 |
-
foreach ( $results as $result ) {
|
388 |
-
// author can contain title and company details
|
389 |
-
$author = $result->author;
|
390 |
-
$company = false;
|
391 |
-
|
392 |
-
// ex: First Last of Company!
|
393 |
-
$author = str_replace( ' of ', ', ', $author );
|
394 |
-
// now ex: First Last, Company!
|
395 |
-
|
396 |
-
// ex: First Last, Company
|
397 |
-
// ex: First Last, Web Development Manager, Topcon Positioning Systems, Inc.
|
398 |
-
// ex: First Last, Owner, Company, LLC
|
399 |
-
$author = str_replace( ' of ', ', ', $author );
|
400 |
-
$temp_comma = '^^^';
|
401 |
-
$author = str_replace( ', LLC', $temp_comma . ' LLC', $author );
|
402 |
-
|
403 |
-
// now ex: First Last, Owner, Company^^^ LLC
|
404 |
-
$author = str_replace( ', Inc', $temp_comma . ' Inc', $author );
|
405 |
-
|
406 |
-
// ex: First Last, Web Development Manager, Company^^^ Inc.
|
407 |
-
// it's possible to have "Michael Cannon, Senior Developer" and "Senior Developer" become the company. Okay for now
|
408 |
-
$author = explode( ', ', $author );
|
409 |
-
|
410 |
-
if ( 1 < count( $author ) ) {
|
411 |
-
$company = array_pop( $author );
|
412 |
-
$company = str_replace( $temp_comma, ',', $company );
|
413 |
-
}
|
414 |
-
|
415 |
-
$author = implode( ', ', $author );
|
416 |
-
$author = str_replace( $temp_comma, ',', $author );
|
417 |
-
|
418 |
-
$post_data = array(
|
419 |
-
'post_type' => self::PT,
|
420 |
-
'post_status' => ( 'yes' == $result->public ) ? 'publish' : 'private',
|
421 |
-
'post_date' => $result->time_added,
|
422 |
-
'post_modified' => $result->time_updated,
|
423 |
-
'post_title' => $author,
|
424 |
-
'post_content' => $result->testimonial,
|
425 |
-
'tags_input' => $result->tags,
|
426 |
-
);
|
427 |
-
|
428 |
-
$post_id = wp_insert_post( $post_data, true );
|
429 |
-
|
430 |
-
// track/link testimonial import to new post
|
431 |
-
add_post_meta( $post_id, $meta_key, $result->testimonial_id );
|
432 |
-
|
433 |
-
if ( ! empty( $company ) )
|
434 |
-
add_post_meta( $post_id, 'testimonials-widget-company', $company );
|
435 |
-
|
436 |
-
$source = $result->source;
|
437 |
-
if ( ! empty( $source ) ) {
|
438 |
-
if ( is_email( $source ) ) {
|
439 |
-
add_post_meta( $post_id, 'testimonials-widget-email', $source );
|
440 |
-
} else {
|
441 |
-
add_post_meta( $post_id, 'testimonials-widget-url', $source );
|
442 |
-
}
|
443 |
-
}
|
444 |
-
}
|
445 |
-
}
|
446 |
-
}
|
447 |
-
|
448 |
-
$options['migrated'] = true;
|
449 |
-
delete_option( self::OLD_NAME );
|
450 |
-
add_option( self::OLD_NAME, $options );
|
451 |
}
|
452 |
|
453 |
|
@@ -696,6 +612,9 @@ EOD;
|
|
696 |
|
697 |
if ( ! isset( $atts['random'] ) )
|
698 |
$atts['random'] = 1;
|
|
|
|
|
|
|
699 |
}
|
700 |
|
701 |
$atts = wp_parse_args( $atts, self::get_defaults() );
|
@@ -817,6 +736,10 @@ EOF;
|
|
817 |
|
818 |
|
819 |
public static function get_testimonials_html_js( $testimonials, $atts, $widget_number = null ) {
|
|
|
|
|
|
|
|
|
820 |
$scripts = array();
|
821 |
$scripts_internal = array();
|
822 |
|
@@ -844,7 +767,7 @@ EOF;
|
|
844 |
|
845 |
$autoControls = $show_start_stop ? 'autoControls: true,' : '';
|
846 |
|
847 |
-
$slider_var = self::
|
848 |
$javascript .= <<<EOF
|
849 |
var {$slider_var} = null;
|
850 |
|
@@ -945,7 +868,6 @@ EOF;
|
|
945 |
|
946 |
|
947 |
public static function get_testimonials_html( $testimonials, $atts, $is_list = true, $widget_number = null ) {
|
948 |
-
// display attributes
|
949 |
$hide_not_found = $atts['hide_not_found'];
|
950 |
$paging = Testimonials_Widget_Settings::is_true( $atts['paging'] );
|
951 |
$paging_before = ( 'before' === strtolower( $atts['paging'] ) );
|
@@ -970,7 +892,10 @@ EOF;
|
|
970 |
$testimonials = array(
|
971 |
array( 'testimonial_content' => esc_html__( 'No testimonials found', 'testimonials-widget' ) ),
|
972 |
);
|
973 |
-
|
|
|
|
|
|
|
974 |
|
975 |
$pre_paging = '';
|
976 |
if ( $paging || $paging_before )
|
@@ -1008,7 +933,6 @@ EOF;
|
|
1008 |
|
1009 |
|
1010 |
public static function get_testimonial_html( $testimonial, $atts, $is_list = true, $is_first = false, $widget_number = null ) {
|
1011 |
-
// display attributes
|
1012 |
$disable_quotes = $atts['disable_quotes'];
|
1013 |
$do_image = ! $atts['hide_image'] && ! empty( $testimonial['testimonial_image'] );
|
1014 |
$do_image_single = ! $atts['hide_image_single'];
|
@@ -1033,13 +957,15 @@ EOF;
|
|
1033 |
if ( $keep_whitespace )
|
1034 |
$class .= ' whitespace';
|
1035 |
|
1036 |
-
|
1037 |
-
|
|
|
1038 |
else
|
1039 |
$class = 'testimonials-widget type-testimonials-widget status-publish hentry ' . $class;
|
1040 |
|
1041 |
-
$class
|
1042 |
-
$div_open
|
|
|
1043 |
|
1044 |
if ( $do_schema && $do_content )
|
1045 |
$div_open .= sprintf( self::$schema_div_open, self::$review_schema );
|
@@ -1151,21 +1077,16 @@ EOF;
|
|
1151 |
|
1152 |
|
1153 |
public static function get_cite( $testimonial, $atts ) {
|
1154 |
-
|
1155 |
-
|
1156 |
-
$
|
1157 |
-
$
|
1158 |
-
$
|
1159 |
-
$
|
|
|
|
|
1160 |
$use_quote_tag = $atts['use_quote_tag'];
|
1161 |
|
1162 |
-
$testimonial_company = $testimonial['testimonial_company'];
|
1163 |
-
$testimonial_email = $testimonial['testimonial_email'];
|
1164 |
-
$testimonial_location = $testimonial['testimonial_location'];
|
1165 |
-
$testimonial_source = $testimonial['testimonial_source'];
|
1166 |
-
$testimonial_title = $testimonial['testimonial_title'];
|
1167 |
-
$testimonial_url = $testimonial['testimonial_url'];
|
1168 |
-
|
1169 |
$cite = '';
|
1170 |
|
1171 |
$done_url = false;
|
@@ -1526,7 +1447,7 @@ EOF;
|
|
1526 |
$args['post_status'][] = 'draft';
|
1527 |
}
|
1528 |
|
1529 |
-
if ( $paging && $atts['paged'] && is_singular() )
|
1530 |
$args['paged'] = $atts['paged'];
|
1531 |
|
1532 |
if ( ! $random && $meta_key ) {
|
@@ -1622,14 +1543,16 @@ EOF;
|
|
1622 |
wp_reset_postdata();
|
1623 |
|
1624 |
$image_size = apply_filters( 'testimonials_widget_image_size', 'thumbnail' );
|
|
|
|
|
|
|
|
|
|
|
|
|
1625 |
|
1626 |
-
|
1627 |
-
|
1628 |
-
$gravatar_size =
|
1629 |
-
else
|
1630 |
-
$gravatar_size = get_option( $image_size . '_size_w' );
|
1631 |
-
|
1632 |
-
$gravatar_size = apply_filters( 'testimonials_widget_gravatar_size', $gravatar_size );
|
1633 |
|
1634 |
$testimonial_data = array();
|
1635 |
|
@@ -1696,7 +1619,7 @@ EOF;
|
|
1696 |
|
1697 |
|
1698 |
public function widgets_init() {
|
1699 |
-
require_once '
|
1700 |
|
1701 |
register_widget( 'Testimonials_Widget_Widget' );
|
1702 |
}
|
@@ -1708,7 +1631,7 @@ EOF;
|
|
1708 |
* @SuppressWarnings(PHPMD.UnusedLocalVariable)
|
1709 |
*/
|
1710 |
public function add_meta_box_testimonials_widget() {
|
1711 |
-
require_once '
|
1712 |
|
1713 |
$fields = array(
|
1714 |
array(
|
@@ -1746,7 +1669,7 @@ EOF;
|
|
1746 |
$fields = apply_filters( 'testimonials_widget_meta_box', $fields );
|
1747 |
|
1748 |
$meta_box = redrokk_metabox_class::getInstance(
|
1749 |
-
self::
|
1750 |
array(
|
1751 |
'title' => esc_html__( 'Testimonial Data', 'testimonials-widget' ),
|
1752 |
'description' => '',
|
@@ -1842,32 +1765,30 @@ EOF;
|
|
1842 |
if ( ! is_string( $string ) )
|
1843 |
return $string;
|
1844 |
|
1845 |
-
return trim( strip_tags( $string ) );
|
1846 |
}
|
1847 |
|
1848 |
|
|
|
|
|
|
|
|
|
|
|
1849 |
public static function get_schema( $testimonial, $atts ) {
|
1850 |
foreach ( $testimonial as $key => $value ) {
|
1851 |
if ( 'testimonial_image' != $key )
|
1852 |
$testimonial[ $key ] = self::clean_string( $value );
|
1853 |
}
|
1854 |
|
1855 |
-
|
1856 |
-
|
1857 |
-
$
|
1858 |
-
$
|
1859 |
-
$
|
1860 |
-
$
|
1861 |
-
$
|
1862 |
-
|
1863 |
-
$
|
1864 |
-
$testimonial_content = $testimonial['testimonial_content'];
|
1865 |
-
$testimonial_email = $testimonial['testimonial_email'];
|
1866 |
-
$testimonial_image = $testimonial['testimonial_image'];
|
1867 |
-
$testimonial_location = $testimonial['testimonial_location'];
|
1868 |
-
$testimonial_source = $testimonial['testimonial_source'];
|
1869 |
-
$testimonial_title = $testimonial['testimonial_title'];
|
1870 |
-
$testimonial_url = $testimonial['testimonial_url'];
|
1871 |
|
1872 |
$item_reviewed = self::clean_string( $atts['item_reviewed'] );
|
1873 |
$item_reviewed_url = self::clean_string( $atts['item_reviewed_url'] );
|
@@ -2113,12 +2034,89 @@ EOF;
|
|
2113 |
}
|
2114 |
|
2115 |
|
2116 |
-
public function
|
2117 |
-
$
|
2118 |
-
|
2119 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2120 |
|
2121 |
-
|
2122 |
}
|
2123 |
|
2124 |
|
@@ -2135,10 +2133,9 @@ add_action( 'plugins_loaded', 'testimonialswidget_init', 99 );
|
|
2135 |
* @SuppressWarnings(PHPMD.UnusedLocalVariable)
|
2136 |
*/
|
2137 |
function testimonialswidget_init() {
|
2138 |
-
|
|
|
2139 |
|
2140 |
-
if ( is_plugin_active( Testimonials_Widget::PLUGIN_FILE ) ) {
|
2141 |
-
require_once 'lib/class-testimonials-widget-settings.php';
|
2142 |
global $Testimonials_Widget_Settings;
|
2143 |
if ( is_null( $Testimonials_Widget_Settings ) )
|
2144 |
$Testimonials_Widget_Settings = new Testimonials_Widget_Settings();
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Plugin Name: Testimonials
|
4 |
+
* Plugin URI: http://wordpress.org/plugins/testimonials-widget/
|
5 |
+
* Description: Testimonials lets you randomly slide or list selected portfolios, quotes, reviews, or text with images or videos on your WordPress site.
|
6 |
+
* Version: 2.16.0
|
7 |
* Author: Michael Cannon
|
8 |
+
* Author URI: http://aihr.us/resume/
|
9 |
* License: GPLv2 or later
|
10 |
*/
|
11 |
|
23 |
* along with this program; if not, write to the Free Software
|
24 |
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
25 |
*/
|
26 |
+
if ( ! defined( 'TW_PLUGIN_DIR' ) )
|
27 |
+
define( 'TW_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
|
28 |
+
|
29 |
+
if ( ! defined( 'TW_PLUGIN_DIR_LIB' ) )
|
30 |
+
define( 'TW_PLUGIN_DIR_LIB', TW_PLUGIN_DIR . '/lib' );
|
31 |
+
|
32 |
+
require_once TW_PLUGIN_DIR_LIB . '/aihrus/class-aihrus-common.php';
|
33 |
+
|
34 |
+
|
35 |
+
class Testimonials_Widget extends Aihrus_Common {
|
36 |
const ID = 'testimonials-widget-testimonials';
|
37 |
+
const ITEM_NAME = 'Testimonials';
|
38 |
+
const PLUGIN_BASE = 'testimonials-widget/testimonials-widget.php';
|
|
|
39 |
const PT = 'testimonials-widget';
|
40 |
+
const SLUG = 'tw_';
|
41 |
+
const VERSION = '2.16.0';
|
42 |
|
|
|
43 |
private static $found_posts = 0;
|
44 |
private static $max_num_pages = 0;
|
45 |
private static $post_count = 0;
|
46 |
+
private static $wp_query;
|
47 |
|
48 |
+
public static $class = __CLASS__;
|
49 |
public static $cpt_category = '';
|
50 |
public static $cpt_tags = '';
|
51 |
public static $css = array();
|
52 |
public static $css_called = false;
|
|
|
53 |
public static $instance_number = 0;
|
54 |
public static $instance_widget = 0;
|
55 |
+
public static $menu_shortcodes;
|
56 |
+
public static $not_found = false;
|
57 |
+
public static $notice_key;
|
58 |
public static $scripts = array();
|
59 |
public static $scripts_called = false;
|
60 |
public static $settings_link = '';
|
101 |
|
102 |
|
103 |
public function __construct() {
|
104 |
+
parent::__construct();
|
105 |
+
|
106 |
add_action( 'admin_init', array( $this, 'admin_init' ) );
|
107 |
+
add_action( 'admin_menu', array( $this, 'admin_menu' ) );
|
108 |
add_action( 'init', array( $this, 'init' ) );
|
109 |
add_action( 'widgets_init', array( $this, 'widgets_init' ) );
|
110 |
add_shortcode( 'testimonialswidget_list', array( $this, 'testimonialswidget_list' ) );
|
113 |
|
114 |
|
115 |
public function admin_init() {
|
116 |
+
self::support_thumbnails();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
117 |
|
118 |
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>';
|
119 |
|
120 |
$this->add_meta_box_testimonials_widget();
|
121 |
$this->update();
|
122 |
+
|
123 |
add_action( 'gettext', array( $this, 'gettext_testimonials' ) );
|
124 |
add_action( 'manage_' . self::PT . '_posts_custom_column', array( $this, 'manage_posts_custom_column' ), 10, 2 );
|
125 |
add_action( 'right_now_content_table_end', array( $this, 'right_now_content_table_end' ) );
|
128 |
add_filter( 'plugin_row_meta', array( $this, 'plugin_row_meta' ), 10, 2 );
|
129 |
add_filter( 'post_updated_messages', array( $this, 'post_updated_messages' ) );
|
130 |
add_filter( 'pre_get_posts', array( $this, 'pre_get_posts_author' ) );
|
131 |
+
}
|
132 |
+
|
133 |
+
|
134 |
+
public function admin_menu() {
|
135 |
+
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( $this, 'show_shortcodes' ) );
|
136 |
}
|
137 |
|
138 |
|
139 |
public function init() {
|
140 |
add_filter( 'the_content', array( $this, 'get_single' ) );
|
141 |
+
|
142 |
load_plugin_textdomain( self::PT, false, 'testimonials-widget/languages' );
|
143 |
+
|
144 |
self::$cpt_category = self::PT . '-category';
|
145 |
self::$cpt_tags = self::PT . '-post_tag';
|
146 |
+
|
147 |
self::init_post_type();
|
148 |
|
149 |
$force_css_loading = tw_get_option( 'force_css_loading' );
|
152 |
}
|
153 |
|
154 |
|
155 |
+
public static function plugin_action_links( $links, $file ) {
|
156 |
+
if ( self::PLUGIN_BASE == $file )
|
157 |
array_unshift( $links, self::$settings_link );
|
158 |
|
159 |
return $links;
|
244 |
if ( ! current_user_can( 'activate_plugins' ) )
|
245 |
return;
|
246 |
|
247 |
+
require_once TW_PLUGIN_DIR_LIB . '/class-testimonials-widget-settings.php';
|
248 |
self::init();
|
249 |
flush_rewrite_rules();
|
250 |
}
|
255 |
return;
|
256 |
|
257 |
flush_rewrite_rules();
|
258 |
+
Testimonials_Widget::delete_notices();
|
259 |
}
|
260 |
|
261 |
|
265 |
|
266 |
global $wpdb;
|
267 |
|
268 |
+
require_once TW_PLUGIN_DIR_LIB . '/class-testimonials-widget-settings.php';
|
269 |
$delete_data = tw_get_option( 'delete_data', false );
|
270 |
if ( $delete_data ) {
|
271 |
delete_option( Testimonials_Widget_Settings::ID );
|
|
|
272 |
$wpdb->query( 'OPTIMIZE TABLE `' . $wpdb->options . '`' );
|
273 |
|
274 |
Testimonials_Widget::delete_testimonials();
|
311 |
|
312 |
|
313 |
public static function plugin_row_meta( $input, $file ) {
|
314 |
+
if ( self::PLUGIN_BASE != $file )
|
315 |
return $input;
|
316 |
|
317 |
$disable_donate = tw_get_option( 'disable_donate' );
|
319 |
return $input;
|
320 |
|
321 |
$links = array(
|
322 |
+
self::$donate_link,
|
323 |
+
'<a href="http://aihr.us/downloads/testimonials-widget-premium-wordpress-plugin/">Purchase Testimonials Premium</a>',
|
324 |
);
|
325 |
|
326 |
$input = array_merge( $input, $links );
|
329 |
}
|
330 |
|
331 |
|
332 |
+
public static function notice_2_12_0() {
|
333 |
+
$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' ) );
|
|
|
|
|
334 |
|
335 |
+
self::notice_updated( $text );
|
336 |
}
|
337 |
|
338 |
|
339 |
+
public static function notice_donate( $disable_donate = null, $item_name = null ) {
|
340 |
+
$disable_donate = tw_get_option( 'disable_donate' );
|
|
|
|
|
341 |
|
342 |
+
parent::notice_donate( $disable_donate, self::ITEM_NAME );
|
343 |
}
|
344 |
|
345 |
|
347 |
$prior_version = tw_get_option( 'admin_notices' );
|
348 |
if ( $prior_version ) {
|
349 |
if ( $prior_version < '2.12.0' )
|
350 |
+
self::set_notice( 'notice_2_12_0' );
|
351 |
|
352 |
if ( $prior_version < '2.15.0' )
|
353 |
+
self::set_notice( 'notice_2_15_0' );
|
354 |
|
355 |
if ( $prior_version < self::VERSION )
|
356 |
do_action( 'testimonials_widget_update' );
|
361 |
// display donate on major/minor version release
|
362 |
$donate_version = tw_get_option( 'donate_version', false );
|
363 |
if ( ! $donate_version || ( $donate_version != self::VERSION && preg_match( '#\.0$#', self::VERSION ) ) ) {
|
364 |
+
self::set_notice( 'notice_donate' );
|
365 |
tw_set_option( 'donate_version', self::VERSION );
|
366 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
367 |
}
|
368 |
|
369 |
|
612 |
|
613 |
if ( ! isset( $atts['random'] ) )
|
614 |
$atts['random'] = 1;
|
615 |
+
|
616 |
+
if ( ! isset( $atts['enable_schema'] ) )
|
617 |
+
$atts['enable_schema'] = 0;
|
618 |
}
|
619 |
|
620 |
$atts = wp_parse_args( $atts, self::get_defaults() );
|
736 |
|
737 |
|
738 |
public static function get_testimonials_html_js( $testimonials, $atts, $widget_number = null ) {
|
739 |
+
$not_found = self::get_not_found();
|
740 |
+
if ( $not_found )
|
741 |
+
return;
|
742 |
+
|
743 |
$scripts = array();
|
744 |
$scripts_internal = array();
|
745 |
|
767 |
|
768 |
$autoControls = $show_start_stop ? 'autoControls: true,' : '';
|
769 |
|
770 |
+
$slider_var = self::SLUG . $widget_number;
|
771 |
$javascript .= <<<EOF
|
772 |
var {$slider_var} = null;
|
773 |
|
868 |
|
869 |
|
870 |
public static function get_testimonials_html( $testimonials, $atts, $is_list = true, $widget_number = null ) {
|
|
|
871 |
$hide_not_found = $atts['hide_not_found'];
|
872 |
$paging = Testimonials_Widget_Settings::is_true( $atts['paging'] );
|
873 |
$paging_before = ( 'before' === strtolower( $atts['paging'] ) );
|
892 |
$testimonials = array(
|
893 |
array( 'testimonial_content' => esc_html__( 'No testimonials found', 'testimonials-widget' ) ),
|
894 |
);
|
895 |
+
|
896 |
+
self::set_not_found( true );
|
897 |
+
} else
|
898 |
+
self::set_not_found();
|
899 |
|
900 |
$pre_paging = '';
|
901 |
if ( $paging || $paging_before )
|
933 |
|
934 |
|
935 |
public static function get_testimonial_html( $testimonial, $atts, $is_list = true, $is_first = false, $widget_number = null ) {
|
|
|
936 |
$disable_quotes = $atts['disable_quotes'];
|
937 |
$do_image = ! $atts['hide_image'] && ! empty( $testimonial['testimonial_image'] );
|
938 |
$do_image_single = ! $atts['hide_image_single'];
|
957 |
if ( $keep_whitespace )
|
958 |
$class .= ' whitespace';
|
959 |
|
960 |
+
$post_id = $testimonial['post_id'];
|
961 |
+
if ( ! empty( $post_id ) )
|
962 |
+
$class = join( ' ', get_post_class( $class, $post_id ) );
|
963 |
else
|
964 |
$class = 'testimonials-widget type-testimonials-widget status-publish hentry ' . $class;
|
965 |
|
966 |
+
$class = apply_filters( 'testimonials_widget_get_testimonial_html_class', $class, $testimonial, $atts, $is_list, $is_first, $widget_number );
|
967 |
+
$div_open = '<!-- ' . self::ID . ":{$post_id}: -->";
|
968 |
+
$div_open .= '<div class="' . $class . '">';
|
969 |
|
970 |
if ( $do_schema && $do_content )
|
971 |
$div_open .= sprintf( self::$schema_div_open, self::$review_schema );
|
1077 |
|
1078 |
|
1079 |
public static function get_cite( $testimonial, $atts ) {
|
1080 |
+
extract( $testimonial );
|
1081 |
+
|
1082 |
+
$do_company = ! $atts['hide_company'] && ! empty( $testimonial_company );
|
1083 |
+
$do_email = ! $atts['hide_email'] && ! empty( $testimonial_email ) && is_email( $testimonial_email );
|
1084 |
+
$do_location = ! $atts['hide_location'] && ! empty( $testimonial_location );
|
1085 |
+
$do_source = ! $atts['hide_source'] && ! empty( $testimonial_source );
|
1086 |
+
$do_title = ! $atts['hide_title'] && ! empty( $testimonial_title );
|
1087 |
+
$do_url = ! $atts['hide_url'] && ! empty( $testimonial_url );
|
1088 |
$use_quote_tag = $atts['use_quote_tag'];
|
1089 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1090 |
$cite = '';
|
1091 |
|
1092 |
$done_url = false;
|
1447 |
$args['post_status'][] = 'draft';
|
1448 |
}
|
1449 |
|
1450 |
+
if ( $paging && ! empty( $atts['paged'] ) && is_singular() )
|
1451 |
$args['paged'] = $atts['paged'];
|
1452 |
|
1453 |
if ( ! $random && $meta_key ) {
|
1543 |
wp_reset_postdata();
|
1544 |
|
1545 |
$image_size = apply_filters( 'testimonials_widget_image_size', 'thumbnail' );
|
1546 |
+
if ( ! is_array( $image_size ) ) {
|
1547 |
+
global $_wp_additional_image_sizes;
|
1548 |
+
if ( ! empty( $_wp_additional_image_sizes[ $image_size ] ) )
|
1549 |
+
$gravatar_size = $_wp_additional_image_sizes[ $image_size ]['width'];
|
1550 |
+
else
|
1551 |
+
$gravatar_size = get_option( $image_size . '_size_w' );
|
1552 |
|
1553 |
+
$gravatar_size = apply_filters( 'testimonials_widget_gravatar_size', $gravatar_size );
|
1554 |
+
} else
|
1555 |
+
$gravatar_size = apply_filters( 'testimonials_widget_gravatar_size', $image_size );
|
|
|
|
|
|
|
|
|
1556 |
|
1557 |
$testimonial_data = array();
|
1558 |
|
1619 |
|
1620 |
|
1621 |
public function widgets_init() {
|
1622 |
+
require_once TW_PLUGIN_DIR_LIB . '/class-testimonials-widget-widget.php';
|
1623 |
|
1624 |
register_widget( 'Testimonials_Widget_Widget' );
|
1625 |
}
|
1631 |
* @SuppressWarnings(PHPMD.UnusedLocalVariable)
|
1632 |
*/
|
1633 |
public function add_meta_box_testimonials_widget() {
|
1634 |
+
require_once TW_PLUGIN_DIR_LIB . '/class-redrokk-metabox-class.php';
|
1635 |
|
1636 |
$fields = array(
|
1637 |
array(
|
1669 |
$fields = apply_filters( 'testimonials_widget_meta_box', $fields );
|
1670 |
|
1671 |
$meta_box = redrokk_metabox_class::getInstance(
|
1672 |
+
self::ID,
|
1673 |
array(
|
1674 |
'title' => esc_html__( 'Testimonial Data', 'testimonials-widget' ),
|
1675 |
'description' => '',
|
1765 |
if ( ! is_string( $string ) )
|
1766 |
return $string;
|
1767 |
|
1768 |
+
return trim( strip_shortcodes( strip_tags( $string ) ) );
|
1769 |
}
|
1770 |
|
1771 |
|
1772 |
+
/**
|
1773 |
+
*
|
1774 |
+
*
|
1775 |
+
* @SuppressWarnings(PHPMD.UnusedLocalVariable)
|
1776 |
+
*/
|
1777 |
public static function get_schema( $testimonial, $atts ) {
|
1778 |
foreach ( $testimonial as $key => $value ) {
|
1779 |
if ( 'testimonial_image' != $key )
|
1780 |
$testimonial[ $key ] = self::clean_string( $value );
|
1781 |
}
|
1782 |
|
1783 |
+
extract( $testimonial );
|
1784 |
+
|
1785 |
+
$do_company = ! $atts['hide_company'] && ! empty( $testimonial_company );
|
1786 |
+
$do_email = ! $atts['hide_email'] && ! empty( $testimonial_email ) && is_email( $testimonial_email );
|
1787 |
+
$do_image = ! $atts['hide_image'] && ! empty( $testimonial_image );
|
1788 |
+
$do_location = ! $atts['hide_location'] && ! empty( $testimonial_location );
|
1789 |
+
$do_source = ! $atts['hide_source'] && ! empty( $testimonial_source );
|
1790 |
+
$do_title = ! $atts['hide_title'] && ! empty( $testimonial_title );
|
1791 |
+
$do_url = ! $atts['hide_url'] && ! empty( $testimonial_url );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1792 |
|
1793 |
$item_reviewed = self::clean_string( $atts['item_reviewed'] );
|
1794 |
$item_reviewed_url = self::clean_string( $atts['item_reviewed_url'] );
|
2034 |
}
|
2035 |
|
2036 |
|
2037 |
+
public static function notice_2_15_0() {
|
2038 |
+
$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' ) );
|
2039 |
+
|
2040 |
+
self::notice_updated( $text );
|
2041 |
+
}
|
2042 |
+
|
2043 |
+
|
2044 |
+
public static function show_shortcodes() {
|
2045 |
+
echo '<div class="wrap">';
|
2046 |
+
echo '<div class="icon32" id="icon-options-general"></div>';
|
2047 |
+
echo '<h2>' . esc_html__( 'Testimonials Shortcode Examples', 'testimonials-widget' ) . '</h2>';
|
2048 |
+
|
2049 |
+
$shortcodes = <<<EOD
|
2050 |
+
<h3>[testimonialswidget_list]</h3>
|
2051 |
+
|
2052 |
+
<ul>
|
2053 |
+
<li><code>[testimonialswidget_list category="category-name"]</code> - Testimonial list by category</li>
|
2054 |
+
<li><code>[testimonialswidget_list category=product hide_not_found=true]</code> - Testimonial list by category and hide "No testimonials found" message</li>
|
2055 |
+
<li><code>[testimonialswidget_list category=product tags=widget limit=5]</code> - Testimonial list by tag, showing 5 at most</li>
|
2056 |
+
<li><code>[testimonialswidget_list char_limit=0 limit=-1]</code> - Show all testimonials on one page</li>
|
2057 |
+
<li><code>[testimonialswidget_list char_limit=0 target=_new limit=3 disable_quotes=true]</code> - Show 3 full-length testimonials, with opening and closing quote marks removed</li>
|
2058 |
+
<li><code>[testimonialswidget_list hide_source=true hide_url=true]</code> - Show testimonial list with source and urls hidden</li>
|
2059 |
+
<li><code>[testimonialswidget_list ids="1,11,111" paging=false]</code> - Show only these 3 testimonials</li>
|
2060 |
+
<li><code>[testimonialswidget_list meta_key=testimonials-widget-company order=asc limit=15]</code> - Show 15 testimonials, in company order</li>
|
2061 |
+
<li><code>[testimonialswidget_list order=ASC orderby=title]</code> - List testimonials by post title</li>
|
2062 |
+
<li><code>[testimonialswidget_list 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>
|
2063 |
+
</ul>
|
2064 |
+
|
2065 |
+
<h3>[testimonialswidget_widget]</h3>
|
2066 |
+
|
2067 |
+
<ul>
|
2068 |
+
<li><code>[testimonialswidget_widget category=product order=asc height=300]</code> - Show rotating testimonials, in a fixed height container, of the product category, lowest post ids first</li>
|
2069 |
+
<li><code>[testimonialswidget_widget min_height=250 max_height=500]</code> - Show rotating testimonials in a box no smaller or bigger than 250 to 500 pixels in height</li>
|
2070 |
+
<li><code>[testimonialswidget_widget tags=sometag random=true]</code> - Show rotating, random testimonials having tag "sometag"</li>
|
2071 |
+
</ul>
|
2072 |
+
EOD;
|
2073 |
+
|
2074 |
+
$shortcodes = apply_filters( 'testimonials_widget_shortcodes', $shortcodes );
|
2075 |
+
|
2076 |
+
echo $shortcodes;
|
2077 |
+
echo '</div>';
|
2078 |
+
}
|
2079 |
+
|
2080 |
+
|
2081 |
+
public static function set_not_found( $not_found = false ) {
|
2082 |
+
self::$not_found = $not_found;
|
2083 |
+
}
|
2084 |
+
|
2085 |
+
|
2086 |
+
public static function get_not_found() {
|
2087 |
+
return self::$not_found;
|
2088 |
+
}
|
2089 |
+
|
2090 |
+
|
2091 |
+
public static function version_check() {
|
2092 |
+
require_once ABSPATH . 'wp-admin/includes/plugin.php';
|
2093 |
+
|
2094 |
+
$good_version = true;
|
2095 |
+
if ( ! is_plugin_active( self::PLUGIN_BASE ) )
|
2096 |
+
$good_version = false;
|
2097 |
+
|
2098 |
+
return $good_version;
|
2099 |
+
}
|
2100 |
+
|
2101 |
+
|
2102 |
+
/**
|
2103 |
+
*
|
2104 |
+
*
|
2105 |
+
* @SuppressWarnings(PHPMD.Superglobals)
|
2106 |
+
*/
|
2107 |
+
public static function do_load() {
|
2108 |
+
$do_load = false;
|
2109 |
+
if ( ! empty( $GLOBALS['pagenow'] ) && in_array( $GLOBALS['pagenow'], array( 'options.php' ) ) ) {
|
2110 |
+
$do_load = true;
|
2111 |
+
} elseif ( ! empty( $_REQUEST['post_type'] ) && self::PT == $_REQUEST['post_type'] ) {
|
2112 |
+
if ( ! empty( $GLOBALS['pagenow'] ) && in_array( $GLOBALS['pagenow'], array( 'edit.php' ) ) ) {
|
2113 |
+
$do_load = true;
|
2114 |
+
} elseif ( ! empty( $_REQUEST['page'] ) && Testimonials_Widget_Settings::ID == $_REQUEST['page'] ) {
|
2115 |
+
$do_load = true;
|
2116 |
+
}
|
2117 |
+
}
|
2118 |
|
2119 |
+
return $do_load;
|
2120 |
}
|
2121 |
|
2122 |
|
2133 |
* @SuppressWarnings(PHPMD.UnusedLocalVariable)
|
2134 |
*/
|
2135 |
function testimonialswidget_init() {
|
2136 |
+
if ( Testimonials_Widget::version_check() ) {
|
2137 |
+
require_once TW_PLUGIN_DIR_LIB . '/class-testimonials-widget-settings.php';
|
2138 |
|
|
|
|
|
2139 |
global $Testimonials_Widget_Settings;
|
2140 |
if ( is_null( $Testimonials_Widget_Settings ) )
|
2141 |
$Testimonials_Widget_Settings = new Testimonials_Widget_Settings();
|