move options admin page into separate file
This commit is contained in:
parent
bc964971f7
commit
1abd155217
|
@ -4,12 +4,7 @@ class ComicPressOptionsAdmin {
|
||||||
function render_admin() {
|
function render_admin() {
|
||||||
$nonce = wp_create_nonce('comicpress');
|
$nonce = wp_create_nonce('comicpress');
|
||||||
|
|
||||||
echo '<div class="wrap">';
|
include(dirname(__FILE__) . '/partials/options-admin.inc');
|
||||||
echo '<h2>ComicPress Config</h2>';
|
|
||||||
echo '<form method="post">';
|
|
||||||
echo '<input type="hidden" name="cp[_nonce]" value="' . $nonce . '" />';
|
|
||||||
echo '</form>';
|
|
||||||
echo '</div>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_root_categories() {
|
function get_root_categories() {
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
<div class="wrap">
|
||||||
|
<h2>ComicPress Config</h2>
|
||||||
|
<form method="post">
|
||||||
|
<input type="hidden" name="cp[_nonce]" value="<?php echo $nonce ?>" />
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">Master Comic Category</th>
|
||||||
|
<td>
|
||||||
|
<select name="cp[comiccat]">
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</form>
|
||||||
|
</div>
|
|
@ -16,7 +16,7 @@ class OptionsPageTest extends PHPUnit_Framework_TestCase {
|
||||||
ob_start();
|
ob_start();
|
||||||
$this->admin->render_admin();
|
$this->admin->render_admin();
|
||||||
$source = ob_get_clean();
|
$source = ob_get_clean();
|
||||||
|
|
||||||
$this->assertTrue(($xml = _to_xml($source)) !== false);
|
$this->assertTrue(($xml = _to_xml($source)) !== false);
|
||||||
foreach (array(
|
foreach (array(
|
||||||
'//input[@name="cp[_nonce]" and @value="' . $nonce . '"]' => true
|
'//input[@name="cp[_nonce]" and @value="' . $nonce . '"]' => true
|
||||||
|
|
Loading…
Reference in New Issue