web_development:wordpress:admin-fields

ADMIN FIELDS

Text Field

<input type="text" name="key_name" value="<?php echo esc_attr( get_option('key_name') ); ?>" /> 

CHECKBOX checked() - https://codex.wordpress.org/Function_Reference/checked

<input type="checkbox" name="key_name" value="1" <?php checked(1, get_option('chk_slider_cpt'), true); ?> /> 

SELECT selected() - https://codex.wordpress.org/Function_Reference/selected
Select Example Gist
get_pages() dropdown

  • web_development/wordpress/admin-fields.txt
  • Last modified: 2020/10/09 03:37
  • by jimboobrien