Basic single-line text fields.
By default this is a basic “text” input type, but it supports all HTML5 input types.
-
Example 1: Basic Text Field
add_action( 'fm_post_post', function() { $fm = new Fieldmanager_TextField( array( 'name' => 'demo-field', ) ); $fm->add_meta_box( 'TextField Demo', array( 'post' ) ); } );
-
Example 2: HTML5 Input Type Example
This example creates an HTML5 color input type. You could instead specify any available input type, but be conscious of cross-browser support.
add_action( 'fm_post_post', function() { $fm = new Fieldmanager_TextField( array( 'name' => 'demo-field', 'input_type' => 'color', ) ); $fm->add_meta_box( 'TextField Demo', array( 'post' ) ); } );