settings_fields example



wp_enqueue_script( 'user-profile' );

require_once ABSPATH . 'wp-admin/admin-header.php';
?> <div class="wrap"> <h1><?php echo esc_html( $title ); ?></h1> <form method="post" action="options.php"> <?php settings_fields( 'writing' ); ?> <table class="form-table" role="presentation"> <?php if ( get_site_option( 'initial_db_version' ) < 32453 ) : ?> <tr> <th scope="row"><?php _e( 'Formatting' ); ?></th> <td><fieldset><legend class="screen-reader-text"><span> <?php     /* translators: Hidden accessibility text. */
    _e( 'Formatting' );
    ?> </span></legend> <label for="use_smilies"> <input name="use_smilies" type="checkbox" id="use_smilies" value="1"
'<p>' . __( '<a href="https://wordpress.org/documentation/article/settings-discussion-screen/">Documentation on Discussion Settings</a>' ) . '</p>' .
    '<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>'
);

require_once ABSPATH . 'wp-admin/admin-header.php';
?> <div class="wrap"> <h1><?php echo esc_html( $title ); ?></h1> <form method="post" action="options.php"> <?php settings_fields( 'discussion' ); ?> <table class="form-table" role="presentation"> <tr> <th scope="row"><?php _e( 'Default post settings' ); ?></th> <td><fieldset><legend class="screen-reader-text"><span> <?php     /* translators: Hidden accessibility text. */
    _e( 'Default post settings' );
    ?> </span></legend> <label for="default_pingback_flag"> <input name="default_pingback_flag" type="checkbox" id="default_pingback_flag" value="1"
'<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>'
);

require_once ABSPATH . 'wp-admin/admin-header.php';

?> <div class="wrap"> <h1><?php echo esc_html( $title ); ?></h1> <form action="options.php" method="post"> <?php settings_fields( 'media' ); ?> <h2 class="title"><?php _e( 'Image sizes' ); ?></h2> <p><?php _e( 'The sizes listed below determine the maximum dimensions in pixels to use when adding an image to the Media Library.' ); ?></p> <table class="form-table" role="presentation"> <tr> <th scope="row"><?php _e( 'Thumbnail size' ); ?></th> <td><fieldset><legend class="screen-reader-text"><span> <?php     /* translators: Hidden accessibility text. */
    _e( 'Thumbnail size' );
    
'<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>'
);

require_once ABSPATH . 'wp-admin/admin-header.php';
?> <div class="wrap"> <h1><?php echo esc_html( $title ); ?></h1> <form method="post" action="options.php"> <?php settings_fields( 'reading' );

if ( ! in_array( get_option( 'blog_charset' ), array( 'utf8', 'utf-8', 'UTF8', 'UTF-8' ), true ) ) {
    add_settings_field( 'blog_charset', __( 'Encoding for pages and feeds' ), 'options_reading_blog_charset', 'reading', 'default', array( 'label_for' => 'blog_charset' ) );
}
?> <?php if ( ! get_pages() ) : ?> <input name="show_on_front" type="hidden" value="posts" /> <table class="form-table" role="presentation"> <?php     if ( 'posts' !== get_option( 'show_on_front' ) ) :
        
'<p>' . __( '<a href="https://wordpress.org/documentation/article/settings-general-screen/">Documentation on General Settings</a>' ) . '</p>' .
    '<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>'
);

require_once ABSPATH . 'wp-admin/admin-header.php';
?> <div class="wrap"> <h1><?php echo esc_html( $title ); ?></h1> <form method="post" action="options.php" novalidate="novalidate"> <?php settings_fields( 'general' ); ?> <table class="form-table" role="presentation"> <tr> <th scope="row"><label for="blogname"><?php _e( 'Site Title' ); ?></label></th> <td><input name="blogname" type="text" id="blogname" value="<?php form_option( 'blogname' ); ?>" class="regular-text" /></td> </tr> <?php if ( ! is_multisite() ) {
    /* translators: Site tagline. */
    
Home | Imprint | This part of the site doesn't use cookies.