Skip to content

@trepmal /wp_editor-test.php
Last active

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
wp_editor and media tests
<?php
//Plugin Name: wp_editor Test
new wp_editor_Test();
class wp_editor_Test {
function __construct() {
add_action( 'admin_menu', array( &$this, 'menu' ) );
}
function menu() {
add_options_page( 'wp_editor Test', 'wp_editor Test', 'edit_posts', __FILE__, array( &$this, 'page' ) );
}
function page() {
?><div class="wrap">
<h2><?php _e('wp_editor Test'); ?></h2>
<?php
echo '<h3>Test 1</h3>';
$args = array(
'tinymce' => false,
'quicktags' => false,
'textarea_rows' => 5,
);
$this->printer( $args );
echo '<div style="float:left;">';
wp_editor( '', 'test1', $args );
echo '</div><br style="clear:both" />';
echo '<h3>Test 2</h3>';
$args = array(
'tinymce' => false,
'textarea_rows' => 5,
);
$this->printer( $args );
echo '<div style="float:left;">';
wp_editor( '', 'test2', $args );
echo '</div><br style="clear:both" />';
echo '<h3>Test 3</h3>';
$args = array(
'quicktags' => false,
'textarea_rows' => 5,
);
$this->printer( $args );
echo '<div style="float:left;">';
wp_editor( '', 'test3', $args );
echo '</div><br style="clear:both" />';
?>
<hr />
<p>Test 1 active: no media inserted</p>
<p>Test 2 active: media inserted</p>
<p>Test 3 active: media inserted</p>
<p>Tests 1 &amp; 2 active: media only inserted into #2</p>
<p>Tests 1 &amp; 3 active: media inserted into both</p>
<p>Tests 2 &amp; 3 active: media inserted into both</p>
<p>Tests 1, 2, &amp; 3 active: media inserted into all (sometimes quicktags &amp; tinymce weren't showing on #3. probably my fault, need to investigate...)</p>
</div><?php
}
function printer( $input ) {
echo '<pre style="width: 200px;float:left;">' . print_r( $input, true ) . '</pre>';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.