Skip to content

Instantly share code, notes, and snippets.

@schurpf
Last active August 29, 2015 14:09
Show Gist options
  • Save schurpf/b2b61ba51975e28e2b0c to your computer and use it in GitHub Desktop.
Save schurpf/b2b61ba51975e28e2b0c to your computer and use it in GitHub Desktop.
php: cmb2 text only metabox to display data, add 'type' => 'text_only' to use hook.
add_action( 'cmb2_render_text_only', 'sch_cmb_render_text_only', 10, 5 );
function sch_cmb_render_text_only( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) {
echo $escaped_value; //unescaped value: echo $field_object->value;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment