• Resolved WAXFROGDESIGN

    (@waxfrogdesign)


    Hello Derek,

    I have added the following code on both standard page type and custom page type. Everything works fine on standard ‘page’ type but it doesn’t save any of the list items on the custom page type. Every time I save, the items I have created disappear.

    $locationDirections = array(
        'id'        => 'locationDirections',
        'title'     => 'Location Directions',
        'desc'      => '',
        'pages'     => 'location',
        'context'   => 'normal',
        'priority'  => 'high',
        'fields'    => array(
    			array(
    				'label'       => 'locationDirections',
    				'id'          => 'locationUpload',
    				'type'        => 'upload',
    				'class'       => '',
    				'choices'     => array()
    			),
    			array(
    				'label'       => 'Location Transport',
    				'id'          => 'locationTransport',
    				'type'        => 'list-item',
    				'class'       => '',
    				'choices'     => array(),
    				'settings'    => array(
    				     array(
    				        'label'       => 'Transport Description',
    				        'id'          => 'locationTransportsDesc',
    				        'type'        => 'text',
    				        'desc'        => '',
    				        'std'         => '',
    				        'rows'        => '',
    				        'post_type'   => '',
    				        'taxonomy'    => ''
    				      )
    				)
    			)
        )
      );
    
      ot_register_meta_box( $locationDirections );

    https://www.ads-software.com/extend/plugins/option-tree/

Viewing 5 replies - 1 through 5 (of 5 total)
  • I have the same problem, except I can’t get the list-item to work on any page/post type. It doesn’t add any of the custom fields for the list-items fields.

    Sorry I wasn’t much help! I too would like to find out why and how to make this work correctly.

    Try to change the value of ‘pages’.

    Instead of having this:
    'pages' => 'your-post-type',

    Try this:
    'pages' => array( 'post', 'page' ),

    I don’t understand the ‘choices’ => array() part of the code. What is that supposed to do? why is it in two places in your code above? And did it work when you used array(‘page’)?

    Nevermind, I figured it out. I don’t know about anyone else, but it seems I can’t change the function name and still make this work. Like there are little details you have to keep here and there.

    Plugin Author Derek Herman

    (@valendesigns)

    @waxfrogdesign If I remember correctly you are running a plugin that created this post type and there is a conflict between OT and that plugin, right?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: OptionTree] Meta Options – List-item type not working on custom post type’ is closed to new replies.