考虑到“我只想将我自己的帖子类型修改为4.2以上版本的最新版本”,您需要将设置注册到register_setting()
您看到的警告是在中生成的wp-admin/options.php
:
180 if ( $options ) {
181 foreach ( $options as $option ) {
182 if ( $unregistered )
183 _deprecated_argument( \'options.php\', \'2.7\', sprintf( __( \'The <code>%1$s</code> setting is unregistered. Unregistered settings are deprecated. See https://codex.wordpress.org/Settings_API\' ), $option, $option_page ) );
$unregistered
在同一文件中较早设置:
134 if ( \'update\' == $action ) {
135 if ( \'options\' == $option_page && !isset( $_POST[\'option_page\'] ) ) { // This is for back compat and will eventually be removed.
136 $unregistered = true;
137 check_admin_referer( \'update-options\' );
138 } else {
139 $unregistered = false;
140 check_admin_referer( $option_page . \'-options\' );
141 }