bonny / WordPress-Simple-Fields

WordPress plugin that extend Custom Fields to include textareas, WYSIWYG-editor, files, attachments, well basically anything
http://wordpress.org/extend/plugins/simple-fields/
88 stars 23 forks source link

If you add, then remove, and then re-add a field it doesn't appear in the admin. #99

Open powerbuoy opened 10 years ago

powerbuoy commented 10 years ago

Like the title says; If you add, then remove, and then re-add a field it doesn't appear in the admin.

Example:

<?php
simple_fields_register_field_group('link_group', array(
    'name'          => __('Link', 'h5b'), 
    'description'   => __('Enter a link for this post.', 'h5b'), 
    'repeatable'    => false, 
    'fields'        => array(
        array(
            'slug'          => 'url', 
            'name'          => __('URL', 'h5b'), 
            'type'          => 'text'
        ), 
        array(
            'slug'          => 'title', 
            'name'          => __('Title', 'h5b'), 
            'type'          => 'text'
        )
    )
));

simple_fields_register_post_connector('page_connector', array(
    'name'          => __('Page Connector', 'h5b'),  
    'post_types'    => 'page', 
    'field_groups'  => array(
        array('slug' => 'link_group', 'context' => 'side', 'priority' => 'default')
    )
));

Then comment Title for example and it'll disappear from the admin (as expected), but then if you re-add it it won't re-appear.