forked from WordPress/gutenberg
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add regression test for editor JS crash caused by rtlcss parsing exce…
…ption, take 2 (WordPress#29598) * Switch to RTL dir using a server-side plugin as a way to simplify and regress-test issues in rtlcss * Fix lint Co-authored-by: Bernie Reiter <[email protected]>
- Loading branch information
1 parent
5f1413d
commit db16de9
Showing
2 changed files
with
35 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
/** | ||
* Plugin Name: Gutenberg Test Plugin, Activate RTL | ||
* Plugin URI: https://github.com/WordPress/gutenberg | ||
* Author: Gutenberg Team / Yoav Farhi | ||
* | ||
* Based on the code from http://wordpress.org/extend/plugins/rtl-tester/. | ||
* | ||
* @package gutenberg-test-plugin-activate-rtl | ||
*/ | ||
|
||
/** | ||
* Set the locale's and styles' text direction to RTL. | ||
*/ | ||
function gutenberg_test_plugin_activate_rtl_set_direction() { | ||
global $wp_locale, $wp_styles; | ||
|
||
$wp_locale->text_direction = 'rtl'; | ||
if ( ! is_a( $wp_styles, 'WP_Styles' ) ) { | ||
$wp_styles = new WP_Styles(); | ||
} | ||
$wp_styles->text_direction = 'rtl'; | ||
} | ||
|
||
add_action( 'init', 'gutenberg_test_plugin_activate_rtl_set_direction' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters