mboynes / super-cpt

**DEPRECATED.** Left public for posterity.
223 stars 49 forks source link

Add method to add extra content (instructions) in meta boxes #17

Open theoephraim opened 11 years ago

theoephraim commented 11 years ago

I find myself wanting to add short notes and instructions in meta boxes sometimes.

This could be added either as a single note at the top of the box (or one at the top and one at bottom), or by adding content to the fields array -- either as a new field type or as an option for each field.

For example - this shows 2 possible options:

$my_custom_type->add_meta_box( array(
    'id' => 'type_social',
    'title' => 'Social Profiles',
    'instructions_pre' => 'At least one profile is required for this widget to appear in search results.', 
    'fields' => array (
        '_twitter_username' => array( 'label'=>'Twitter Username', 'type'=>'text', 'instruction'=>'Do not include the @' ),
        ...
    )
));

This could be HTML content, which would let you be messy if you wanted to be, but would also be the most flexible.

theoephraim commented 11 years ago

implemented something simple -- https://github.com/mboynes/super-cpt/pull/18