WordPress.org

Ready to get started?Download WordPress

Forums

Developer's Custom Fields
[resolved] Any way to include the boxes on pages also? (3 posts)

  1. bjones1985
    Member
    Posted 10 months ago #

    Just wondering if there is way to include the fields on pages also? If not can you give lead me in the direction to edit this plugin to do that as well? Would be nice to have both posts and pages for this plugin. Would rather use this for everything instead of using this and another class to add custom fields to pages.

    Thanks

    http://wordpress.org/extend/plugins/developers-custom-fields/

  2. Sean
    Member
    Posted 10 months ago #

    You've probably figured this out by now, but you can include any post type by including it in scope:

    slt_cf_register_box( array(
        'type'      => 'post',
        'title'     => 'Featured Project',
        'id'        => 'featured_project',
        'context'   => 'normal',
        'priority'  => 'high',
        'fields'    => array(
              array(
                  'name'          => 'featured_title',
                  'label'         => 'Title',
                  'type'          => 'text',
                  'scope'         => array( 'page', 'post', 'my_custom_post_type'),
                  'capabilities'  => array( 'edit_posts' )
              )
    )
          ));

    The full spec for scope is in the docs

  3. Steve Taylor
    Member
    Plugin Author

    Posted 10 months ago #

    @Sean, thanks for chipping in. @bjones1985, for some reason I got a notification for Sean's reply but not your post. Hope you got things working for you.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.