Forums

Developer's Custom Fields
options_type = terms.. and options_query? (5 posts)

  1. unsalkorkmaz
    Member
    Posted 7 months ago #

    I tried;

    array(
        'name'			=> '3',
        'label'			=> '3',
        'type'			=> 'select',
        'scope'			=> array( 'post' ),
        'options_type'	=> 'terms',
        'options_query'	=> array( 'taxonomy' => 'konum' ),
        'capabilities'	=> array( 'edit_posts' )
    ),

    or
    'options_query' => array( 'terms' => 'konum' ),
    or
    'options_query' => array( 'konum' ),
    or
    'options_query' => array( 'tax_query' => 'konum' ),
    i couldnt get terms.. what should be options_query?

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

  2. Steve Taylor
    Member
    Posted 7 months ago #

    Check slt-cf-init.php lines 471-486:

    $args = $field['options_query'];
    $taxonomies = $args['taxonomies'];

    Sorry, the docs could probably be better for this. I guess it should be:

    'options_query' => array( 'taxonomies' => 'konum' )

    Then you can add other key/values that will get passed through as the $args parameter for get_terms.

  3. Steve Taylor
    Member
    Posted 7 months ago #

    I've updated the docs:

    http://sltaylor.co.uk/wordpress/plugins/slt-custom-fields/docs/#functions-boxes-fields

    Let me know if this works - I'm currently travelling and I haven't had the chance to double-check this!

  4. unsalkorkmaz
    Member
    Posted 7 months ago #

    Yeah it gots taxonomies now.. but.. not caring parent/child taxonomy.
    Can you check this solution: http://wordpress.stackexchange.com/questions/18578/taxonomy-dropdown-metabox-in-the-back-end ?
    That solution is pretty cool working. is it possible to implement this?

    or is it possible to insert custom solutions from outside to Developer's Custom Fields' metabox?

  5. Steve Taylor
    Member
    Posted 7 months ago #

    Handling hierarchical taxonomies should be in the next version.

    Meantime, you can hack nearly anything you want with hooks. Check the docs:

    http://sltaylor.co.uk/wordpress/plugins/slt-custom-fields/docs/#hooks

    Especially slt_cf_populate_options.

Reply

You must log in to post.

About this Plugin

About this Topic