Skip to content

Instantly share code, notes, and snippets.

@adamcapriola
Last active January 18, 2019 16:25
Show Gist options
  • Save adamcapriola/868d9ec449a58b730434c78e4a095d9f to your computer and use it in GitHub Desktop.
Save adamcapriola/868d9ec449a58b730434c78e4a095d9f to your computer and use it in GitHub Desktop.
<?php
/**
* Carbon Fields: Post: Formatting
*
*/
add_action( 'carbon_fields_register_fields', 'ac_crb_register_fields_post_formatting' );
function ac_crb_register_fields_post_formatting() {
Container::make( 'post_meta', 'Formatting' )
->where( 'post_type', '=', 'post' )
->set_context( 'normal' ) // normal / advanced / side / carbon_fields_after_title
->set_priority( 'high' ) // high / core / default / low
->set_revisions_disabled( false ) // false / true
->add_fields( array(
// Select: Lede words
Field::make( 'select', 'lede_words', 'Lede Words' )
->set_default_value( 3 )
->set_options( array(
'' => 'None',
1 => 1,
2 => 2,
3 => 3,
4 => 4,
5 => 5,
6 => 6,
7 => 7,
) )
,
) );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment