meta_box or custom_field as a second tinymce post-instance?

I believe this answers both of your questions(this and this), Take a look at My Meta box class which lets add nay type of field you want in a custom metabox.

Once you have the class all you need to do is something like this:

//include the main class file
require_once("meta-box-class/my-meta-box-class.php");
// configure your meta box
$config = array(
    'id' => 'event_review_box',             // meta box id, unique per meta box
    'title' => 'Event Review',          // meta box title
    'pages' => array('event'),          // post types, assuming that your post type name is event
    'context' => 'normal',              // where the meta box appear: normal (default), advanced, side; optional
    'priority' => 'high',               // order of meta box: high (default), low; optional
    'fields' => array(),                // list of meta fields (can be added by field arrays) or using the class's functions
    'local_images' => false,            // Use local or hosted images (meta box images for add/remove)
    'use_with_theme' => false           //change path if used with theme set to true, false for a plugin or anything else for a custom path(default false).
);
// Initiate your meta box
$my_meta2 = new AT_Meta_Box($config);
//Add fields to your meta box
$my_meta2->addWysiwyg('wysiwyg_field_id',array('name'=> 'Event Recap'));
//Finish Meta Box Deceleration
$my_meta2->Finish();

then to add a new metabox for the event date field

// configure your meta box
$config = array(
    'id' => 'event_date_box',           // meta box id, unique per meta box
    'title' => 'Event date',            // meta box title
    'pages' => array('event'),          // post types, assuming that your post type name is event
    'context' => 'normal',              // where the meta box appear: normal (default), advanced, side; optional
    'priority' => 'high',               // order of meta box: high (default), low; optional
    'fields' => array(),                // list of meta fields (can be added by field arrays) or using the class's functions
    'local_images' => false,            // Use local or hosted images (meta box images for add/remove)
    'use_with_theme' => false           //change path if used with theme set to true, false for a plugin or anything else for a custom path(default false).
);
// Initiate your meta box
$my_meta = new AT_Meta_Box($config);
//Add fields to your meta box
$my_meta->addDate('date_field_id',array('name'=> 'Event Date '));
//Finish Meta Box Deceleration
$my_meta->Finish();

and you get something that looks like this:
enter image description here

Leave a Comment