From d5c0d81106c270e57729b5cb0444c4d9e9d5942c Mon Sep 17 00:00:00 2001 From: Ustimenko Alexander Date: Sun, 16 Nov 2014 03:43:23 +0700 Subject: [PATCH 1/4] Remove "custom" out-of-border numbers formating from test page --- css/public.css | 2 -- 1 file changed, 2 deletions(-) diff --git a/css/public.css b/css/public.css index e7dd4d1a..f09e8b79 100644 --- a/css/public.css +++ b/css/public.css @@ -9,8 +9,6 @@ .wpt_test .question .title .number { font-weight: normal; display: inline-block; - width: 3em; - margin-left: -3.5em; padding-right: 0.5em; text-align: right; } From df2e3b028b96d66d3346651d38180c94ff482d6d Mon Sep 17 00:00:00 2001 From: Ustimenko Alexander Date: Sun, 16 Nov 2014 04:35:17 +0700 Subject: [PATCH 2/4] Strip new lines in form to pass wpautop filter --- src/Doer/TestPasser.php | 7 ++++++- src/Template/Test/Passer/fill-form.php | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Doer/TestPasser.php b/src/Doer/TestPasser.php index 954e3a16..10400bce 100644 --- a/src/Doer/TestPasser.php +++ b/src/Doer/TestPasser.php @@ -59,7 +59,12 @@ public function renderTestContent($content) ); } - return $this->render($template, $params); + return preg_replace_callback('||s', array($this, 'stripNewLines'), $this->render($template, $params)); + } + + private function stripNewLines($matches) + { + return str_replace('> <', '><', preg_replace('/[\n\r\s]+/s', ' ', $matches[0])); } private function getTestPassingAction() diff --git a/src/Template/Test/Passer/fill-form.php b/src/Template/Test/Passer/fill-form.php index ee88d0ba..db79fc71 100644 --- a/src/Template/Test/Passer/fill-form.php +++ b/src/Template/Test/Passer/fill-form.php @@ -19,9 +19,9 @@
.getTitle() ?> +
- getAnswers() as $answer): /* @var $answer WpTesting_Model_Answer */ ?> getId() . '-answer-' . $answer->getId() ?> @@ -40,7 +40,7 @@ - +

From 115121cdf5e13fed300b4e6b6b3002e08b768228 Mon Sep 17 00:00:00 2001 From: Ustimenko Alexander Date: Sun, 16 Nov 2014 04:58:03 +0700 Subject: [PATCH 3/4] Fix page disappearance --- src/Doer/PostBrowser.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Doer/PostBrowser.php b/src/Doer/PostBrowser.php index 3766e434..854d5582 100644 --- a/src/Doer/PostBrowser.php +++ b/src/Doer/PostBrowser.php @@ -47,7 +47,7 @@ private function addTestToPostTypes($query) return $postTypes; } if (empty($postTypes)) { - $postTypes[] = 'post'; + $postTypes[] = $query->is_page ? 'page' : 'post'; } $postTypes[] = 'wpt_test'; From 5019d3dd6ca3e241339667e59644098c3e3b4027 Mon Sep 17 00:00:00 2001 From: Ustimenko Alexander Date: Sun, 16 Nov 2014 05:08:21 +0700 Subject: [PATCH 4/4] Update changelog and bump version to 0.4.2 --- CHANGELOG.md | 10 ++++++++++ README.md | 2 +- wp-testing.php | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bd08b859..5df811bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ ## Changelog ## +### 0.4.2 ### +Fix pages disapperance and form formatting + +* Fix pages disapperance +* Fix fill form (public) formatting conflict with wpautop (for example under Monaco theme) + + ### 0.4.1 ### Fix tests preview mode @@ -118,6 +125,9 @@ Initial release == Upgrade Notice == +### 0.4.2 ### +Fix page disppearance and fill form broken formatting + ### 0.4.1 ### Fix tests preview mode diff --git a/README.md b/README.md index 3476515b..e9e72c20 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ **Tags:** psychological, testing, test, quiz **Requires at least:** 3.2 **Tested up to:** 3.9 -**Stable tag:** 0.4.1 +**Stable tag:** 0.4.2 **License:** GPLv3 **License URI:** http://www.gnu.org/licenses/gpl-3.0.html diff --git a/wp-testing.php b/wp-testing.php index 3823bbae..68c967f3 100644 --- a/wp-testing.php +++ b/wp-testing.php @@ -3,7 +3,7 @@ * Plugin Name: Wp-testing * Plugin URI: http://wordpress.org/extend/plugins/wp-testing/ * Description: Helps to create psychological tests. - * Version: 0.4.1 + * Version: 0.4.2 * Author: Alexander Ustimenko * Author URI: http://ustimen.co * License: GPL3