Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?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
You can’t perform that action at this time.