Skip to content

Commit

Permalink
Merge pull request #1831 from manchumahara/patch-1
Browse files Browse the repository at this point in the history
Update kirki-helper-class.md
  • Loading branch information
aristath authored Mar 14, 2018
2 parents 007010f + 2c49b64 commit e8d908a
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions docs/docs/advanced/kirki-helper-class.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,23 @@ Kirki::add_field( 'my_config', array(
) );
```
For full list of choices https://developer.wordpress.org/reference/functions/get_terms/#source

### Custom Post Types and Custom Taxnonomy

Please note that to make the custom post types and taxonomies work you must add the fields and sections in 'init' action.

Example:

```php
add_action( 'init', function() {
Kirki::add_field( 'my_settings', array(
'type' => 'select',
'settings' => 'my_setting',
'label' => __( 'This is the label', 'my_textdomain' ),
'section' => 'title_tagline',
'default' => '',
'priority' => 10,
'choices' => Kirki_Helper::get_terms( 'product_cat' ),
) );
} );
```

0 comments on commit e8d908a

Please sign in to comment.