~canonical-sysadmins/wordpress/4.5.2

« back to all changes in this revision

Viewing changes to wp-admin/options.php

  • Committer: Manuel Seelaus
  • Date: 2015-12-09 17:47:18 UTC
  • mfrom: (1.1.11 upstream)
  • Revision ID: manuel.seelaus@canonical.com-20151209174718-coxethm2swbeqksy
Merge WP4.4 from upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
        $capability = apply_filters( "option_page_capability_{$option_page}", $capability );
45
45
}
46
46
 
47
 
if ( !current_user_can( $capability ) )
48
 
        wp_die( __( 'Cheatin’ uh?' ), 403 );
 
47
if ( ! current_user_can( $capability ) ) {
 
48
        wp_die(
 
49
                '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
 
50
                '<p>' . __( 'You are not allowed to manage these items.' ) . '</p>',
 
51
                403
 
52
        );
 
53
}
49
54
 
50
55
// Handle admin email change requests
51
56
if ( is_multisite() ) {
68
73
        }
69
74
}
70
75
 
71
 
if ( is_multisite() && !is_super_admin() && 'update' != $action )
72
 
        wp_die( __( 'Cheatin&#8217; uh?' ), 403 );
 
76
if ( is_multisite() && ! is_super_admin() && 'update' != $action ) {
 
77
        wp_die(
 
78
                '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
 
79
                '<p>' . __( 'You are not allowed to delete these items.' ) . '</p>',
 
80
                403
 
81
        );
 
82
}
73
83
 
74
84
$whitelist_options = array(
75
85
        'general' => array( 'blogname', 'blogdescription', 'gmt_offset', 'date_format', 'time_format', 'start_of_week', 'timezone_string', 'WPLANG' ),
76
86
        'discussion' => array( 'default_pingback_flag', 'default_ping_status', 'default_comment_status', 'comments_notify', 'moderation_notify', 'comment_moderation', 'require_name_email', 'comment_whitelist', 'comment_max_links', 'moderation_keys', 'blacklist_keys', 'show_avatars', 'avatar_rating', 'avatar_default', 'close_comments_for_old_posts', 'close_comments_days_old', 'thread_comments', 'thread_comments_depth', 'page_comments', 'comments_per_page', 'default_comments_page', 'comment_order', 'comment_registration' ),
77
 
        'media' => array( 'thumbnail_size_w', 'thumbnail_size_h', 'thumbnail_crop', 'medium_size_w', 'medium_size_h', 'large_size_w', 'large_size_h', 'image_default_size', 'image_default_align', 'image_default_link_type' ),
 
87
        'media' => array( 'thumbnail_size_w', 'thumbnail_size_h', 'thumbnail_crop', 'medium_size_w', 'medium_size_h', 'medium_large_size_w', 'medium_large_size_h', 'large_size_w', 'large_size_h', 'image_default_size', 'image_default_align', 'image_default_link_type' ),
78
88
        'reading' => array( 'posts_per_page', 'posts_per_rss', 'rss_use_excerpt', 'show_on_front', 'page_on_front', 'page_for_posts', 'blog_public' ),
79
89
        'writing' => array( 'default_category', 'default_email_category', 'default_link_category', 'default_post_format' )
80
90
);
184
194
 
185
195
        if ( $options ) {
186
196
                foreach ( $options as $option ) {
187
 
                        if ( $unregistered )
188
 
                                _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 ) );
 
197
                        if ( $unregistered ) {
 
198
                                _deprecated_argument( 'options.php', '2.7',
 
199
                                        sprintf(
 
200
                                                /* translators: %s: the option/setting */
 
201
                                                __( 'The %s setting is unregistered. Unregistered settings are deprecated. See https://codex.wordpress.org/Settings_API' ),
 
202
                                                '<code>' . $option . '</code>'
 
203
                                        )
 
204
                                );
 
205
                        }
189
206
 
190
207
                        $option = trim( $option );
191
208
                        $value = null;