diff options
author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2006-08-31 14:55:29 +0000 |
---|---|---|
committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2006-08-31 14:55:29 +0000 |
commit | b764f60728be1d4e026f9d7ae618ab47e23322f8 (patch) | |
tree | 1f1b45c4f1c1cf027b3240f605346e56209be8ff /wp-admin | |
parent | dad010666b767a1d06588d1d09c771c62f67c387 (diff) | |
download | wordpress-mu-b764f60728be1d4e026f9d7ae618ab47e23322f8.tar.gz wordpress-mu-b764f60728be1d4e026f9d7ae618ab47e23322f8.tar.xz wordpress-mu-b764f60728be1d4e026f9d7ae618ab47e23322f8.zip |
WP Merge to rev #4147
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@729 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-admin')
42 files changed, 265 insertions, 119 deletions
diff --git a/wp-admin/admin-db.php b/wp-admin/admin-db.php index 1f7c952..c037b14 100644 --- a/wp-admin/admin-db.php +++ b/wp-admin/admin-db.php @@ -297,23 +297,55 @@ function wp_insert_link($linkdata) { extract($linkdata); $update = false; + if ( !empty($link_id) ) $update = true; + if( trim( $link_name ) == '' ) + return 0; + $link_name = apply_filters('pre_link_name', $link_name); + + if( trim( $link_url ) == '' ) + return 0; + $link_url = apply_filters('pre_link_url', $link_url); + if ( empty($link_rating) ) $link_rating = 0; + else + $link_rating = (int) $link_rating; + + if ( empty($link_image) ) + $link_image = ''; + $link_image = apply_filters('pre_link_image', $link_image); if ( empty($link_target) ) $link_target = ''; + $link_target = apply_filters('pre_link_target', $link_target); if ( empty($link_visible) ) $link_visible = 'Y'; + $link_visibile = preg_replace('/[^YNyn]/', '', $link_visible); if ( empty($link_owner) ) $link_owner = $current_user->id; + else + $link_owner = (int) $link_owner; if ( empty($link_notes) ) $link_notes = ''; + $link_notes = apply_filters('pre_link_notes', $link_notes); + + if ( empty($link_description) ) + $link_description = ''; + $link_description = apply_filters('pre_link_description', $link_description); + + if ( empty($link_rss) ) + $link_rss = ''; + $link_rss = apply_filters('pre_link_rss', $link_rss); + + if ( empty($link_rel) ) + $link_rel = ''; + $link_rel = apply_filters('pre_link_rel', $link_rel); // Make sure we set a valid category if (0 == count($link_category) || !is_array($link_category)) { diff --git a/wp-admin/admin-functions.php b/wp-admin/admin-functions.php index 63e9107..bb86180 100644 --- a/wp-admin/admin-functions.php +++ b/wp-admin/admin-functions.php @@ -301,6 +301,8 @@ function get_post_to_edit($id) { $post->post_title = format_to_edit($post->post_title); $post->post_title = apply_filters('title_edit_pre', $post->post_title); + $post->post_password = format_to_edit($post->post_password); + if ($post->post_type == 'page') $post->page_template = get_post_meta($id, '_wp_page_template', true); @@ -333,10 +335,10 @@ function get_default_post_to_edit() { $post_excerpt = ''; $post->post_status = 'draft'; - $post->comment_status = get_settings('default_comment_status'); - $post->ping_status = get_settings('default_ping_status'); - $post->post_pingback = get_settings('default_pingback_flag'); - $post->post_category = get_settings('default_category'); + $post->comment_status = get_option('default_comment_status'); + $post->ping_status = get_option('default_ping_status'); + $post->post_pingback = get_option('default_pingback_flag'); + $post->post_category = get_option('default_category'); $post->post_content = apply_filters('default_content', $post_content); $post->post_title = apply_filters('default_title', $post_title); $post->post_excerpt = apply_filters('default_excerpt', $post_excerpt); @@ -381,6 +383,23 @@ function wp_dropdown_roles( $default = false ) { } +function get_user_to_edit($user_id) { + $user = new WP_User($user_id); + $user->user_login = wp_specialchars($user->user_login, 1); + $user->user_email = wp_specialchars($user->user_email, 1); + $user->user_url = wp_specialchars($user->user_url, 1); + $user->first_name = wp_specialchars($user->first_name, 1); + $user->last_name = wp_specialchars($user->last_name, 1); + $user->display_name = wp_specialchars($user->display_name, 1); + $user->nickname = wp_specialchars($user->nickname, 1); + $user->aim = wp_specialchars($user->aim, 1); + $user->yim = wp_specialchars($user->yim, 1); + $user->jabber = wp_specialchars($user->jabber, 1); + $user->description = wp_specialchars($user->description); + + return $user; +} + // Creates a new user from the "Users" form using $_POST information. function add_user() { @@ -441,7 +460,7 @@ function edit_user($user_id = 0) { if (isset ($_POST['display_name'])) $user->display_name = wp_specialchars(trim($_POST['display_name'])); if (isset ($_POST['description'])) - $user->description = wp_specialchars(trim($_POST['description'])); + $user->description = trim($_POST['description']); if (isset ($_POST['jabber'])) $user->jabber = wp_specialchars(trim($_POST['jabber'])); if (isset ($_POST['aim'])) @@ -509,9 +528,11 @@ function get_link_to_edit($link_id) { $link->link_url = wp_specialchars($link->link_url, 1); $link->link_name = wp_specialchars($link->link_name, 1); - $link->link_description = wp_specialchars($link->link_description); + $link->link_image = wp_specialchars($link->link_image, 1); + $link->link_description = wp_specialchars($link->link_description, 1); $link->link_notes = wp_specialchars($link->link_notes); - $link->link_rss = wp_specialchars($link->link_rss); + $link->link_rss = wp_specialchars($link->link_rss, 1); + $link->link_rel = wp_specialchars($link->link_rel, 1); $link->post_category = $link->link_category; return $link; @@ -973,7 +994,7 @@ function list_meta($meta) { $style = ''; if ('_' == $entry['meta_key'] { 0 }) $style .= ' hidden'; - $key_js = addslashes(wp_specialchars( $entry['meta_key'], 'double' )); + $key_js = js_escape($entry['meta_key']); $entry['meta_key'] = wp_specialchars( $entry['meta_key'], true ); $entry['meta_value'] = wp_specialchars( $entry['meta_value'], true ); $r .= "\n\t<tr id='meta-{$entry['meta_id']}' class='$style'>"; @@ -1025,6 +1046,7 @@ function meta_form() { <?php foreach ($keys as $key) { + $key = wp_specialchars($key, 1); echo "\n\t<option value='$key'>$key</option>"; } ?> @@ -1098,7 +1120,7 @@ function touch_time($edit = 1, $for_post = 1) { echo '<fieldset><legend><input type="checkbox" class="checkbox" name="edit_date" value="1" id="timestamp" /> <label for="timestamp">'.__('Edit timestamp').'</label></legend>'; - $time_adj = time() + (get_settings('gmt_offset') * 3600); + $time_adj = time() + (get_option('gmt_offset') * 3600); $post_date = ($for_post) ? $post->post_date : $comment->comment_date; $jj = ($edit) ? mysql2date('d', $post_date) : gmdate('d', $time_adj); $mm = ($edit) ? mysql2date('m', $post_date) : gmdate('m', $time_adj); @@ -1616,8 +1638,8 @@ function validate_file_to_edit($file, $allowed_files = '') { } function get_home_path() { - $home = get_settings('home'); - if ($home != '' && $home != get_settings('siteurl')) { + $home = get_option('home'); + if ($home != '' && $home != get_option('siteurl')) { $home_path = parse_url($home); $home_path = $home_path['path']; $root = str_replace($_SERVER["PHP_SELF"], '', $_SERVER["SCRIPT_FILENAME"]); diff --git a/wp-admin/admin-header.php b/wp-admin/admin-header.php index f8322b1..2487f28 100644 --- a/wp-admin/admin-header.php +++ b/wp-admin/admin-header.php @@ -10,13 +10,14 @@ if ( $editing ) { } get_admin_page_title(); + ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> -<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_settings('blog_charset'); ?>" /> +<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" /> <title><?php bloginfo('name') ?> › <?php echo $title; ?> — WordPress</title> -<link rel="stylesheet" href="<?php echo get_settings('siteurl') ?>/wp-admin/wp-admin.css?version=<?php bloginfo('version'); ?>" type="text/css" /> +<link rel="stylesheet" href="<?php echo get_option('siteurl') ?>/wp-admin/wp-admin.css?version=<?php bloginfo('version'); ?>" type="text/css" /> <script type="text/javascript"> //<![CDATA[ function addLoadEvent(func) {if ( typeof wpOnload!='function'){wpOnload=func;}else{ var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}} @@ -24,13 +25,25 @@ function addLoadEvent(func) {if ( typeof wpOnload!='function'){wpOnload=func;}el </script> <?php if ( ($parent_file != 'link-manager.php') && ($parent_file != 'options-general.php') ) : ?> <style type="text/css">* html { overflow-x: hidden; }</style> -<?php endif; wp_print_scripts(); do_action('admin_head'); ?> +<?php endif; +if ( isset($page_hook) ) + do_action('admin_print_scripts-' . $page_hook); +else if ( isset($plugin_page) ) + do_action('admin_print_scripts-' . $plugin_page); +do_action('admin_print_scripts'); + +if ( isset($page_hook) ) + do_action('admin_head-' . $page_hook); +else if ( isset($plugin_page) ) + do_action('admin_head-' . $plugin_page); +do_action('admin_head'); +?> </head> <body> <div id="wphead"> -<h1><?php echo wptexturize(get_settings(('blogname'))); ?> <span>(<a href="<?php echo get_settings('home') . '/'; ?>"><?php _e('View site »') ?></a>)</span></h1> +<h1><?php echo wptexturize(get_option(('blogname'))); ?> <span>(<a href="<?php echo get_option('home') . '/'; ?>"><?php _e('View site »') ?></a>)</span></h1> </div> -<div id="user_info"><p><?php printf(__('Howdy, <strong>%s</strong>.'), $user_identity) ?> [<a href="<?php echo get_settings('siteurl'); ?>/wp-login.php?action=logout" title="<?php _e('Log out of this account') ?>"><?php _e('Sign Out'); ?></a>, <a href="profile.php"><?php _e('My Profile'); ?></a>] </p></div> +<div id="user_info"><p><?php printf(__('Howdy, <strong>%s</strong>.'), $user_identity) ?> [<a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="<?php _e('Log out of this account') ?>"><?php _e('Sign Out'); ?></a>, <a href="profile.php"><?php _e('My Profile'); ?></a>] </p></div> <?php require(ABSPATH . '/wp-admin/menu-header.php'); diff --git a/wp-admin/admin.php b/wp-admin/admin.php index 91196b0..8458440 100644 --- a/wp-admin/admin.php +++ b/wp-admin/admin.php @@ -28,10 +28,10 @@ update_category_cache(); wp_get_current_user(); -$posts_per_page = get_settings('posts_per_page'); -$what_to_show = get_settings('what_to_show'); -$date_format = get_settings('date_format'); -$time_format = get_settings('time_format'); +$posts_per_page = get_option('posts_per_page'); +$what_to_show = get_option('what_to_show'); +$date_format = get_option('date_format'); +$time_format = get_option('time_format'); wp_reset_vars(array('profile', 'redirect', 'redirect_url', 'a', 'popuptitle', 'popupurl', 'text', 'trackback', 'pingback')); @@ -51,6 +51,7 @@ if (isset($plugin_page)) { $page_hook = get_plugin_page_hook($plugin_page, $pagenow); if ( $page_hook ) { + do_action('load-' . $page_hook); if (! isset($_GET['noheader'])) require_once(ABSPATH . '/wp-admin/admin-header.php'); @@ -63,6 +64,8 @@ if (isset($plugin_page)) { if (! file_exists(ABSPATH . "wp-content/plugins/$plugin_page") && ! file_exists(ABSPATH . "wp-content/mu-plugins/$plugin_page")) wp_die(sprintf(__('Cannot load %s.'), htmlentities($plugin_page))); + do_action('load-' . $plugin_page); + if (! isset($_GET['noheader'])) require_once(ABSPATH . '/wp-admin/admin-header.php'); diff --git a/wp-admin/bookmarklet.php b/wp-admin/bookmarklet.php index 04e13cd..417d910 100644 --- a/wp-admin/bookmarklet.php +++ b/wp-admin/bookmarklet.php @@ -50,7 +50,7 @@ $popupurl = wp_specialchars($_REQUEST['popupurl']); <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title><?php bloginfo('name') ?> › Bookmarklet — WordPress</title> -<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_settings('blog_charset'); ?>" /> +<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" /> <link rel="stylesheet" href="wp-admin.css" type="text/css" /> <style type="text/css"> diff --git a/wp-admin/cat-js.php b/wp-admin/cat-js.php index 08393b7..c286168 100644 --- a/wp-admin/cat-js.php +++ b/wp-admin/cat-js.php @@ -1,6 +1,6 @@ <?php require_once('../wp-config.php'); -header('Content-type: text/javascript; charset=' . get_settings('blog_charset'), true); +cache_javascript_headers(); ?> addLoadEvent(function(){catList=new listMan('categorychecklist');catList.ajaxRespEl='jaxcat';catList.topAdder=1;catList.alt=0;catList.showLink=0;}); addLoadEvent(newCatAddIn); diff --git a/wp-admin/comment.php b/wp-admin/comment.php index 95bee96..27652aa 100644 --- a/wp-admin/comment.php +++ b/wp-admin/comment.php @@ -62,7 +62,7 @@ case 'mailapprovecomment': echo "</table>\n"; echo "<p>" . __('Are you sure you want to do that?') . "</p>\n"; - echo "<form action='".get_settings('siteurl')."/wp-admin/comment.php' method='get'>\n"; + echo "<form action='".get_option('siteurl')."/wp-admin/comment.php' method='get'>\n"; wp_nonce_field($nonce_action); echo "<input type='hidden' name='action' value='$formaction' />\n"; if ( 'spam' == $_GET['delete_type'] ) @@ -72,7 +72,7 @@ case 'mailapprovecomment': echo "<input type='hidden' name='noredir' value='1' />\n"; echo "<input type='submit' value='" . __('Yes') . "' />"; echo " "; - echo "<input type='button' value='" . __('No') . "' onclick=\"self.location='". get_settings('siteurl') ."/wp-admin/edit-comments.php';\" />\n"; + echo "<input type='button' value='" . __('No') . "' onclick=\"self.location='". get_option('siteurl') ."/wp-admin/edit-comments.php';\" />\n"; echo "</form>\n"; echo "</div>\n"; @@ -106,7 +106,7 @@ case 'deletecomment': if ((wp_get_referer() != '') && (false == $noredir)) { wp_redirect(wp_get_referer()); } else { - wp_redirect(get_settings('siteurl') .'/wp-admin/edit-comments.php'); + wp_redirect(get_option('siteurl') .'/wp-admin/edit-comments.php'); } exit(); break; @@ -133,7 +133,7 @@ case 'unapprovecomment': if ((wp_get_referer() != "") && (false == $noredir)) { wp_redirect(wp_get_referer()); } else { - wp_redirect(get_settings('siteurl') .'/wp-admin/edit.php?p='.$p.'&c=1#comments'); + wp_redirect(get_option('siteurl') .'/wp-admin/edit.php?p='.$p.'&c=1#comments'); } exit(); break; @@ -156,7 +156,7 @@ case 'approvecomment': wp_die( __('You are not allowed to edit comments on this post, so you cannot approve this comment.') ); wp_set_comment_status($comment->comment_ID, "approve"); - if (get_settings("comments_notify") == true) { + if (get_option("comments_notify") == true) { wp_notify_postauthor($comment->comment_ID); } @@ -164,7 +164,7 @@ case 'approvecomment': if ((wp_get_referer() != "") && (false == $noredir)) { wp_redirect(wp_get_referer()); } else { - wp_redirect(get_settings('siteurl') .'/wp-admin/edit.php?p='.$p.'&c=1#comments'); + wp_redirect(get_option('siteurl') .'/wp-admin/edit.php?p='.$p.'&c=1#comments'); } exit(); break; diff --git a/wp-admin/dbx-admin-key-js.php b/wp-admin/dbx-admin-key-js.php index bca04ce..f47e53b 100644 --- a/wp-admin/dbx-admin-key-js.php +++ b/wp-admin/dbx-admin-key-js.php @@ -1,6 +1,6 @@ <?php require_once('admin.php'); -header('Content-type: text/javascript; charset=' . get_settings('blog_charset'), true); +cache_javascript_headers(); switch ( $_GET['pagenow'] ) : case 'post.php' : diff --git a/wp-admin/edit-comments.php b/wp-admin/edit-comments.php index 4edcb68..8f4c24c 100644 --- a/wp-admin/edit-comments.php +++ b/wp-admin/edit-comments.php @@ -45,7 +45,7 @@ function getNumChecked(form) <input type="text" name="s" value="<?php if (isset($_GET['s'])) echo wp_specialchars($_GET['s'], 1); ?>" size="17" /> <input type="submit" name="submit" value="<?php _e('Search') ?>" /> <input type="hidden" name="mode" value="<?php echo $mode; ?>" /> - <?php _e('(Searches within comment text, e-mail, URI, and IP address.)') ?> + <?php _e('(Searches within comment text, e-mail, URL, and IP address.)') ?> </fieldset> </form> <p><a href="?mode=view"><?php _e('View Mode') ?></a> | <a href="?mode=edit"><?php _e('Mass Edit Mode') ?></a></p> diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php index ef8120d..ca69129 100644 --- a/wp-admin/edit-form-advanced.php +++ b/wp-admin/edit-form-advanced.php @@ -39,7 +39,7 @@ if ('' != $post->pinged) { $pings = '<p>'. __('Already pinged:') . '</p><ul>'; $already_pinged = explode("\n", trim($post->pinged)); foreach ($already_pinged as $pinged_url) { - $pings .= "\n\t<li>$pinged_url</li>"; + $pings .= "\n\t<li>" . wp_specialchars($pinged_url) . "</li>"; } $pings .= '</ul>'; } @@ -80,7 +80,7 @@ addLoadEvent(focusit); <div id="searchresults" class="autocomplete"></div> <?php autocomplete_textbox( "wpmu-edit.php?action=searchcategories&search=", "newcat", "searchresults" ); ?> <?php endif; ?> -<ul id="categorychecklist"><?php dropdown_categories(get_settings('default_category')); ?></ul></div> +<ul id="categorychecklist"><?php dropdown_categories(get_option('default_category')); ?></ul></div> </fieldset> <fieldset id="commentstatusdiv" class="dbx-box"> @@ -100,7 +100,7 @@ addLoadEvent(focusit); </fieldset> <fieldset id="slugdiv" class="dbx-box"> -<h3 class="dbx-handle"><?php _e('Post slug') ?></h3> +<h3 class="dbx-handle"><?php _e('Post Slug') ?></h3> <div class="dbx-content"><input name="post_name" type="text" size="13" id="post_name" value="<?php echo $post->post_name ?>" /></div> </fieldset> @@ -122,7 +122,7 @@ addLoadEvent(focusit); <?php if ( $authors = get_editable_authors( $current_user->id ) ) : // TODO: ROLE SYSTEM ?> <fieldset id="authordiv" class="dbx-box"> -<h3 class="dbx-handle"><?php _e('Post author'); ?>:</h3> +<h3 class="dbx-handle"><?php _e('Post Author'); ?>:</h3> <div class="dbx-content"> <select name="post_author_override" id="post_author_override"> <?php diff --git a/wp-admin/edit-form-comment.php b/wp-admin/edit-form-comment.php index 46d9447..bbcac0b 100644 --- a/wp-admin/edit-form-comment.php +++ b/wp-admin/edit-form-comment.php @@ -30,7 +30,7 @@ addLoadEvent(focusit); </div> </fieldset> <fieldset id="uridiv"> - <legend><label for="URL"><?php _e('URI:') ?></label></legend> + <legend><label for="URL"><?php _e('URL:') ?></label></legend> <div> <input type="text" id="newcomment_author_url" name="newcomment_author_url" size="35" value="<?php echo $comment->comment_author_url ?>" tabindex="3" id="URL" /> </div> diff --git a/wp-admin/edit-form.php b/wp-admin/edit-form.php index fd5efce..2d1cef6 100644 --- a/wp-admin/edit-form.php +++ b/wp-admin/edit-form.php @@ -34,7 +34,7 @@ addLoadEvent(focusit); <legend><a href="http://wordpress.org/docs/reference/post/#post" title="<?php _e('Help with post field') ?>"><?php _e('Post') ?></a></legend> <?php the_quicktags(); ?> <?php - $rows = get_settings('default_post_edit_rows'); + $rows = get_option('default_post_edit_rows'); if (($rows < 3) || ($rows > 100)) { $rows = 10; } @@ -51,7 +51,7 @@ edCanvas = document.getElementById('content'); <input type="hidden" name="post_pingback" value="<?php echo get_option('default_pingback_flag') ?>" id="post_pingback" /> -<p><label for="trackback"> <?php printf(__('<a href="%s" title="Help on trackbacks"><strong>TrackBack</strong> a <abbr title="Universal Resource Identifier">URI</abbr></a>:</label> (Separate multiple <abbr title="Universal Resource Identifier">URI</abbr>s with spaces.)<br />'), 'http://wordpress.org/docs/reference/post/#trackback') ?> +<p><label for="trackback"> <?php printf(__('<a href="%s" title="Help on trackbacks"><strong>TrackBack</strong> a <abbr title="Universal Resource Locator">URL</abbr></a>:</label> (Separate multiple <abbr title="Universal Resource Locator">URL</abbr>s with spaces.)<br />'), 'http://wordpress.org/docs/reference/post/#trackback') ?> <input type="text" name="trackback_url" style="width: 360px" id="trackback" tabindex="7" /></p> <p class="submit"><input name="saveasdraft" type="submit" id="saveasdraft" tabindex="9" value="<?php _e('Save as Draft') ?>" /> diff --git a/wp-admin/edit-link-form.php b/wp-admin/edit-link-form.php index 30002e6..ac9c831 100644 --- a/wp-admin/edit-link-form.php +++ b/wp-admin/edit-link-form.php @@ -48,7 +48,7 @@ function xfn_check($class, $value = '', $type = 'check') { <div id="searchresults" class="autocomplete"></div>
<?php autocomplete_textbox( "wpmu-edit.php?action=searchcategories&search=", "newcat", "searchresults" ); ?>
<?php endif; ?>
-<ul id="categorychecklist"><?php dropdown_categories(get_settings('default_link_category')); ?></ul>
+<ul id="categorychecklist"><?php dropdown_categories(get_option('default_link_category')); ?></ul>
</div>
</fieldset>
diff --git a/wp-admin/edit-page-form.php b/wp-admin/edit-page-form.php index 24b402a..aea02c8 100644 --- a/wp-admin/edit-page-form.php +++ b/wp-admin/edit-page-form.php @@ -95,13 +95,13 @@ addLoadEvent(focusit); <?php } ?> <fieldset id="slugdiv" class="dbx-box"> -<h3 class="dbx-handle"><?php _e('Page slug') ?></h3> +<h3 class="dbx-handle"><?php _e('Page Slug') ?></h3> <div class="dbx-content"><input name="post_name" type="text" size="13" id="post_name" value="<?php echo $post->post_name ?>" /></div> </fieldset> <?php if ( $authors = get_editable_authors( $current_user->id ) ) : // TODO: ROLE SYSTEM ?> <fieldset id="authordiv" class="dbx-box"> -<h3 class="dbx-handle"><?php _e('Page author'); ?>:</h3> +<h3 class="dbx-handle"><?php _e('Page Author'); ?>:</h3> <div class="dbx-content"> <select name="post_author_override" id="post_author_override"> <?php diff --git a/wp-admin/edit.php b/wp-admin/edit.php index a39338d..c473e46 100644 --- a/wp-admin/edit.php +++ b/wp-admin/edit.php @@ -112,6 +112,14 @@ if ( count($arc_result) ) { ?> <?php } ?> +<form name="viewcat" action="" method="get" style="float: left; width: 30em; margin-bottom: 1em;"> + <fieldset> + <legend><?php _e('Browse Category…') ?></legend> + <?php wp_dropdown_categories('show_option_all=All&hide_empty=0&hierarchical=1&show_count=1&selected='.$cat);?> + <input type="submit" name="submit" value="<?php _e('Show Category') ?>" /> + </fieldset> +</form> + <br style="clear:both;" /> <?php diff --git a/wp-admin/export.php b/wp-admin/export.php index 755dba8..300d6c9 100644 --- a/wp-admin/export.php +++ b/wp-admin/export.php @@ -27,7 +27,7 @@ function export_wp() { header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header("Content-Disposition: attachment; filename=$filename");
-header('Content-type: text/xml; charset=' . get_settings('blog_charset'), true);
+header('Content-type: text/xml; charset=' . get_option('blog_charset'), true);
//$posts = query_posts('');
$posts = $wpdb->get_results("SELECT * FROM $wpdb->posts ORDER BY post_date_gmt ASC");
?>
diff --git a/wp-admin/import/blogger.php b/wp-admin/import/blogger.php index 68541b0..6328f16 100644 --- a/wp-admin/import/blogger.php +++ b/wp-admin/import/blogger.php @@ -24,7 +24,7 @@ class Blogger_Import { function reencode($text) {
return $text;
- return mb_convert_encoding($text, get_setting('blog_charset'), $this->import['blogs'][$_GET['blog']]['options']['blog-formatting']['backup']['encoding']);
+ return mb_convert_encoding($text, get_option('blog_charset'), $this->import['blogs'][$_GET['blog']]['options']['blog-formatting']['backup']['encoding']);
}
// Deletes saved data and redirect.
@@ -609,7 +609,7 @@ class Blogger_Import { if ( isset($_GET['noheader']) ) {
header('Content-Type: text/html; charset=utf-8');
- $this->import = get_settings('import-blogger');
+ $this->import = get_option('import-blogger');
if ( false === $this->import ) {
$step = 0;
diff --git a/wp-admin/inline-uploading.php b/wp-admin/inline-uploading.php index bd2a2b9..d65f450 100644 --- a/wp-admin/inline-uploading.php +++ b/wp-admin/inline-uploading.php @@ -286,7 +286,7 @@ wp_die(__('This script was not meant to be called directly.')); <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
-<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_settings('blog_charset'); ?>" />
+<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
<title></title>
<meta http-equiv="imagetoolbar" content="no" />
<script type="text/javascript">
diff --git a/wp-admin/link-add.php b/wp-admin/link-add.php index 713a8d5..087fc45 100644 --- a/wp-admin/link-add.php +++ b/wp-admin/link-add.php @@ -27,7 +27,7 @@ require('admin-header.php'); ?> <div class="wrap"> -<?php printf(__('<p>You can drag <a href="%s" title="Link add bookmarklet">Link This</a> to your toolbar and when you click it a window will pop up that will allow you to add whatever site you’re on to your bookmarks! Right now this only works on Mozilla or Netscape, but we’re working on it.</p>'), "javascript:void(linkmanpopup=window.open('" . get_settings('siteurl') . "/wp-admin/link-add.php?action=popup&linkurl='+escape(location.href)+'&name='+escape(document.title),'LinkManager','scrollbars=yes,width=750,height=550,left=15,top=15,status=yes,resizable=yes'));linkmanpopup.focus();window.focus();linkmanpopup.focus();") ?> +<?php printf(__('<p>You can drag <a href="%s" title="Link add bookmarklet">Link This</a> to your toolbar and when you click it a window will pop up that will allow you to add whatever site you’re on to your bookmarks! Right now this only works on Mozilla or Netscape, but we’re working on it.</p>'), "javascript:void(linkmanpopup=window.open('" . get_option('siteurl') . "/wp-admin/link-add.php?action=popup&linkurl='+escape(location.href)+'&name='+escape(document.title),'LinkManager','scrollbars=yes,width=750,height=550,left=15,top=15,status=yes,resizable=yes'));linkmanpopup.focus();window.focus();linkmanpopup.focus();") ?> </div> <?php diff --git a/wp-admin/link-manager.php b/wp-admin/link-manager.php index 337e7b5..7a15323 100644 --- a/wp-admin/link-manager.php +++ b/wp-admin/link-manager.php @@ -105,7 +105,7 @@ printf(__('Currently showing %1$s links ordered by %2$s'), $select_cat, $select_ <thead> <tr> <th width="15%" style="text-align: left"><?php _e('Name') ?></th> - <th style="text-align: left"><?php _e('URI') ?></th> + <th style="text-align: left"><?php _e('URL') ?></th> <th style="text-align: left"><?php _e('Categories') ?></th> <th><?php _e('rel') ?></th> <th><?php _e('Visible') ?></th> diff --git a/wp-admin/list-manipulation-js.php b/wp-admin/list-manipulation-js.php index 8711b28..288ec1e 100644 --- a/wp-admin/list-manipulation-js.php +++ b/wp-admin/list-manipulation-js.php @@ -1,7 +1,7 @@ <?php require_once('admin.php'); -header('Content-type: text/javascript; charset=' . get_settings('blog_charset'), true); -$handler = get_settings( 'siteurl' ) . '/wp-admin/admin-ajax.php'; +cache_javascript_headers(); +$handler = get_option( 'siteurl' ) . '/wp-admin/admin-ajax.php'; ?> addLoadEvent(function(){theList=new listMan();}); function deleteSomething(what,id,message,obj){if(!obj)obj=theList;if(!message)message="<?php printf(__('Are you sure you want to delete this %s?'),"'+what+'"); ?>";if(confirm(message))return obj.ajaxDelete(what,id);else return false;} diff --git a/wp-admin/menu-header.php b/wp-admin/menu-header.php index 416a229..64aa41f 100644 --- a/wp-admin/menu-header.php +++ b/wp-admin/menu-header.php @@ -13,9 +13,9 @@ foreach ($menu as $item) { if ( !empty($submenu[$item[2]]) || current_user_can($item[1]) ) { if ( file_exists(ABSPATH . "wp-content/plugins/{$item[2]}") ) - echo "\n\t<li><a href='" . get_settings('siteurl') . "/wp-admin/admin.php?page={$item[2]}'$class>{$item[0]}</a></li>"; + echo "\n\t<li><a href='" . get_option('siteurl') . "/wp-admin/admin.php?page={$item[2]}'$class>{$item[0]}</a></li>"; else - echo "\n\t<li><a href='" . get_settings('siteurl') . "/wp-admin/{$item[2]}'$class>{$item[0]}</a></li>"; + echo "\n\t<li><a href='" . get_option('siteurl') . "/wp-admin/{$item[2]}'$class>{$item[0]}</a></li>"; } } @@ -42,11 +42,11 @@ $menu_hook = get_plugin_page_hook($item[2], $parent_file); if (file_exists(ABSPATH . "wp-content/plugins/{$item[2]}") || ! empty($menu_hook)) { if ( 'admin.php' == $pagenow ) - echo "\n\t<li><a href='" . get_settings('siteurl') . "/wp-admin/admin.php?page={$item[2]}'$class>{$item[0]}</a></li>"; + echo "\n\t<li><a href='" . get_option('siteurl') . "/wp-admin/admin.php?page={$item[2]}'$class>{$item[0]}</a></li>"; else - echo "\n\t<li><a href='" . get_settings('siteurl') . "/wp-admin/{$parent_file}?page={$item[2]}'$class>{$item[0]}</a></li>"; + echo "\n\t<li><a href='" . get_option('siteurl') . "/wp-admin/{$parent_file}?page={$item[2]}'$class>{$item[0]}</a></li>"; } else { - echo "\n\t<li><a href='" . get_settings('siteurl') . "/wp-admin/{$item[2]}'$class>{$item[0]}</a></li>"; + echo "\n\t<li><a href='" . get_option('siteurl') . "/wp-admin/{$item[2]}'$class>{$item[0]}</a></li>"; } endforeach; ?> diff --git a/wp-admin/moderation.php b/wp-admin/moderation.php index 799fd0d..9fae674 100644 --- a/wp-admin/moderation.php +++ b/wp-admin/moderation.php @@ -47,7 +47,7 @@ case 'update': break; case 'approve': wp_set_comment_status($key, 'approve'); - if ( get_settings('comments_notify') == true ) { + if ( get_option('comments_notify') == true ) { wp_notify_postauthor($key); } ++$item_approved; @@ -125,7 +125,7 @@ if ($comments) { $i = 0; foreach($comments as $comment) { ++$i; - $comment_date = mysql2date(get_settings("date_format") . " @ " . get_settings("time_format"), $comment->comment_date); + $comment_date = mysql2date(get_option("date_format") . " @ " . get_option("time_format"), $comment->comment_date); $post_title = $wpdb->get_var("SELECT post_title FROM $wpdb->posts WHERE ID='$comment->comment_post_ID'"); if ($i % 2) $class = 'js-unapproved alternate'; else $class = 'js-unapproved'; diff --git a/wp-admin/options-discussion.php b/wp-admin/options-discussion.php index 8776664..e7317ce 100644 --- a/wp-admin/options-discussion.php +++ b/wp-admin/options-discussion.php @@ -27,17 +27,17 @@ if ($action == 'retrospam') { <ul> <li> <label for="default_pingback_flag"> -<input name="default_pingback_flag" type="checkbox" id="default_pingback_flag" value="1" <?php checked('1', get_settings('default_pingback_flag')); ?> /> +<input name="default_pingback_flag" type="checkbox" id="default_pingback_flag" value="1" <?php checked('1', get_option('default_pingback_flag')); ?> /> <?php _e('Attempt to notify any Weblogs linked to from the article (slows down posting.)') ?></label> </li> <li> <label for="default_ping_status"> -<input name="default_ping_status" type="checkbox" id="default_ping_status" value="open" <?php checked('open', get_settings('default_ping_status')); ?> /> +<input name="default_ping_status" type="checkbox" id="default_ping_status" value="open" <?php checked('open', get_option('default_ping_status')); ?> /> <?php _e('Allow link notifications from other Weblogs (pingbacks and trackbacks.)') ?></label> </li> <li> <label for="default_comment_status"> -<input name="default_comment_status" type="checkbox" id="default_comment_status" value="open" <?php checked('open', get_settings('default_comment_status')); ?> /> +<input name="default_comment_status" type="checkbox" id="default_comment_status" value="open" <?php checked('open', get_option('default_comment_status')); ?> /> <?php _e('Allow people to post comments on the article') ?></label> </li> </ul> @@ -47,12 +47,12 @@ if ($action == 'retrospam') { <ul> <li> <label for="comments_notify"> -<input name="comments_notify" type="checkbox" id="comments_notify" value="1" <?php checked('1', get_settings('comments_notify')); ?> /> +<input name="comments_notify" type="checkbox" id="comments_notify" value="1" <?php checked('1', get_option('comments_notify')); ?> /> <?php _e('Anyone posts a comment') ?> </label> </li> <li> <label for="moderation_notify"> -<input name="moderation_notify" type="checkbox" id="moderation_notify" value="1" <?php checked('1', get_settings('moderation_notify')); ?> /> +<input name="moderation_notify" type="checkbox" id="moderation_notify" value="1" <?php checked('1', get_option('moderation_notify')); ?> /> <?php _e('A comment is held for moderation') ?> </label> </li> </ul> @@ -62,18 +62,18 @@ if ($action == 'retrospam') { <ul> <li> <label for="comment_moderation"> -<input name="comment_moderation" type="checkbox" id="comment_moderation" value="1" <?php checked('1', get_settings('comment_moderation')); ?> /> +<input name="comment_moderation" type="checkbox" id="comment_moderation" value="1" <?php checked('1', get_option('comment_moderation')); ?> /> <?php _e('An administrator must approve the comment (regardless of any matches below)') ?> </label> </li> -<li><label for="require_name_email"><input type="checkbox" name="require_name_email" id="require_name_email" value="1" <?php checked('1', get_settings('require_name_email')); ?> /> <?php _e('Comment author must fill out name and e-mail') ?></label></li> -<li><label for="comment_whitelist"><input type="checkbox" name="comment_whitelist" id="comment_whitelist" value="1" <?php checked('1', get_settings('comment_whitelist')); ?> /> <?php _e('Comment author must have a previously approved comment') ?></label></li> +<li><label for="require_name_email"><input type="checkbox" name="require_name_email" id="require_name_email" value="1" <?php checked('1', get_option('require_name_email')); ?> /> <?php _e('Comment author must fill out name and e-mail') ?></label></li> +<li><label for="comment_whitelist"><input type="checkbox" name="comment_whitelist" id="comment_whitelist" value="1" <?php checked('1', get_option('comment_whitelist')); ?> /> <?php _e('Comment author must have a previously approved comment') ?></label></li> </ul> </fieldset> <fieldset class="options"> <legend><?php _e('Comment Moderation') ?></legend> -<p><?php printf(__('Hold a comment in the queue if it contains more than %s links. (A common characteristic of comment spam is a large number of hyperlinks.)'), '<input name="comment_max_links" type="text" id="comment_max_links" size="3" value="' . get_settings('comment_max_links'). '" />' ) ?></p> +<p><?php printf(__('Hold a comment in the queue if it contains more than %s links. (A common characteristic of comment spam is a large number of hyperlinks.)'), '<input name="comment_max_links" type="text" id="comment_max_links" size="3" value="' . get_option('comment_max_links'). '" />' ) ?></p> -<p><?php _e('When a comment contains any of these words in its content, name, URI, e-mail, or IP, hold it in the moderation queue: (Separate multiple words with new lines.) <a href="http://codex.wordpress.org/Spam_Words">Common spam words</a>.') ?></p> +<p><?php _e('When a comment contains any of these words in its content, name, URL, e-mail, or IP, hold it in the moderation queue: (Separate multiple words with new lines.) <a href="http://codex.wordpress.org/Spam_Words">Common spam words</a>.') ?></p> <p> <textarea name="moderation_keys" cols="60" rows="4" id="moderation_keys" style="width: 98%; font-size: 12px;" class="code"><?php form_option('moderation_keys'); ?></textarea> </p> diff --git a/wp-admin/options-general.php b/wp-admin/options-general.php index 91ac1d7..a39cdbe 100644 --- a/wp-admin/options-general.php +++ b/wp-admin/options-general.php @@ -27,11 +27,10 @@ include('./admin-header.php'); <td><label><input type="checkbox" name="blog_public" value="1" <?php checked('1', $current_blog->public); ?> /> <?php _e('I would like my blog to appear in search engines like Google and Technorati, and in public listings around WordPress.com.'); ?></label> (<a href="http://wordpress.com/blog/2006/01/29/a-little-privacy/">more</a>) </td> </tr> - <tr valign="top"> <th scope="row"><?php _e('Membership:') ?></th> <td> <label for="comment_registration"> -<input name="comment_registration" type="checkbox" id="comment_registration" value="1" <?php checked('1', get_settings('comment_registration')); ?> /> +<input name="comment_registration" type="checkbox" id="comment_registration" value="1" <?php checked('1', get_option('comment_registration')); ?> /> <?php _e('Users must be registered and logged in to comment') ?> </label> </td> @@ -87,12 +86,12 @@ if( is_array( $lang_files ) && count($lang_files) > 1 ) { <tr> <th scope="row"><?php _e('Default date format:') ?></th> <td><input name="date_format" type="text" id="date_format" size="30" value="<?php form_option('date_format'); ?>" /><br /> -<?php _e('Output:') ?> <strong><?php echo mysql2date(get_settings('date_format'), current_time('mysql')); ?></strong></td> +<?php _e('Output:') ?> <strong><?php echo mysql2date(get_option('date_format'), current_time('mysql')); ?></strong></td> </tr> <tr> <th scope="row"><?php _e('Default time format:') ?></th> <td><input name="time_format" type="text" id="time_format" size="30" value="<?php form_option('time_format'); ?>" /><br /> -<?php _e('Output:') ?> <strong><?php echo gmdate(get_settings('time_format'), current_time('timestamp')); ?></strong></td> +<?php _e('Output:') ?> <strong><?php echo gmdate(get_option('time_format'), current_time('timestamp')); ?></strong></td> </tr> <tr> <th scope="row"> </th> @@ -103,7 +102,7 @@ if( is_array( $lang_files ) && count($lang_files) > 1 ) { <td><select name="start_of_week" id="start_of_week"> <?php for ($day_index = 0; $day_index <= 6; $day_index++) : - $selected = (get_settings('start_of_week') == $day_index) ? 'selected="selected"' : ''; + $selected = (get_option('start_of_week') == $day_index) ? 'selected="selected"' : ''; echo "\n\t<option value='$day_index' $selected>" . $wp_locale->get_weekday($day_index) . '</option>'; endfor; ?> diff --git a/wp-admin/options-misc.php b/wp-admin/options-misc.php index 3dd1120..1989f33 100644 --- a/wp-admin/options-misc.php +++ b/wp-admin/options-misc.php @@ -18,7 +18,7 @@ include('admin-header.php'); <table class="editform optiontable"> <tr valign="top"> <th scope="row"><?php _e('Store uploads in this folder'); ?>:</th> -<td><input name="upload_path" type="text" id="upload_path" class="code" value="<?php echo str_replace(ABSPATH, '', get_settings('upload_path')); ?>" size="40" /> +<td><input name="upload_path" type="text" id="upload_path" class="code" value="<?php echo wp_specialchars(str_replace(ABSPATH, '', get_option('upload_path')), 1); ?>" size="40" /> <br /> <?php _e('Default is <code>wp-content/uploads</code>'); ?> </td> @@ -27,7 +27,7 @@ include('admin-header.php'); <td></td> <td> <label for="uploads_use_yearmonth_folders"> -<input name="uploads_use_yearmonth_folders" type="checkbox" id="uploads_use_yearmonth_folders" value="1" <?php checked('1', get_settings('uploads_use_yearmonth_folders')); ?> /> +<input name="uploads_use_yearmonth_folders" type="checkbox" id="uploads_use_yearmonth_folders" value="1" <?php checked('1', get_option('uploads_use_yearmonth_folders')); ?> /> <?php _e('Organize my uploads into month- and year-based folders'); ?> </label> </td> @@ -35,10 +35,10 @@ include('admin-header.php'); </table> </fieldset> -<p><input name="use_linksupdate" type="checkbox" id="use_linksupdate" value="1" <?php checked('1', get_settings('use_linksupdate')); ?> /> +<p><input name="use_linksupdate" type="checkbox" id="use_linksupdate" value="1" <?php checked('1', get_option('use_linksupdate')); ?> /> <label for="use_linksupdate"><?php _e('Track Bookmarks’ Update Times') ?></label></p> <p> -<label><input type="checkbox" name="hack_file" value="1" <?php checked('1', get_settings('hack_file')); ?> /> <?php _e('Use legacy <code>my-hacks.php</code> file support') ?></label> +<label><input type="checkbox" name="hack_file" value="1" <?php checked('1', get_option('hack_file')); ?> /> <?php _e('Use legacy <code>my-hacks.php</code> file support') ?></label> </p> <p class="submit"> diff --git a/wp-admin/options-permalink.php b/wp-admin/options-permalink.php index 5b48a8f..68898a9 100644 --- a/wp-admin/options-permalink.php +++ b/wp-admin/options-permalink.php @@ -81,8 +81,8 @@ if ( isset($_POST['permalink_structure']) || isset($_POST['category_base']) ) { } } -$permalink_structure = get_settings('permalink_structure'); -$category_base = get_settings('category_base'); +$permalink_structure = get_option('permalink_structure'); +$category_base = get_option('category_base'); if ( (!file_exists($home_path.'.htaccess') && is_writable($home_path)) || is_writable($home_path.'.htaccess') ) $writable = true; @@ -108,7 +108,7 @@ else <div class="wrap"> <h2><?php _e('Customize Permalink Structure') ?></h2> - <p><?php _e('By default WordPress uses web URIs which have question marks and lots of numbers in them, however WordPress offers you the ability to create a custom URI structure for your permalinks and archives. This can improve the aesthetics, usability, and forward-compatibility of your links. A <a href="http://codex.wordpress.org/Using_Permalinks">number of tags are available</a>, and here are some examples to get you started.'); ?></p> + <p><?php _e('By default WordPress uses web <abbr title="Universal Resource Locator">URL</abbr>s which have question marks and lots of numbers in them, however WordPress offers you the ability to create a custom URL structure for your permalinks and archives. This can improve the aesthetics, usability, and forward-compatibility of your links. A <a href="http://codex.wordpress.org/Using_Permalinks">number of tags are available</a>, and here are some examples to get you started.'); ?></p> <?php $prefix = ''; @@ -128,19 +128,19 @@ $structures = array( <p> <label> <input name="selection" type="radio" value="" class="tog" <?php checked('', $permalink_structure); ?> /> -<?php _e('Default'); ?><br /> <span> » <code><?php echo get_settings('home'); ?>/?p=123</code></span> +<?php _e('Default'); ?><br /> <span> » <code><?php echo get_option('home'); ?>/?p=123</code></span> </label> </p> <p> <label> <input name="selection" type="radio" value="<?php echo $structures[1]; ?>" class="tog" <?php checked($structures[1], $permalink_structure); ?> /> -<?php _e('Date and name based'); ?><br /> <span> » <code><?php echo get_settings('home') . $prefix . '/' . date('Y') . '/' . date('m') . '/' . date('d') . '/sample-post/'; ?></code></span> +<?php _e('Date and name based'); ?><br /> <span> » <code><?php echo get_option('home') . $prefix . '/' . date('Y') . '/' . date('m') . '/' . date('d') . '/sample-post/'; ?></code></span> </label> </p> <p> <label> <input name="selection" type="radio" value="<?php echo $structures[2]; ?>" class="tog" <?php checked($structures[2], $permalink_structure); ?> /> -<?php _e('Numeric'); ?><br /> <span> » <code><?php echo get_settings('home') . $prefix ; ?>/archives/123</code></span> +<?php _e('Numeric'); ?><br /> <span> » <code><?php echo get_option('home') . $prefix ; ?>/archives/123</code></span> </label> </p> <p> @@ -158,9 +158,9 @@ checked="checked" <h3><?php _e('Optional'); ?></h3> <?php if ($is_apache) : ?> - <p><?php _e('If you like, you may enter a custom prefix for your category URIs here. For example, <code>/taxonomy/tags</code> would make your category links like <code>http://example.org/taxonomy/tags/uncategorized/</code>. If you leave this blank the default will be used.') ?></p> + <p><?php _e('If you like, you may enter a custom prefix for your category <abbr title="Universal Resource Locator">URL</abbr>s here. For example, <code>/taxonomy/tags</code> would make your category links like <code>http://example.org/taxonomy/tags/uncategorized/</code>. If you leave this blank the default will be used.') ?></p> <?php else : ?> - <p><?php _e('If you like, you may enter a custom prefix for your category URIs here. For example, <code>/index.php/taxonomy/tags</code> would make your category links like <code>http://example.org/index.php/taxonomy/tags/uncategorized/</code>. If you leave this blank the default will be used.') ?></p> + <p><?php _e('If you like, you may enter a custom prefix for your category <abbr title="Universal Resource Locator">URL</abbr>s here. For example, <code>/index.php/taxonomy/tags</code> would make your category links like <code>http://example.org/index.php/taxonomy/tags/uncategorized/</code>. If you leave this blank the default will be used.') ?></p> <?php endif; ?> <p> <?php _e('Category base'); ?>: <?php if( $current_site->domain.$current_site->path == $current_blog->domain.$current_blog->path ) { echo "/blog"; $category_base = str_replace( "/blog", "", $category_base ); }?><input name="category_base" type="text" class="code" value="<?php echo $category_base; ?>" size="30" /> diff --git a/wp-admin/options-reading.php b/wp-admin/options-reading.php index ef0b6cf..232c90a 100644 --- a/wp-admin/options-reading.php +++ b/wp-admin/options-reading.php @@ -54,8 +54,8 @@ include('admin-header.php'); <td> <input name="posts_per_page" type="text" id="posts_per_page" value="<?php form_option('posts_per_page'); ?>" size="3" /> <select name="what_to_show" id="what_to_show" > -<option value="days" <?php selected('days', get_settings('what_to_show')); ?>><?php _e('days') ?></option> -<option value="posts" <?php selected('posts', get_settings('what_to_show')); ?>><?php _e('posts') ?></option> +<option value="days" <?php selected('days', get_option('what_to_show')); ?>><?php _e('days') ?></option> +<option value="posts" <?php selected('posts', get_option('what_to_show')); ?>><?php _e('posts') ?></option> </select> </td> </tr> @@ -72,8 +72,8 @@ include('admin-header.php'); <tr valign="top"> <th scope="row"><?php _e('For each article, show:') ?> </th> <td> -<label><input name="rss_use_excerpt" type="radio" value="0" <?php checked(0, get_settings('rss_use_excerpt')); ?> /> <?php _e('Full text') ?></label><br /> -<label><input name="rss_use_excerpt" type="radio" value="1" <?php checked(1, get_settings('rss_use_excerpt')); ?> /> <?php _e('Summary') ?></label> +<label><input name="rss_use_excerpt" type="radio" value="0" <?php checked(0, get_option('rss_use_excerpt')); ?> /> <?php _e('Full text') ?></label><br /> +<label><input name="rss_use_excerpt" type="radio" value="1" <?php checked(1, get_option('rss_use_excerpt')); ?> /> <?php _e('Summary') ?></label> </td> </tr> </table> diff --git a/wp-admin/options-writing.php b/wp-admin/options-writing.php index 4f362d3..4cd82ae 100644 --- a/wp-admin/options-writing.php +++ b/wp-admin/options-writing.php @@ -21,9 +21,9 @@ include('admin-header.php'); <th scope="row"><?php _e('Formatting:') ?></th> <td> <label for="use_smilies"> -<input name="use_smilies" type="checkbox" id="use_smilies" value="1" <?php checked('1', get_settings('use_smilies')); ?> /> +<input name="use_smilies" type="checkbox" id="use_smilies" value="1" <?php checked('1', get_option('use_smilies')); ?> /> <?php _e('Convert emoticons like <code>:-)</code> and <code>:-P</code> to graphics on display') ?></label><br /> -<label for="use_balanceTags"><input name="use_balanceTags" type="checkbox" id="use_balanceTags" value="1" <?php checked('1', get_settings('use_balanceTags')); ?> /> <?php _e('WordPress should correct invalidly nested XHTML automatically') ?></label> +<label for="use_balanceTags"><input name="use_balanceTags" type="checkbox" id="use_balanceTags" value="1" <?php checked('1', get_option('use_balanceTags')); ?> /> <?php _e('WordPress should correct invalidly nested XHTML automatically') ?></label> </td> </tr> <tr valign="top"> @@ -32,7 +32,7 @@ include('admin-header.php'); <?php $categories = $wpdb->get_results("SELECT * FROM $wpdb->categories ORDER BY cat_name"); foreach ($categories as $category) : -if ($category->cat_ID == get_settings('default_category')) $selected = " selected='selected'"; +if ($category->cat_ID == get_option('default_category')) $selected = " selected='selected'"; else $selected = ''; echo "\n\t<option value='$category->cat_ID' $selected>$category->cat_name</option>"; endforeach; @@ -44,7 +44,7 @@ endforeach; <td><select name="default_link_category" id="default_link_category"> <?php foreach ($categories as $category) : -if ($category->cat_ID == get_settings('default_link_category')) $selected = " selected='selected'"; +if ($category->cat_ID == get_option('default_link_category')) $selected = " selected='selected'"; else $selected = ''; echo "\n\t<option value='$category->cat_ID' $selected>$category->cat_name</option>"; endforeach; diff --git a/wp-admin/options.php b/wp-admin/options.php index b6a8c50..c521d54 100644 --- a/wp-admin/options.php +++ b/wp-admin/options.php @@ -10,6 +10,67 @@ wp_reset_vars(array('action')); if ( !current_user_can('manage_options') ) wp_die(__('Cheatin’ uh?')); +function sanitize_option($option, $value) { + + switch ($option) { + case 'admin_email': + $value = sanitize_email($value); + break; + + case 'default_post_edit_rows': + case 'mailserver_port': + case 'comment_max_links': + $value = abs((int) $value); + break; + + case 'posts_per_page': + case 'posts_per_rss': + $value = (int) $value; + if ( empty($value) ) $value = 1; + if ( $value < -1 ) $value = abs($value); + break; + + case 'default_ping_status': + case 'default_comment_status': + // Options that if not there have 0 value but need to be something like "closed" + if ( $value == '0' || $value == '') + $value = 'closed'; + break; + + case 'blogdescription': + case 'blogname': + if (current_user_can('unfiltered_html') == false) + $value = wp_filter_post_kses( $value ); + break; + + case 'blog_charset': + $value = preg_replace('/[^a-zA-Z0-9_-]/', '', $value); + break; + + case 'date_format': + case 'time_format': + case 'mailserver_url': + case 'mailserver_login': + case 'mailserver_pass': + case 'ping_sites': + case 'upload_path': + $value = strip_tags($value); + $value = wp_filter_kses($value); + break; + + case 'gmt_offset': + $value = preg_replace('/[^0-9:.-]/', '', $value); + break; + + case 'siteurl': + case 'home': + $value = clean_url($value); + break; + } + + return $value; +} + if( $_GET[ 'adminhash' ] ) { $new_admin_details = get_option( 'new_admin_email' ); if( is_array( $new_admin_details ) && $new_admin_details[ 'hash' ] == $_GET[ 'adminhash' ] && $new_admin_details[ 'newemail' ] != '' ) { @@ -36,8 +97,8 @@ case 'update': } // Save for later. - $old_siteurl = get_settings('siteurl'); - $old_home = get_settings('home'); + $old_siteurl = get_option('siteurl'); + $old_home = get_option('home'); // HACK // Options that if not there have 0 value but need to be something like "closed" @@ -46,7 +107,8 @@ case 'update': foreach ($options as $option) { $option = trim($option); $value = trim(stripslashes($_POST[$option])); - if( in_array($option, $nonbools) && ( $value == '0' || $value == '') ) + $value = sanitize_option($option, $value); + if( in_array($option, $nonbools) && ( $value == '0' || $value == '') ) $value = 'closed'; if( $option == 'blogdescription' || $option == 'blogname' ) @@ -93,13 +155,13 @@ This email has been sent to '{$value}' if ($any_changed) { // If siteurl or home changed, reset cookies. - if ( get_settings('siteurl') != $old_siteurl || get_settings('home') != $old_home ) { + if ( get_option('siteurl') != $old_siteurl || get_option('home') != $old_home ) { // If home changed, write rewrite rules to new location. $wp_rewrite->flush_rules(); // Clear cookies for old paths. wp_clearcookie(); // Set cookies for new paths. - wp_setcookie($user_login, $user_pass_md5, true, get_settings('home'), get_settings('siteurl')); + wp_setcookie($user_login, $user_pass_md5, true, get_option('home'), get_option('siteurl')); } //$message = sprintf(__('%d setting(s) saved... '), $any_changed); diff --git a/wp-admin/page.php b/wp-admin/page.php index 74f144e..78f17d2 100644 --- a/wp-admin/page.php +++ b/wp-admin/page.php @@ -149,8 +149,8 @@ case 'delete': } $sendback = wp_get_referer(); - if (strstr($sendback, 'page.php')) $sendback = get_settings('siteurl') .'/wp-admin/page.php'; - elseif (strstr($sendback, 'attachments.php')) $sendback = get_settings('siteurl') .'/wp-admin/attachments.php'; + if (strstr($sendback, 'page.php')) $sendback = get_option('siteurl') .'/wp-admin/page.php'; + elseif (strstr($sendback, 'attachments.php')) $sendback = get_option('siteurl') .'/wp-admin/attachments.php'; $sendback = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $sendback); wp_redirect($sendback); exit(); diff --git a/wp-admin/plugin-editor.php b/wp-admin/plugin-editor.php index 690baaf..c604d19 100644 --- a/wp-admin/plugin-editor.php +++ b/wp-admin/plugin-editor.php @@ -42,10 +42,11 @@ break; default: - require_once('admin-header.php'); if ( !current_user_can('edit_plugins') ) wp_die('<p>'.__('You do not have sufficient permissions to edit plugins for this blog.').'</p>'); + require_once('admin-header.php'); + update_recently_edited("wp-content/plugins/$file"); if (!is_file($real_file)) diff --git a/wp-admin/plugins.php b/wp-admin/plugins.php index c5bef8b..55f6bb5 100644 --- a/wp-admin/plugins.php +++ b/wp-admin/plugins.php @@ -11,7 +11,7 @@ if( $menu_perms[ 'plugins' ] != 1 ) if ( isset($_GET['action']) ) { if ('activate' == $_GET['action']) { check_admin_referer('activate-plugin_' . $_GET['plugin']); - $current = get_settings('active_plugins'); + $current = get_option('active_plugins'); if (!in_array($_GET['plugin'], $current)) { $current[] = trim( $_GET['plugin'] ); sort($current); @@ -22,7 +22,7 @@ if ( isset($_GET['action']) ) { wp_redirect('plugins.php?activate=true'); } else if ('deactivate' == $_GET['action']) { check_admin_referer('deactivate-plugin_' . $_GET['plugin']); - $current = get_settings('active_plugins'); + $current = get_option('active_plugins'); array_splice($current, array_search( $_GET['plugin'], $current), 1 ); // Array-fu! update_option('active_plugins', $current); do_action('deactivate_' . trim( $_GET['plugin'] )); @@ -37,7 +37,7 @@ require_once('admin-header.php'); // Clean up options // If any plugins don't exist, axe 'em -$check_plugins = get_settings('active_plugins'); +$check_plugins = get_option('active_plugins'); // Sanity check. If the active plugin list is not an array, make it an // empty array. @@ -50,7 +50,7 @@ if ( !is_array($check_plugins) ) { // plugins. foreach ($check_plugins as $check_plugin) { if (!file_exists(ABSPATH . 'wp-content/plugins/' . $check_plugin)) { - $current = get_settings('active_plugins'); + $current = get_option('active_plugins'); $key = array_search($check_plugin, $current); if ( false !== $key && NULL !== $key ) { unset($current[$key]); @@ -74,8 +74,8 @@ foreach ($check_plugins as $check_plugin) { <p><?php _e('Plugins extend and expand the functionality of WordPress. Once a plugin is installed, you may activate it or deactivate it here.'); ?></p> <?php -if ( get_settings('active_plugins') ) - $current_plugins = get_settings('active_plugins'); +if ( get_option('active_plugins') ) + $current_plugins = get_option('active_plugins'); $plugins = get_plugins(); diff --git a/wp-admin/post-new.php b/wp-admin/post-new.php index 9aa49c7..45a5a5e 100644 --- a/wp-admin/post-new.php +++ b/wp-admin/post-new.php @@ -11,7 +11,7 @@ if ( ! current_user_can('edit_posts') ) { ?> <div class="wrap"> <p><?php printf(__('Since you’re a newcomer, you’ll have to wait for an admin to raise your level to 1, in order to be authorized to post.<br /> You can also <a href="mailto:%s?subject=Promotion?">e-mail the admin</a> to ask for a promotion.<br /> -When you’re promoted, just reload this page and you’ll be able to blog. :)'), get_settings('admin_email')); ?> +When you’re promoted, just reload this page and you’ll be able to blog. :)'), get_option('admin_email')); ?> </p> </div> <?php @@ -62,11 +62,11 @@ include('edit-form-advanced.php'); <?php if ($is_NS4 || $is_gecko) { ?> -<a href="javascript:if(navigator.userAgent.indexOf('Safari') >= 0){Q=getSelection();}else{Q=document.selection?document.selection.createRange().text:document.getSelection();}location.href='<?php echo get_settings('siteurl') ?>/wp-admin/post-new.php?text='+encodeURIComponent(Q)+'&popupurl='+encodeURIComponent(location.href)+'&popuptitle='+encodeURIComponent(document.title);"><?php printf(__('Press It - %s'), wp_specialchars(get_settings('blogname'))); ?></a> +<a href="javascript:if(navigator.userAgent.indexOf('Safari') >= 0){Q=getSelection();}else{Q=document.selection?document.selection.createRange().text:document.getSelection();}location.href='<?php echo get_option('siteurl') ?>/wp-admin/post-new.php?text='+encodeURIComponent(Q)+'&popupurl='+encodeURIComponent(location.href)+'&popuptitle='+encodeURIComponent(document.title);"><?php printf(__('Press It - %s'), wp_specialchars(get_option('blogname'))); ?></a> <?php } else if ($is_winIE) { ?> -<a href="javascript:Q='';if(top.frames.length==0)Q=document.selection.createRange().text;location.href='<?php echo get_settings('siteurl') ?>/wp-admin/post-new.php?text='+encodeURIComponent(Q)+'&popupurl='+encodeURIComponent(location.href)+'&popuptitle='+encodeURIComponent(document.title);"><?php printf(__('Press it - %s'), get_settings('blogname')); ?></a> +<a href="javascript:Q='';if(top.frames.length==0)Q=document.selection.createRange().text;location.href='<?php echo get_option('siteurl') ?>/wp-admin/post-new.php?text='+encodeURIComponent(Q)+'&popupurl='+encodeURIComponent(location.href)+'&popuptitle='+encodeURIComponent(document.title);"><?php printf(__('Press it - %s'), get_option('blogname')); ?></a> <script type="text/javascript"> <!-- function oneclickbookmarklet(blah) { @@ -81,11 +81,11 @@ window.open ("profile.php?action=IErightclick", "oneclickbookmarklet", "width=50 <?php } else if ($is_opera) { ?> -<a href="javascript:location.href='<?php echo get_settings('siteurl'); ?>/wp-admin/post-new.php?popupurl='+escape(location.href)+'&popuptitle='+escape(document.title);"><?php printf(__('Press it - %s'), get_settings('blogname')); ?></a> +<a href="javascript:location.href='<?php echo get_option('siteurl'); ?>/wp-admin/post-new.php?popupurl='+escape(location.href)+'&popuptitle='+escape(document.title);"><?php printf(__('Press it - %s'), get_option('blogname')); ?></a> <?php } else if ($is_macIE) { ?> -<a href="javascript:Q='';location.href='<?php echo get_settings('siteurl'); ?>/wp-admin/bookmarklet.php?text='+escape(document.getSelection())+'&popupurl='+escape(location.href)+'&popuptitle='+escape(document.title);"><?php printf(__('Press it - %s'), get_settings('blogname')); ?></a> +<a href="javascript:Q='';location.href='<?php echo get_option('siteurl'); ?>/wp-admin/bookmarklet.php?text='+escape(document.getSelection())+'&popupurl='+escape(location.href)+'&popuptitle='+escape(document.title);"><?php printf(__('Press it - %s'), get_option('blogname')); ?></a> <?php } ?> diff --git a/wp-admin/post.php b/wp-admin/post.php index 0ba14e4..7b1c71c 100644 --- a/wp-admin/post.php +++ b/wp-admin/post.php @@ -157,8 +157,8 @@ case 'delete': } $sendback = wp_get_referer(); - if (strstr($sendback, 'post.php')) $sendback = get_settings('siteurl') .'/wp-admin/post-new.php'; - elseif (strstr($sendback, 'attachments.php')) $sendback = get_settings('siteurl') .'/wp-admin/attachments.php'; + if (strstr($sendback, 'post.php')) $sendback = get_option('siteurl') .'/wp-admin/post-new.php'; + elseif (strstr($sendback, 'attachments.php')) $sendback = get_option('siteurl') .'/wp-admin/attachments.php'; $sendback = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $sendback); wp_redirect($sendback); exit(); diff --git a/wp-admin/profile.php b/wp-admin/profile.php index bee9487..9b90d10 100644 --- a/wp-admin/profile.php +++ b/wp-admin/profile.php @@ -8,7 +8,7 @@ if ( current_user_can('edit_users') ) else $parent_file = 'profile.php'; include_once('admin-header.php'); -$profileuser = new WP_User($user_ID); +$profileuser = get_user_to_edit($user_ID); $bookmarklet_height= 440; ?> @@ -31,7 +31,7 @@ $bookmarklet_height= 440; <h3><?php _e('Personal Options'); ?></h3> <p><label for="rich_editing"><input name="rich_editing" type="checkbox" id="rich_editing" value="true" <?php checked('true', get_user_option('rich_editing')); ?> /> -<?php _e('Use the visual rich editor when writing') ?></label></p> +<?php _e('Use the visual editor when writing') ?></label></p> <?php do_action('profile_personal_options'); ?> diff --git a/wp-admin/theme-editor.php b/wp-admin/theme-editor.php index 18c143c..037cc91 100644 --- a/wp-admin/theme-editor.php +++ b/wp-admin/theme-editor.php @@ -56,10 +56,11 @@ break; default: - require_once('admin-header.php'); if ( !current_user_can('edit_themes') ) wp_die('<p>'.__('You do not have sufficient permissions to edit themes for this blog.').'</p>'); + require_once('admin-header.php'); + update_recently_edited($file); if (!is_file($real_file)) diff --git a/wp-admin/update-links.php b/wp-admin/update-links.php index 4aa8a84..0ecbdd3 100644 --- a/wp-admin/update-links.php +++ b/wp-admin/update-links.php @@ -16,7 +16,7 @@ $query_string = "uris=$link_uris"; $http_request = "POST /updated-batch/ HTTP/1.0\r\n"; $http_request .= "Host: api.pingomatic.com\r\n"; -$http_request .= 'Content-Type: application/x-www-form-urlencoded; charset='.get_settings('blog_charset')."\r\n"; +$http_request .= 'Content-Type: application/x-www-form-urlencoded; charset='.get_option('blog_charset')."\r\n"; $http_request .= 'Content-Length: ' . strlen($query_string) . "\r\n"; $http_request .= 'User-Agent: WordPress/' . $wp_version . "\r\n"; $http_request .= "\r\n"; diff --git a/wp-admin/user-edit.php b/wp-admin/user-edit.php index 1731520..9583ddf 100644 --- a/wp-admin/user-edit.php +++ b/wp-admin/user-edit.php @@ -44,7 +44,7 @@ if( !is_wp_error( $errors ) ) { default: include ('admin-header.php'); -$profileuser = new WP_User($user_id); +$profileuser = get_user_to_edit($user_id); if ( !current_user_can('edit_user', $user_id) ) if ( !is_wp_error( $errors ) ) diff --git a/wp-admin/users.php b/wp-admin/users.php index 8f61d45..beee060 100644 --- a/wp-admin/users.php +++ b/wp-admin/users.php @@ -323,7 +323,7 @@ case 'adduser': check_admin_referer('add-user'); if ( ! current_user_can('create_users') ) - die(__('You can’t create users.')); + wp_die(__('You can’t create users.')); $user_id = add_user(); $update = 'add'; diff --git a/wp-admin/wp-admin.css b/wp-admin/wp-admin.css index 080614f..1ea420a 100644 --- a/wp-admin/wp-admin.css +++ b/wp-admin/wp-admin.css @@ -907,12 +907,17 @@ table .vers { border: 1px solid #ccc; } +#your-profile #rich_editing { + border: none; + background: #fff; +} + #your-profile fieldset { border: 1px solid #ccc; float: left; width: 40%; padding: .5em 2em; - margin: 1em; + margin: 1em 1em 1em 0; } #your-profile fieldset input { diff --git a/wp-admin/wpmu-edit.php b/wp-admin/wpmu-edit.php index 323d9ad..abf2732 100644 --- a/wp-admin/wpmu-edit.php +++ b/wp-admin/wpmu-edit.php @@ -133,7 +133,7 @@ switch( $_REQUEST[ 'action' ] ) { $blog_id = wpmu_create_blog($newdomain, $path, wp_specialchars( $blog['title'] ), $user_id ,'', $current_site->id); $wpdb->show_errors(); if( !is_wp_error($blog_id) ) { - @wp_mail( get_settings('admin_email'), sprintf(__('[%s] New Blog Created'), $current_site->site_name), "New blog created by {$current_user->user_login}\n\nAddress: http://{$newdomain}{$path}\nName: ".wp_specialchars( $blog['title'] ) ); + @wp_mail( get_option('admin_email'), sprintf(__('[%s] New Blog Created'), $current_site->site_name), "New blog created by {$current_user->user_login}\n\nAddress: http://{$newdomain}{$path}\nName: ".wp_specialchars( $blog['title'] ) ); wp_redirect( add_query_arg( "updated", "blogadded", $_SERVER[ 'HTTP_REFERER' ] ) ); die(); } else { |