Version Description
= 2.16.0 =
- Requires PHP 5.3+
= 2.15.0 =
- If upgrading, bxSlider will not be enabled by default. You must enable it in your widget and global settings. CSS customizations must be reviewed to have the
.active
and.display-none
classes removed. The main.testimonials-widget-testimonial
class also need thedisplay: none;
andclear: left;
removed.
= 2.14.0 =
- 60 modifications See Changelog
- CSS wp_register_style and wp_enqueue_style slug changed from 'testimonials-widget' to 'Testimonials_Widget'
- Gravatar image size now based upon Thumbnail size in Media Settings
- Scripts
ksort
removed. Usearray_unshift
in yourtestimonials_widget_testimonials_js
filters instead. - Testimonials > Settings, General tab, option Enable Review Schema? is enabled by default.
= 2.13.6 =
- IE 7 CSS moved to separate file. Include via Testimonials > Settings if needed
= 2.12.0 =
- CSS and JavaScript renaming
-
bottom_text
renamed tobottom-text
-
close_quote
renamed toclose-quote
-
display_none
renamed todisplay-none
-
join_location
renamed tojoin-location
-
join_title
renamed tojoin-title
-
open_quote
renamed toopen-quote
-
testimonialswidget_testimonial
renamed totestimonials-widget-testimonial
-
testimonialswidget_testimonials
renamed totestimonials-widget-testimonials
-
= 2.11.3 =
- Correct filter name
testimonials_widget_next_posts_link
totestimonials_widget_next_posts_link_text
= 2.11.0 =
- CSS class names are simplified. For the most part, other than
testimonialswidget_testimonial
removetestimonialswidget_
from the CSS class name in your CSS customizations.- Ex:
.testimonialswidget_join
becomes.join
- Ex:
.testimonialswidget_author
becomes.author
- Ex:
- Testimonials are now formatted using
blockquote
thanq
for HTML5 compliance. If you needq
tag formatting, enable it at WP Admin > Testimonials > Settings, Compatibility & Reset tab-
cite
is nowdiv.credit
-
= 2.8.0 =
- Deprecated
-
hide_author
nowhide_source
-
- Removed filters
testimonials_widget_options_update
,testimonials_widget_options_form
- Use
testimonials_widget_validate_settings
andtestimonials_widget_settings
instead
- Use
- Renamed variable and related class
widget_text
tobottom_text
= 2.7.3 =
- Quotes are no longer handled via
q
,p:before
, orp:after
CSS. It's handled via.testimonialswidget_testimonial .testimonialswidget_open_quote:before
and.testimonialswidget_testimonial .testimonialswidget_close_quote:after
- This change was made to keep consistency in how quotes were managed and to reduce the number of exception cases. In the end, this is simpler.
= 2.7.0 =
- Quotes with
keep_whitespace=true
aren't applied via CSS.testimonialswidget_testimonial q
tag anymore, but.testimonialswidget_testimonial q p:first-child:before
and.testimonialswidget_testimonial q p:last-child:after
- Widget testimonial
p
tags are no longer CSSdisplay: inline
,display: block
as expected
= 2.4.1 =
- Paging is on by default, except for widgets
= 2.0.0 =
- CSS
- Class
testimonialswidget_company
replacestestimonialswidget_source
- Class
testimonialswidget_source
replacestestimonialswidget_author
- The tighten widget display up, p tags within q are displayed inline.
- Class
- JavaScript
- The JavaScript for rotating testimonials is moved to the footer. As such, your theme requires
wp_footer()
in the footer.
- The JavaScript for rotating testimonials is moved to the footer. As such, your theme requires
- Shortcode options
-
hide_source
replaced byhide_url
-
hide_author
replaced byhide_source
-
- Testimonials
- Migration from the old custom table to new custom post type is automatically done. Import might take a few moments to complete.
- Company, URL and email details are attempted to be identified and placed properly based upon the original author and source fields. The company is "guessed" from the
author
field when there's a ", " or " of " context. If thesource
is an email, it's saved as such. Otherwise, it's assumed to be a URL. - Public testimonials are saved as Published. Non-public testimonials are marked as Private.
- Widget options
- "Show author" and "Show source" options are replaced by "Hide source" and "Hide URL" respectively. There's no backwards compatibility for these changes.
- Default
min-height
is now 250px than 150px.
Download this release
Release Info
Developer | comprock |
Plugin | Testimonials Widget |
Version | 2.16.2 |
Comparing to | |
See all releases |
Code changes from version 2.16.1 to 2.16.2
- CHANGELOG.md +3 -0
- ci/phpcs.travis.ruleset.xml +1 -0
- languages/testimonials-widget.pot +3 -3
- lib/aihrus/.travis.yml +42 -0
- lib/aihrus/CHANGELOG.md +1 -0
- lib/aihrus/TODO.md +1 -1
- lib/aihrus/ci/bin/install-wp-tests.sh +32 -0
- lib/aihrus/ci/phpcs.ruleset.xml +35 -0
- lib/aihrus/ci/phpcs.travis.ruleset.xml +41 -0
- lib/aihrus/ci/phpmd.ruleset.xml +21 -0
- lib/aihrus/ci/tests/bootstrap.php +13 -0
- lib/aihrus/ci/tests/class.sample-test.php +34 -0
- lib/aihrus/class-aihrus-common.php +2 -2
- lib/aihrus/class-aihrus-settings.php +140 -140
- lib/aihrus/class-aihrus-widget.php +67 -67
- readme.txt +7 -1
- testimonials-widget.php +2 -2
CHANGELOG.md
CHANGED
@@ -2,6 +2,9 @@
|
|
2 |
|
3 |
## master
|
4 |
|
|
|
|
|
|
|
5 |
## 2.16.1
|
6 |
* $this to __CLASS__
|
7 |
|
2 |
|
3 |
## master
|
4 |
|
5 |
+
## 2.16.2
|
6 |
+
* **Version 2.16.0 requires PHP 5.3+**
|
7 |
+
|
8 |
## 2.16.1
|
9 |
* $this to __CLASS__
|
10 |
|
ci/phpcs.travis.ruleset.xml
CHANGED
@@ -4,6 +4,7 @@
|
|
4 |
Custom phpcs rules to check for Aihrus' WordPress projects
|
5 |
</description>
|
6 |
|
|
|
7 |
<exclude-pattern>js/jquery.bxslider.js</exclude-pattern>
|
8 |
<exclude-pattern>js/jquery.easing.1.3.js</exclude-pattern>
|
9 |
<exclude-pattern>js/jquery.fitvids.js</exclude-pattern>
|
4 |
Custom phpcs rules to check for Aihrus' WordPress projects
|
5 |
</description>
|
6 |
|
7 |
+
<exclude-pattern>ci/</exclude-pattern>
|
8 |
<exclude-pattern>js/jquery.bxslider.js</exclude-pattern>
|
9 |
<exclude-pattern>js/jquery.easing.1.3.js</exclude-pattern>
|
10 |
<exclude-pattern>js/jquery.fitvids.js</exclude-pattern>
|
languages/testimonials-widget.pot
CHANGED
@@ -2,9 +2,9 @@
|
|
2 |
# This file is distributed under the same license as the Testimonials package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Testimonials 2.16.
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/testimonials-widget\n"
|
7 |
-
"POT-Creation-Date: 2013-11-28
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
@@ -179,7 +179,7 @@ msgstr ""
|
|
179 |
msgid "Widget Title"
|
180 |
msgstr ""
|
181 |
|
182 |
-
#. #-#-#-#-# testimonials-widget.pot (Testimonials 2.16.
|
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
|
2 |
# This file is distributed under the same license as the Testimonials package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Testimonials 2.16.2\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/testimonials-widget\n"
|
7 |
+
"POT-Creation-Date: 2013-11-28 07:01:46+00:00\n"
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
179 |
msgid "Widget Title"
|
180 |
msgstr ""
|
181 |
|
182 |
+
#. #-#-#-#-# testimonials-widget.pot (Testimonials 2.16.2) #-#-#-#-#
|
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
|
lib/aihrus/.travis.yml
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
language:
|
2 |
+
- php
|
3 |
+
|
4 |
+
php:
|
5 |
+
- 5.3
|
6 |
+
- 5.4
|
7 |
+
- 5.5
|
8 |
+
|
9 |
+
env:
|
10 |
+
- WP_VERSION=master WP_MULTISITE=1
|
11 |
+
- WP_VERSION=master WP_MULTISITE=0
|
12 |
+
- WP_VERSION=3.7.1 WP_MULTISITE=1
|
13 |
+
- WP_VERSION=3.7.1 WP_MULTISITE=0
|
14 |
+
|
15 |
+
before_install:
|
16 |
+
- sudo apt-get update
|
17 |
+
- git submodule update --init --recursive
|
18 |
+
|
19 |
+
before_script:
|
20 |
+
- pear config-set auto_discover 1
|
21 |
+
- pear install PHP_CodeSniffer
|
22 |
+
- pear install phpunit/phpcpd
|
23 |
+
- pear channel-discover pear.phpmd.org
|
24 |
+
- pear channel-discover pear.pdepend.org
|
25 |
+
- pear install phpmd/PHP_PMD
|
26 |
+
- phpenv rehash
|
27 |
+
- git clone git://github.com/mrchrisadams/WordPress-Coding-Standards.git $(pear config-get php_dir)/PHP/CodeSniffer/Standards/WordPress
|
28 |
+
- export PHPMD_EXCLUDE="Akismet.class.php,class-redrokk-metabox-class.php,video-quick-edit.php,inc.flickr.php,screen-meta-links.php,EDD_License_Handler.php,EDD_SL_Plugin_Updater.php,jquery.cookie.js,jquery.bxslider.js,jquery.easing.1.3.js,jquery.fitvids.js"
|
29 |
+
# - export WP_TESTS_DIR=/tmp/wordpress-tests/
|
30 |
+
# - bash ci/bin/install-wp-tests.sh wordpress_test root '' ${WP_VERSION}
|
31 |
+
|
32 |
+
script:
|
33 |
+
- find . \( -name '*.php' -o -name '*.inc' \) -exec php -lf {} \;
|
34 |
+
- phpcs -s -n --standard=ci/phpcs.travis.ruleset.xml .
|
35 |
+
- phpcpd .
|
36 |
+
- phpmd . --exclude ${PHPMD_EXCLUDE} text ci/phpmd.ruleset.xml
|
37 |
+
# - phpunit
|
38 |
+
|
39 |
+
notifications:
|
40 |
+
email:
|
41 |
+
on_success: change
|
42 |
+
on_failure: change
|
lib/aihrus/CHANGELOG.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
# CHANGELOG Aihrus Framework
|
2 |
|
3 |
## master
|
|
|
4 |
* Add TODO
|
5 |
* Add abstract class Aihrus_Settings
|
6 |
* Add abstract class Aihrus_Widget
|
1 |
# CHANGELOG Aihrus Framework
|
2 |
|
3 |
## master
|
4 |
+
* BUGFIX Method version not static
|
5 |
* Add TODO
|
6 |
* Add abstract class Aihrus_Settings
|
7 |
* Add abstract class Aihrus_Widget
|
lib/aihrus/TODO.md
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
# TODO Aihrus Framework
|
2 |
|
3 |
-
*
|
1 |
# TODO Aihrus Framework
|
2 |
|
3 |
+
* Widget title should use `create_link
|
lib/aihrus/ci/bin/install-wp-tests.sh
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/usr/bin/env bash
|
2 |
+
|
3 |
+
if [ $# -lt 3 ]; then
|
4 |
+
echo "usage: ${0} <db-name> <db-user> <db-pass> [wp-version]"
|
5 |
+
exit 1
|
6 |
+
fi
|
7 |
+
|
8 |
+
DB_NAME=${1}
|
9 |
+
DB_USER=${2}
|
10 |
+
DB_PASS=${3}
|
11 |
+
WP_VERSION=${4-master}
|
12 |
+
|
13 |
+
set -ex
|
14 |
+
|
15 |
+
# set up a WP install
|
16 |
+
WP_CORE_DIR=/tmp/wordpress/
|
17 |
+
mkdir -p ${WP_CORE_DIR}
|
18 |
+
wget -nv -O /tmp/wordpress.tar.gz https://github.com/WordPress/WordPress/tarball/${WP_VERSION}
|
19 |
+
tar --strip-components=1 -zxmf /tmp/wordpress.tar.gz -C ${WP_CORE_DIR}
|
20 |
+
|
21 |
+
# set up testing suite
|
22 |
+
svn co --ignore-externals --quiet http://unit-tests.svn.wordpress.org/trunk/ ${WP_TESTS_DIR}
|
23 |
+
|
24 |
+
cd ${WP_TESTS_DIR}
|
25 |
+
cp wp-tests-config-sample.php wp-tests-config.php
|
26 |
+
sed -i "s:dirname( __FILE__ ) . '/wordpress/':'${WP_CORE_DIR}':" wp-tests-config.php
|
27 |
+
sed -i "s/yourdbnamehere/${DB_NAME}/" wp-tests-config.php
|
28 |
+
sed -i "s/yourusernamehere/${DB_USER}/" wp-tests-config.php
|
29 |
+
sed -i "s/yourpasswordhere/${DB_PASS}/" wp-tests-config.php
|
30 |
+
|
31 |
+
# create database
|
32 |
+
mysqladmin create ${DB_NAME} --user="${DB_USER}" --password="${DB_PASS}"
|
lib/aihrus/ci/phpcs.ruleset.xml
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<ruleset name="Aihrus">
|
3 |
+
<description>
|
4 |
+
Custom phpcs rules to check for Aihrus' WordPress projects
|
5 |
+
</description>
|
6 |
+
|
7 |
+
<exclude-pattern>lib/screen-meta-links.php</exclude-pattern>
|
8 |
+
<exclude-pattern>jquery-ui-1.10.3.custom.css</exclude-pattern>
|
9 |
+
<exclude-pattern>jquery-ui-1.10.3.custom.min.css</exclude-pattern>
|
10 |
+
|
11 |
+
<rule ref="Generic">
|
12 |
+
<exclude name="Generic.CodeAnalysis.UnusedFunctionParameter.Found" />
|
13 |
+
<exclude name="Generic.ControlStructures.InlineControlStructure.NotAllowed" />
|
14 |
+
<exclude name="Generic.Files.EndFileNoNewline.Found" />
|
15 |
+
<exclude name="Generic.Files.LineLength.MaxExceeded" />
|
16 |
+
<exclude name="Generic.Formatting.DisallowMultipleStatements.SameLine" />
|
17 |
+
<exclude name="Generic.Formatting.NoSpaceAfterCast.SpaceFound" />
|
18 |
+
<exclude name="Generic.Functions.OpeningFunctionBraceBsdAllman.BraceOnSameLine" />
|
19 |
+
<exclude name="Generic.Metrics.CyclomaticComplexity.MaxExceeded" />
|
20 |
+
<exclude name="Generic.NamingConventions.CamelCapsFunctionName.ScopeNotCamelCaps" />
|
21 |
+
<exclude name="Generic.PHP.CharacterBeforePHPOpeningTag.Found" />
|
22 |
+
<exclude name="Generic.PHP.UpperCaseConstant.Found" />
|
23 |
+
<exclude name="Generic.WhiteSpace.DisallowTabIndent.TabsUsed" />
|
24 |
+
<exclude name="Generic.WhiteSpace.ScopeIndent.Incorrect" />
|
25 |
+
</rule>
|
26 |
+
|
27 |
+
<rule ref="Squiz.PHP.CommentedOutCode"/>
|
28 |
+
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace">
|
29 |
+
<exclude name="Squiz.WhiteSpace.SuperfluousWhitespace.EndLine" />
|
30 |
+
</rule>
|
31 |
+
|
32 |
+
<rule ref="WordPress">
|
33 |
+
<exclude name="WordPress.XSS.EscapeOutput" />
|
34 |
+
</rule>
|
35 |
+
</ruleset>
|
lib/aihrus/ci/phpcs.travis.ruleset.xml
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<ruleset name="Aihrus">
|
3 |
+
<description>
|
4 |
+
Custom phpcs rules to check for Aihrus' WordPress projects
|
5 |
+
</description>
|
6 |
+
|
7 |
+
<exclude-pattern>lib/screen-meta-links.php</exclude-pattern>
|
8 |
+
<exclude-pattern>jquery-ui-1.10.3.custom.css</exclude-pattern>
|
9 |
+
<exclude-pattern>jquery-ui-1.10.3.custom.min.css</exclude-pattern>
|
10 |
+
|
11 |
+
<rule ref="Generic">
|
12 |
+
<exclude name="Generic.CodeAnalysis.UnusedFunctionParameter.Found" />
|
13 |
+
<exclude name="Generic.ControlStructures.InlineControlStructure.NotAllowed" />
|
14 |
+
<exclude name="Generic.Files.EndFileNoNewline.Found" />
|
15 |
+
<exclude name="Generic.Files.LineLength.MaxExceeded" />
|
16 |
+
<exclude name="Generic.Formatting.DisallowMultipleStatements.SameLine" />
|
17 |
+
<exclude name="Generic.Formatting.NoSpaceAfterCast.SpaceFound" />
|
18 |
+
<exclude name="Generic.Functions.OpeningFunctionBraceBsdAllman.BraceOnSameLine" />
|
19 |
+
<exclude name="Generic.Metrics.CyclomaticComplexity.MaxExceeded" />
|
20 |
+
<exclude name="Generic.NamingConventions.CamelCapsFunctionName.ScopeNotCamelCaps" />
|
21 |
+
<exclude name="Generic.PHP.CharacterBeforePHPOpeningTag.Found" />
|
22 |
+
<exclude name="Generic.PHP.UpperCaseConstant.Found" />
|
23 |
+
<exclude name="Generic.WhiteSpace.DisallowTabIndent.TabsUsed" />
|
24 |
+
<exclude name="Generic.WhiteSpace.ScopeIndent.Incorrect" />
|
25 |
+
</rule>
|
26 |
+
|
27 |
+
<rule ref="Squiz.PHP.CommentedOutCode">
|
28 |
+
<exclude name="Squiz.PHP.CommentedOutCode.Found" />
|
29 |
+
</rule>
|
30 |
+
|
31 |
+
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace">
|
32 |
+
<exclude name="Squiz.WhiteSpace.SuperfluousWhitespace.EndLine" />
|
33 |
+
</rule>
|
34 |
+
|
35 |
+
<rule ref="WordPress">
|
36 |
+
<exclude name="WordPress.XSS.EscapeOutput" />
|
37 |
+
<!-- travis-ci.org is puking on switch/case indentation -->
|
38 |
+
<exclude name="WordPress.WhiteSpace.ScopeIndent.Incorrect" />
|
39 |
+
<exclude name="WordPress.WhiteSpace.ControlStructureSpacing" />
|
40 |
+
</rule>
|
41 |
+
</ruleset>
|
lib/aihrus/ci/phpmd.ruleset.xml
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<ruleset name="Aihrus"
|
3 |
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
4 |
+
xsi:schemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd"
|
5 |
+
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
|
6 |
+
<description>
|
7 |
+
Custom phpmd rules to check for Aihrus' WordPress projects
|
8 |
+
</description>
|
9 |
+
|
10 |
+
<!-- @ref http://phpmd.org/documentation/creating-a-ruleset.html -->
|
11 |
+
|
12 |
+
<!--
|
13 |
+
<rule ref="rulesets/codesize.xml" />
|
14 |
+
-->
|
15 |
+
<rule ref="rulesets/controversial.xml/Superglobals" />
|
16 |
+
<rule ref="rulesets/design.xml" />
|
17 |
+
<rule ref="rulesets/naming.xml">
|
18 |
+
<exclude name="ShortVariable" />
|
19 |
+
</rule>
|
20 |
+
<rule ref="rulesets/unusedcode.xml" />
|
21 |
+
</ruleset>
|
lib/aihrus/ci/tests/bootstrap.php
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once getenv( 'WP_TESTS_DIR' ) . '/includes/functions.php';
|
4 |
+
|
5 |
+
function _manually_load_plugin() {
|
6 |
+
require dirname( __FILE__ ) . '/../../wordpress-starter.php';
|
7 |
+
}
|
8 |
+
|
9 |
+
|
10 |
+
tests_add_filter( 'muplugins_loaded', '_manually_load_plugin' );
|
11 |
+
|
12 |
+
require getenv( 'WP_TESTS_DIR' ) . '/includes/bootstrap.php';
|
13 |
+
?>
|
lib/aihrus/ci/tests/class.sample-test.php
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class SampleTest extends WP_UnitTestCase {
|
3 |
+
function test_sample() {
|
4 |
+
// replace this with some actual testing code
|
5 |
+
$this->assertTrue( true );
|
6 |
+
}
|
7 |
+
|
8 |
+
|
9 |
+
/**
|
10 |
+
*
|
11 |
+
*
|
12 |
+
* @SuppressWarnings(PHPMD.Superglobals)
|
13 |
+
*/
|
14 |
+
|
15 |
+
|
16 |
+
function set_post( $key, $value ) {
|
17 |
+
$_POST[$key] = $_REQUEST[$key] = addslashes( $value );
|
18 |
+
}
|
19 |
+
|
20 |
+
|
21 |
+
/**
|
22 |
+
*
|
23 |
+
*
|
24 |
+
* @SuppressWarnings(PHPMD.Superglobals)
|
25 |
+
*/
|
26 |
+
function unset_post( $key ) {
|
27 |
+
unset( $_POST[$key], $_REQUEST[$key] );
|
28 |
+
}
|
29 |
+
|
30 |
+
|
31 |
+
}
|
32 |
+
|
33 |
+
|
34 |
+
?>
|
lib/aihrus/class-aihrus-common.php
CHANGED
@@ -157,7 +157,7 @@ EOD;
|
|
157 |
}
|
158 |
|
159 |
|
160 |
-
public function version( $version ) {
|
161 |
$version .= '-' . static::ID . '-' . static::VERSION;
|
162 |
|
163 |
return $version;
|
@@ -175,7 +175,7 @@ EOD;
|
|
175 |
*/
|
176 |
|
177 |
|
178 |
-
public function array_values_recursive( $ary ) {
|
179 |
$lst = array();
|
180 |
foreach ( array_keys( $ary ) as $k ) {
|
181 |
$v = $ary[$k];
|
157 |
}
|
158 |
|
159 |
|
160 |
+
public static function version( $version ) {
|
161 |
$version .= '-' . static::ID . '-' . static::VERSION;
|
162 |
|
163 |
return $version;
|
175 |
*/
|
176 |
|
177 |
|
178 |
+
public static function array_values_recursive( $ary ) {
|
179 |
$lst = array();
|
180 |
foreach ( array_keys( $ary ) as $k ) {
|
181 |
$v = $ary[$k];
|
lib/aihrus/class-aihrus-settings.php
CHANGED
@@ -209,14 +209,14 @@ abstract class Aihrus_Settings {
|
|
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">';
|
@@ -333,105 +333,105 @@ abstract class Aihrus_Settings {
|
|
333 |
$std = esc_attr( $std );
|
334 |
|
335 |
switch ( $type ) {
|
336 |
-
|
337 |
-
|
338 |
|
339 |
-
|
340 |
-
|
341 |
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
|
346 |
-
|
347 |
-
|
348 |
|
349 |
-
|
350 |
-
|
351 |
|
352 |
-
|
353 |
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
|
358 |
-
|
359 |
-
|
360 |
|
361 |
-
|
362 |
|
363 |
-
|
364 |
-
|
365 |
|
366 |
-
|
367 |
-
|
368 |
|
369 |
-
|
370 |
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
|
377 |
-
|
378 |
-
|
379 |
|
380 |
-
|
381 |
-
|
382 |
|
383 |
-
|
384 |
-
|
385 |
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
|
390 |
-
|
391 |
-
|
392 |
|
393 |
-
|
394 |
-
|
395 |
|
396 |
-
|
397 |
|
398 |
-
|
399 |
-
|
400 |
|
401 |
-
|
402 |
-
|
403 |
|
404 |
-
|
405 |
|
406 |
-
|
407 |
-
|
408 |
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
|
413 |
-
|
414 |
-
|
415 |
|
416 |
-
|
417 |
-
|
418 |
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
|
423 |
-
|
424 |
-
|
425 |
|
426 |
-
|
427 |
-
|
428 |
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
|
433 |
-
|
434 |
-
|
435 |
}
|
436 |
|
437 |
if ( ! $do_echo )
|
@@ -559,77 +559,77 @@ abstract class Aihrus_Settings {
|
|
559 |
|
560 |
public static function validators( $validate, $id, &$input, $default, &$errors ) {
|
561 |
switch ( $validate ) {
|
562 |
-
|
563 |
-
|
564 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
565 |
$input[ $id ] = $validate( $input[ $id ] );
|
566 |
-
|
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 |
|
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">';
|
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 )
|
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 |
|
lib/aihrus/class-aihrus-widget.php
CHANGED
@@ -163,40 +163,40 @@ abstract class Aihrus_Widget extends WP_Widget implements Aihrus_Widget_Interfac
|
|
163 |
|
164 |
$do_return = false;
|
165 |
switch ( $type ) {
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
|
170 |
-
|
171 |
-
|
172 |
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
|
177 |
-
|
178 |
|
179 |
-
|
180 |
-
|
181 |
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
|
186 |
-
|
187 |
-
|
188 |
|
189 |
-
|
190 |
-
|
191 |
|
192 |
-
|
193 |
-
|
194 |
|
195 |
-
|
196 |
-
|
197 |
|
198 |
-
|
199 |
-
|
200 |
}
|
201 |
|
202 |
if ( $do_return )
|
@@ -214,66 +214,66 @@ abstract class Aihrus_Widget extends WP_Widget implements Aihrus_Widget_Interfac
|
|
214 |
echo '<p>';
|
215 |
|
216 |
switch ( $type ) {
|
217 |
-
|
218 |
-
|
219 |
|
220 |
-
|
221 |
-
|
222 |
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
|
227 |
-
|
228 |
-
|
229 |
|
230 |
-
|
231 |
-
|
232 |
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
|
244 |
-
|
245 |
-
|
246 |
|
247 |
-
|
248 |
-
|
249 |
|
250 |
-
|
251 |
-
|
252 |
|
253 |
-
|
254 |
-
|
255 |
|
256 |
-
|
257 |
-
|
258 |
|
259 |
-
|
260 |
-
|
261 |
|
262 |
-
|
263 |
-
|
264 |
|
265 |
-
|
266 |
-
|
267 |
|
268 |
-
|
269 |
-
|
270 |
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
|
275 |
-
|
276 |
-
|
277 |
}
|
278 |
|
279 |
if ( ! empty( $desc ) )
|
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 )
|
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 ) )
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ Donate link: http://aihr.us/about-aihrus/donate/
|
|
5 |
Tags: client, customer, portfolio, quotations, quote, quotes, random, recommendation, reference, review, reviews, testimonial, testimonials, testimony, wpml
|
6 |
Requires at least: 3.6
|
7 |
Tested up to: 3.8.0
|
8 |
-
Stable tag: 2.16.
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
@@ -42,6 +42,8 @@ Through categories and tagging, you can create organizational structures based u
|
|
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 |
|
47 |
* API to manipulate testimonials output and selection
|
@@ -403,6 +405,10 @@ See [Changelog](https://github.com/michael-cannon/testimonials-widget/blob/maste
|
|
403 |
|
404 |
== Upgrade Notice ==
|
405 |
|
|
|
|
|
|
|
|
|
406 |
= 2.15.0 =
|
407 |
|
408 |
* If upgrading, bxSlider will not be enabled by default. You must enable it in your widget and global settings. CSS customizations must be reviewed to have the `.active` and `.display-none` classes removed. The main `.testimonials-widget-testimonial` class also need the `display: none;` and `clear: left;` removed.
|
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.2
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
42 |
|
43 |
The single testimonial view supports image, source, title, location, email, company and URL details with optional Review schema.
|
44 |
|
45 |
+
**Version 2.16.0 requires PHP 5.3+** [notice](https://aihrus.zendesk.com/entries/30678006-Testimonials-2-16-0-Requires-PHP-5-3-)
|
46 |
+
|
47 |
= Primary Features =
|
48 |
|
49 |
* API to manipulate testimonials output and selection
|
405 |
|
406 |
== Upgrade Notice ==
|
407 |
|
408 |
+
= 2.16.0 =
|
409 |
+
|
410 |
+
* [Requires PHP 5.3+](https://aihrus.zendesk.com/entries/30678006-Testimonials-2-16-0-Requires-PHP-5-3-)
|
411 |
+
|
412 |
= 2.15.0 =
|
413 |
|
414 |
* If upgrading, bxSlider will not be enabled by default. You must enable it in your widget and global settings. CSS customizations must be reviewed to have the `.active` and `.display-none` classes removed. The main `.testimonials-widget-testimonial` class also need the `display: none;` and `clear: left;` removed.
|
testimonials-widget.php
CHANGED
@@ -3,7 +3,7 @@
|
|
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.
|
7 |
* Author: Michael Cannon
|
8 |
* Author URI: http://aihr.us/resume/
|
9 |
* License: GPLv2 or later
|
@@ -38,7 +38,7 @@ class Testimonials_Widget extends Aihrus_Common {
|
|
38 |
const PLUGIN_BASE = 'testimonials-widget/testimonials-widget.php';
|
39 |
const PT = 'testimonials-widget';
|
40 |
const SLUG = 'tw_';
|
41 |
-
const VERSION = '2.16.
|
42 |
|
43 |
private static $found_posts = 0;
|
44 |
private static $max_num_pages = 0;
|
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.2
|
7 |
* Author: Michael Cannon
|
8 |
* Author URI: http://aihr.us/resume/
|
9 |
* License: GPLv2 or later
|
38 |
const PLUGIN_BASE = 'testimonials-widget/testimonials-widget.php';
|
39 |
const PT = 'testimonials-widget';
|
40 |
const SLUG = 'tw_';
|
41 |
+
const VERSION = '2.16.2';
|
42 |
|
43 |
private static $found_posts = 0;
|
44 |
private static $max_num_pages = 0;
|