Skip to content

Instantly share code, notes, and snippets.

@timiwahalahti
Created November 28, 2017 21:24
Show Gist options
  • Save timiwahalahti/756e46726235f50390a15c6ee4297073 to your computer and use it in GitHub Desktop.
Save timiwahalahti/756e46726235f50390a15c6ee4297073 to your computer and use it in GitHub Desktop.
// see https://carbonfields.net/docs/fields-select/
Field::make( 'select', 'crb_content_align', 'Text alignment' )
->add_options( 'emrezavarcbrgist2317' )
// see https://secure.php.net/manual/en/language.types.callable.php
function emrezavarcbrgist2317() {
// see https://developer.wordpress.org/reference/functions/get_categories/
$terms = get_categories( array(
'fields' => 'id=>name'
) );
// see https://developer.wordpress.org/reference/functions/is_wp_error/
if ( ! is_wp_error( $terms ) ) {
return $terms;
}
return array();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment