Fields / TextField

Read More: Fieldmanager_TextField

Basic single-line text fields.

By default this is a basic “text” input type, but it supports all HTML5 input types.

  1. 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' ) );
    } );
  2. 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' ) );
    } );