Skip to content

Commit 2d76e6b

Browse files
committed
Merge branch 'hotfix/0.21.6'
2 parents ea6a05d + f3e1e72 commit 2d76e6b

File tree

5 files changed

+19
-6
lines changed

5 files changed

+19
-6
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
## Changelog ##
33

44

5+
### 0.21.6 ###
6+
7+
Avoid running test editor code at respondents results page
8+
9+
* Correctly determine test editor
10+
11+
512
### 0.21.5 ###
613

714
Fixup other plugins conflicts

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
**Tested up to:** 4.9
1010

11-
**Stable tag:** 0.21.5
11+
**Stable tag:** 0.21.6
1212

1313
**License:** GPLv3
1414

src/Doer/Feedbacker.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public function __construct(
1818
->addFilter('plugin_row_meta', array($this, 'onPluginMeta'), WpTesting_WordPress_IPriority::PRIORITY_DEFAULT, 2)
1919
->addAction('admin_menu', array($this, 'addPages'))
2020
->addAction('wp_ajax_wpt_rateus', array($this, 'ajaxRateUs'))
21-
->addAction('wp_testing_editor_customize_ui_after', array($this, 'customizeEditor'))
21+
->addAction('wp_testing_editor_tests_screen', array($this, 'customizeEditor'))
2222
->addAction('add_meta_boxes_wpt_test', array($this, 'customizeEditorMetaboxes'))
2323
;
2424
}

src/Doer/TestEditor.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ class WpTesting_Doer_TestEditor extends WpTesting_Doer_AbstractEditor
1515
*/
1616
public function customizeUi($screen)
1717
{
18-
if (!$this->isTestScreen($screen)) {
18+
$isTestEditor = $this->isTestScreen($screen, 'id');
19+
if ($isTestEditor || $this->isTestScreen($screen, 'post_type')) {
20+
$this->wp->doAction('wp_testing_editor_tests_screen');
21+
}
22+
if (!$isTestEditor) {
1923
return $this;
2024
}
2125
$test = $this->createTest($this->getRequestValue('post'));
@@ -420,15 +424,17 @@ private function emulateRedirectMessage(WpTesting_Model_Test $test)
420424
* Do we currently at tests?
421425
*
422426
* @param WP_Screen $screen
427+
* @param string $attribute When comparing by post_type -- we are at any tests screen, by id -- we are at editor
428+
*
423429
* @return boolean
424430
*/
425-
private function isTestScreen($screen)
431+
private function isTestScreen($screen, $attribute)
426432
{
427433
$id = $this->getRequestValue('post');
428434
if (is_array($id)) {
429435
return false;
430436
}
431-
if (!empty($screen->post_type) && $screen->post_type == 'wpt_test') {
437+
if (!empty($screen->$attribute) && $screen->$attribute == 'wpt_test') {
432438
return true;
433439
}
434440
if ($this->isWordPressAlready('3.3')) {

wp-testing.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: Wp-testing
44
* Plugin URI: http://wordpress.org/extend/plugins/wp-testing/
55
* Description: Helps to create psychological tests.
6-
* Version: 0.21.5
6+
* Version: 0.21.6
77
* Author: Alexander Ustimenko
88
* Author URI: http://ustimen.co
99
* License: GPL3

0 commit comments

Comments
 (0)