Skip to content
This repository has been archived by the owner on Oct 23, 2021. It is now read-only.

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

Open
theoephraim opened this issue Jul 31, 2013 · 1 comment
Open

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

theoephraim opened this issue Jul 31, 2013 · 1 comment

Comments

@theoephraim
Copy link

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
Copy link
Author

implemented something simple -- #18

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant