1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
<?php
/**
* Papi type that handle option, option data
* and rendering. All option types should extend this
* class.
*/
class Papi_Option_Type extends Papi_Entry_Type {
/**
* Capability.
*
* @var array
*/
public $capability = 'manage_options';
/**
* The description of the option type.
*
* @var string
*/
public $description = '';
/**
* The menu to register the option type on.
*
* @var string
*/
public $menu = '';
/**
* The type name.
*
* @var string
*/
public $type = 'option';
/**
* Render option page type.
*/
public function render() {
?>
<div class="wrap">
<h2><?php echo esc_html( $this->name ); ?></h2>
<?php echo wpautop( papi_nl2br( $this->description ) ); ?>
<form id="post" method="post" name="post">
<div id="papi-hidden-editor" class="hide-if-js">
<?php wp_nonce_field( 'papi_save_data', 'papi_meta_nonce' ); ?>
<?php wp_editor( '', 'papiHiddenEditor' ); ?>
</div>
<div id="poststuff">
<div id="post-body">
<?php
foreach ( $this->boxes as $box ) {
do_meta_boxes(
$box->id,
'normal',
null
);
}
?>
<?php submit_button(); ?>
</div>
</div>
</form>
</div>
<?php
}
}