Changeset 865

Show
Ignore:
Timestamp:
01/24/07 12:40:34 (2 years ago)
Author:
donncha
Message:

WP Merge to revision 4793

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-admin/admin-functions.php

    r860 r865  
    12831283        if ( $items ) { 
    12841284                foreach ( $items as $item ) { 
    1285                         // A page cannot be it's own parent. 
     1285                        // A page cannot be its own parent. 
    12861286                        if (!empty ( $post_ID ) ) { 
    12871287                                if ( $item->ID == $post_ID ) { 
     
    22042204                        $thumbpath = str_replace( basename( $file ), $thumb, $file ); 
    22052205 
    2206                         // move the thumbnail to it's final destination 
     2206                        // move the thumbnail to its final destination 
    22072207                        if ( $type[2] == 1 ) { 
    22082208                                if (!imagegif( $thumbnail, $thumbpath ) ) { 
     
    22292229                return $error; 
    22302230        } else { 
    2231                 apply_filters( 'wp_create_thumbnail', $thumbpath ); 
    2232                 return $thumbpath; 
     2231                return apply_filters( 'wp_create_thumbnail', $thumbpath ); 
    22332232        } 
    22342233} 
  • trunk/wp-admin/edit-form-advanced.php

    r860 r865  
    108108<?php if ( current_user_can('edit_posts') ) : ?> 
    109109<fieldset id="posttimestampdiv" class="dbx-box"> 
    110 <h3 class="dbx-handle"><?php _e('Post Timestamp'); ?>:</h3> 
     110<h3 class="dbx-handle"><?php _e('Post Timestamp'); ?></h3> 
    111111<div class="dbx-content"><?php touch_time(($action == 'edit')); ?></div> 
    112112</fieldset> 
     
    118118?> 
    119119<fieldset id="authordiv" class="dbx-box"> 
    120 <h3 class="dbx-handle"><?php _e('Post Author'); ?>:</h3> 
     120<h3 class="dbx-handle"><?php _e('Post Author'); ?></h3> 
    121121<div class="dbx-content"> 
    122122<select name="post_author_override" id="post_author_override"> 
  • trunk/wp-admin/edit-page-form.php

    r851 r865  
    9999<?php if ( $authors = get_editable_authors( $current_user->id ) ) : // TODO: ROLE SYSTEM ?> 
    100100<fieldset id="authordiv" class="dbx-box"> 
    101 <h3 class="dbx-handle"><?php _e('Page Author'); ?>:</h3> 
     101<h3 class="dbx-handle"><?php _e('Page Author'); ?></h3> 
    102102<div class="dbx-content"> 
    103103<select name="post_author_override" id="post_author_override"> 
  • trunk/wp-admin/users.php

    r828 r865  
    469469 
    470470        <form action="" method="get" name="search" id="search"> 
    471                 <p><input type="text" name="usersearch" id="usersearch" value="<?php echo attribute_escape($wp_user_search->search_term); ?>" /> <input type="submit" value="<?php _e('Search users &raquo;'); ?>" class="button" /></p> 
     471                <p><input type="text" name="usersearch" id="usersearch" value="<?php echo attribute_escape($wp_user_search->search_term); ?>" /> <input type="submit" value="<?php _e('Search Users &raquo;'); ?>" class="button" /></p> 
    472472        </form> 
    473473 
  • trunk/wp-admin/wp-admin.css

    r861 r865  
    202202        border: 1px solid #b2b2b2; 
    203203        color: #000; 
    204         font: 13px Verdana, Arial, Helvetica, sans-serif; 
     204        font: 13px Verdana, Arial, Helvetica, sans-serif; 
    205205        margin: 1px; 
    206206        padding: 3px; 
     
    209209#uploading { 
    210210        border-style: none; 
    211         padding: 0px
     211        padding: 0
    212212        margin-bottom: 16px; 
    213213        height: 18em; 
     
    460460} 
    461461 
    462  
    463462#adminmenu .current, #submenu .current { 
    464463        font-weight: bold; 
     
    530529} 
    531530 
    532  
    533531#categorydiv input, #poststatusdiv input, #commentstatusdiv input, #pingstatusdiv input { 
    534532        border: none; 
     
    537535#postdiv, #titlediv, #guiddiv { 
    538536        margin: 0 8px 0 0; 
    539         padding: 0px
     537        padding: 0
    540538} 
    541539 
    542540#postdivrich { 
    543         margin: 0px
    544         padding: 0px
     541        margin: 0
     542        padding: 0
    545543} 
    546544 
    547545#content { 
    548         margin: 0 0 0 0
     546        margin: 0
    549547        width: 100%; 
    550548} 
     
    556554 
    557555#titlediv input, #guiddiv input { 
    558         margin: 0px
     556        margin: 0
    559557        width: 100%; 
    560558} 
     
    580578#postdivrich #quicktags { 
    581579        background: #f0f0ee; 
    582         padding: 0px
     580        padding: 0
    583581        border: 1px solid #ccc; 
    584582        border-bottom: none; 
     
    594592 
    595593#quicktags #ed_toolbar { 
    596         padding: 0px 2px; 
     594        padding: 0 2px; 
    597595} 
    598596 
    599597#ed_toolbar input { 
    600         background: #fff url( images/fade-butt.png ) repeat-x 0px -2px; 
     598        background: #fff url( images/fade-butt.png ) repeat-x 0 -2px; 
    601599        margin: 3px 2px 2px; 
    602600} 
     
    644642 
    645643#excerpt, .attachmentlinks { 
    646         margin: 0px
     644        margin: 0
    647645        height: 4em; 
    648646        width: 100%; 
     
    815813#postcustom table { 
    816814        border: 1px solid #ccc; 
    817         margin: 0px
     815        margin: 0
    818816        width: 100%; 
    819817} 
     
    836834 
    837835* html #template div { 
    838         margin-right: 0px
     836        margin-right: 0
    839837} 
    840838 
     
    968966set display:none; */ 
    969967.zerosize { 
    970         height: 0px
    971         width: 0px
    972         margin: 0px
    973         border: 0px
    974         padding: 0px
     968        height: 0
     969        width: 0
     970        margin: 0
     971        border: 0
     972        padding: 0
    975973        overflow: hidden; 
    976974        position: absolute; 
     
    979977/* Box stuff */ 
    980978.dbx-clone { 
    981         position:absolute; 
    982         visibility:hidden; 
     979        position: absolute; 
     980        visibility: hidden; 
    983981} 
    984982.dbx-clone, .dbx-clone .dbx-handle-cursor { 
    985         cursor:move !important; 
     983        cursor: move !important; 
    986984} 
    987985.dbx-dummy { 
    988         display:block; 
    989         width:0; 
    990         height:0; 
    991         overflow:hidden; 
     986        display: block; 
     987        width: 0; 
     988        height: 0; 
     989        overflow: hidden; 
    992990} 
    993991.dbx-group, .dbx-box, .dbx-handle { 
    994         position:relative; 
    995         display:block; 
     992        position: relative; 
     993        display: block; 
    996994} 
    997995 
     
    1001999 
    10021000* html #themeselect { 
    1003         padding: 0px 3px; 
     1001        padding: 0 3px; 
    10041002        height: 22px; 
    10051003} 
     
    10111009*****************************************************************/ 
    10121010.dbx-box { 
    1013         margin:0; 
    1014         padding:0; 
    1015         border:none; 
     1011        margin: 0; 
     1012        padding: 0; 
     1013        border: none; 
    10161014} 
    10171015 
     
    10211019} 
    10221020#moremeta fieldset div { 
    1023         margin: 2px 0 0 0px
     1021        margin: 2px 0 0 0
    10241022        padding: 7px; 
    10251023} 
     
    10841082} 
    10851083 
    1086 #your-profile fieldset input
     1084#your-profile fieldset input
    10871085        width: 100%; 
    10881086        font-size: 20px; 
     
    11231121/* handles */ 
    11241122 
    1125 .dbx-handle
     1123.dbx-handle
    11261124        background: #2685af; 
    11271125        padding: 6px 1em 2px; 
     
    11581156        margin-left: 8px; 
    11591157        background: url(images/box-bg-right.gif) repeat-y right; 
    1160         padding: 10px 10px 15px 0px
     1158        padding: 10px 10px 15px 0
    11611159} 
    11621160 
     
    11911189} 
    11921190 
    1193  
    11941191/* handle cursors */ 
    11951192.dbx-handle-cursor { 
     
    11991196/* toggle images */ 
    12001197a.dbx-toggle, a.dbx-toggle:visited { 
    1201         display:block; 
     1198        display: block; 
    12021199        overflow: hidden; 
    12031200        background-image: url( images/toggle.gif ); 
    12041201        position: absolute; 
    1205         top: 0px
    1206         right: 0px
     1202        top: 0
     1203        right: 0
    12071204        background-repeat: no-repeat; 
    1208         border: 0px
    1209         margin: 0px
    1210         padding: 0px
     1205        border: 0
     1206        margin: 0
     1207        padding: 0
    12111208} 
    12121209 
     
    12141211        height: 25px; 
    12151212        width: 27px; 
    1216         background-position: 0 0px
     1213        background-position: 0 0
    12171214} 
    12181215 
     
    12971294 
    12981295#edButtons input, #edButtons input:active { 
    1299         margin: 0px 2px -1px; 
     1296        margin: 0 2px -1px; 
    13001297} 
    13011298 
     
    13061303 
    13071304#edButtons input.edButtonBack, #edButtons input.edButtonBack:active { 
    1308         background: #fff url( images/fade-butt.png ) repeat-x 0px 15px; 
     1305        background: #fff url( images/fade-butt.png ) repeat-x 0 15px; 
    13091306        border-bottom: 1px solid #ccc; 
    13101307} 
  • trunk/wp-includes/category-template.php

    r854 r865  
    8989 
    9090function get_the_category_list($separator = '', $parents='') { 
     91        global $wp_rewrite; 
    9192        $categories = get_the_category(); 
    9293        if (empty($categories)) 
    9394                return apply_filters('the_category', __('Uncategorized'), $separator, $parents); 
     95 
     96        $rel = ( is_object($wp_rewrite) && $wp_rewrite->using_permalinks() ) ? 'rel="category tag"' : 'rel="category"'; 
    9497 
    9598        $thelist = ''; 
     
    102105                                        if ($category->category_parent) 
    103106                                                $thelist .= get_category_parents($category->category_parent, TRUE); 
    104                                         $thelist .= '<a href="' . get_category_link($category->cat_ID) . '" title="' . sprintf(__("View all posts in %s"), $category->cat_name) . '" rel="category tag">'.$category->cat_name.'</a></li>'; 
     107                                        $thelist .= '<a href="' . get_category_link($category->cat_ID) . '" title="' . sprintf(__("View all posts in %s"), $category->cat_name) . '" ' . $rel . '>' . $category->cat_name.'</a></li>'; 
    105108                                        break; 
    106109                                case 'single': 
    107                                         $thelist .= '<a href="' . get_category_link($category->cat_ID) . '" title="' . sprintf(__("View all posts in %s"), $category->cat_name) . ' rel="category tag">'; 
     110                                        $thelist .= '<a href="' . get_category_link($category->cat_ID) . '" title="' . sprintf(__("View all posts in %s"), $category->cat_name) . '" ' . $rel . '>'; 
    108111                                        if ($category->category_parent) 
    109112                                                $thelist .= get_category_parents($category->category_parent, FALSE); 
     
    112115                                case '': 
    113116                                default: 
    114                                         $thelist .= '<a href="' . get_category_link($category->cat_ID) . '" title="' . sprintf(__("View all posts in %s"), $category->cat_name) . '" rel="category tag">'.$category->cat_name.'</a></li>'; 
     117                                        $thelist .= '<a href="' . get_category_link($category->cat_ID) . '" title="' . sprintf(__("View all posts in %s"), $category->cat_name) . '" ' . $rel . '>' . $category->cat_name.'</a></li>'; 
    115118                        } 
    116119                } 
     
    125128                                        if ( $category->category_parent ) 
    126129                                                $thelist .= get_category_parents($category->category_parent, TRUE); 
    127                                         $thelist .= '<a href="' . get_category_link($category->cat_ID) . '" title="' . sprintf(__("View all posts in %s"), $category->cat_name) . '" rel="category tag">'.$category->cat_name.'</a>'; 
     130                                        $thelist .= '<a href="' . get_category_link($category->cat_ID) . '" title="' . sprintf(__("View all posts in %s"), $category->cat_name) . '" ' . $rel . '>' . $category->cat_name.'</a>'; 
    128131                                        break; 
    129132                                case 'single': 
    130                                         $thelist .= '<a href="' . get_category_link($category->cat_ID) . '" title="' . sprintf(__("View all posts in %s"), $category->cat_name) . '" rel="category tag">'; 
     133                                        $thelist .= '<a href="' . get_category_link($category->cat_ID) . '" title="' . sprintf(__("View all posts in %s"), $category->cat_name) . '" ' . $rel . '>'; 
    131134                                        if ( $category->category_parent ) 
    132135                                                $thelist .= get_category_parents($category->category_parent, FALSE); 
     
    135138                                case '': 
    136139                                default: 
    137                                         $thelist .= '<a href="' . get_category_link($category->cat_ID) . '" title="' . sprintf(__("View all posts in %s"), $category->cat_name) . '" rel="category tag">'.$category->cat_name.'</a>'; 
     140                                        $thelist .= '<a href="' . get_category_link($category->cat_ID) . '" title="' . sprintf(__("View all posts in %s"), $category->cat_name) . '" ' . $rel . '>' . $category->cat_name.'</a>'; 
    138141                        } 
    139142                        ++$i; 
  • trunk/wp-includes/deprecated.php

    r849 r865  
    22 
    33/* 
    4  * Deprecated global variables. 
     4 * Deprecated global variables. 
    55 */ 
    6   
     6 
    77$tableposts = $wpdb->posts; 
    88$tableusers = $wpdb->users; 
     
    1616 
    1717/* 
    18  * Deprecated functios come here to die. 
     18 * Deprecated functions come here to die. 
    1919 */ 
    2020 
    21 // Deprecated.  Use get_post(). 
     21// Use get_post(). 
    2222function get_postdata($postid) { 
    2323        $post = &get_post($postid); 
     
    4444} 
    4545 
    46 // Deprecated.  Use the new post loop. 
     46// Use the new post loop. 
    4747function start_wp() { 
    4848        global $wp_query, $post; 
     
    5454} 
    5555 
    56 // Deprecated. 
    5756function the_category_ID($echo = true) { 
    5857        // Grab the first cat in the list. 
     
    6665} 
    6766 
    68 // Deprecated. 
    6967function the_category_head($before='', $after='') { 
    7068        global $currentcat, $previouscat; 
     
    8078} 
    8179 
    82 // Deprecated. Use previous_post_link(). 
     80// Use previous_post_link(). 
    8381function previous_post($format='%', $previous='previous post: ', $title='yes', $in_same_cat='no', $limitprev=1, $excluded_categories='') { 
    8482 
     
    10199} 
    102100 
    103 // Deprecated. Use next_post_link(). 
     101// Use next_post_link(). 
    104102function next_post($format='%', $next='next post: ', $title='yes', $in_same_cat='no', $limitnext=1, $excluded_categories='') { 
    105103 
     
    123121 
    124122// 
    125 // These are deprecated.  Use current_user_can()
     123// Use current_user_can() for these
    126124// 
    127125 
     
    245243        $args = add_query_arg('category', $cat_id, $args); 
    246244        wp_get_links($args); 
    247 } // end wp_get_linksbyname 
     245} 
    248246 
    249247/** function get_linkobjectsbyname() 
     
    422420} 
    423421 
     422// Use wp_list_cats(). 
    424423function list_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_order = 'asc', $file = '', $list = true, $optiondates = 0, $optioncount = 0, $hide_empty = 1, $use_desc_for_title = 1, $children=FALSE, $child_of=0, $categories=0, $recurse=0, $feed = '', $feed_image = '', $exclude = '', $hierarchical=FALSE) { 
    425424        $query = compact('optionall', 'all', 'sort_column', 'sort_order', 'file', 'list', 'optiondates', 'optioncount', 'hide_empty', 'use_desc_for_title', 'children', 
     
    470469} 
    471470 
    472 // Deprecated.  Use wp_print_scripts() or WP_Scripts instead
     471// Use wp_print_scripts() or WP_Scripts
    473472function tinymce_include() { 
    474         wp_print_script( 'wp_tiny_mce' ); 
     473        wp_print_script('wp_tiny_mce'); 
    475474} 
    476475 
     
    488487} 
    489488 
     489// Use wp_get_archives(). 
    490490function get_archives($type='', $limit='', $format='html', $before = '', $after = '', $show_post_count = false) { 
    491491        $args = compact('type', 'limit', 'format', 'before', 'after', 'show_post_count'); 
     
    493493} 
    494494 
    495 // Deprecated. Use get_author_posts_url(). 
     495// Use get_author_posts_url(). 
    496496function get_author_link($echo = false, $author_id, $author_nicename = '') { 
    497497        $link = get_author_posts_url($author_id, $author_nicename); 
     
    502502} 
    503503 
     504// Use wp_link_pages(). 
    504505function link_pages($before='<br />', $after='<br />', $next_or_number='number', $nextpagelink='next page', $previouspagelink='previous page', $pagelink='%', $more_file='') { 
    505506        $args = compact('before', 'after', 'next_or_number', 'nextpagelink', 'previouspagelink', 'pagelink', 'more_file'); 
     
    507508} 
    508509 
     510// Use get_option(). 
    509511function get_settings($option) { 
    510512        return get_option($option); 
  • trunk/wp-includes/version.php

    r854 r865  
    33// This holds the version number in a separate file so we can bump it without cluttering the SVN 
    44 
    5 $wp_version = 'wordpress-mu-1.0'; // Let's just avoid confusion 
     5$wp_version = 'wordpress-mu-1.2'; // Let's just avoid confusion 
    66$wp_db_version = 4772; 
    77 
  • trunk/xmlrpc.php

    r839 r865  
    6868        function wp_xmlrpc_server() { 
    6969                $this->methods = array( 
     70                        // WordPress API 
     71                        'wp.getPage'                    => 'this:wp_getPage', 
     72                        'wp.getPages'                   => 'this:wp_getPages', 
     73                        'wp.newPage'                    => 'this:wp_newPage', 
     74                        'wp.deletePage'                 => 'this:wp_deletePage', 
     75                        'wp.editPage'                   => 'this:wp_editPage', 
     76                        'wp.getPageList'                => 'this:wp_getPageList', 
     77                        'wp.getAuthors'                 => 'this:wp_getAuthors', 
     78                        'wp.getCategories'              => 'this:mw_getCategories',             // Alias 
     79                        'wp.newCategory'                => 'this:wp_newCategory', 
     80                        'wp.suggestCategories'  => 'this:wp_suggestCategories', 
     81 
    7082                        // Blogger API 
    7183                        'blogger.getUsersBlogs' => 'this:blogger_getUsersBlogs', 
     
    147159        } 
    148160 
     161        /** 
     162         * WordPress XML-RPC API 
     163         * wp_getPage 
     164         */ 
     165        function wp_getPage($args) { 
     166                $this->escape($args); 
     167 
     168                $blog_id        = $args[0]; 
     169                $page_id        = $args[1]; 
     170                $username       = $args[2]; 
     171                $password       = $args[3]; 
     172 
     173                if(!$this->login_pass_ok($username, $password)) { 
     174                        return($this->error); 
     175                } 
     176 
     177                // Lookup page info. 
     178                $page = get_page($page_id); 
     179 
     180                // If we found the page then format the data. 
     181                if($page->ID && ($page->post_type == "page")) { 
     182                        // Get all of the page content and link. 
     183                        $full_page = get_extended($page->post_content); 
     184                        $link = post_permalink($page->ID); 
     185 
     186                        // Determine comment and ping settings. 
     187                        $allow_comments = ("open" == $page->comment_status) ? 1 : 0; 
     188                        $allow_pings = ("open" == $page->ping_status) ? 1 : 0; 
     189 
     190                        // Format page date. 
     191                        $page_date = mysql2date("Ymd\TH:i:s", $page->post_date); 
     192 
     193                        // Pull the categories info together. 
     194                        $categories = array(); 
     195                        foreach(wp_get_post_categories($page->ID) as $cat_id) { 
     196                                $categories[] = get_cat_name($cat_id); 
     197                        } 
     198 
     199                        // Get the users nicename. 
     200                        $nicename = get_profile("user_nicename", $username); 
     201 
     202                        $page_struct = array( 
     203                                "dateCreated"           => new IXR_Date($page_date), 
     204                                "userid"                        => $page->post_author, 
     205                                "page_id"                       => $page->ID, 
     206                                "description"           => $full_page["main"], 
     207                                "title"                         => $page->post_title, 
     208                                "link"                          => $link, 
     209                                "permaLink"                     => $link, 
     210                                "categories"            => $categories, 
     211                                "excerpt"                       => $page->post_excerpt, 
     212                                "text_more"                     => $full_page["extended"], 
     213                                "mt_allow_comments"     => $allow_comments, 
     214                                "mt_allow_pings"        => $allow_pings, 
     215                                "wp_slug"                       => $page->post_name, 
     216                                "wp_password"           => $page->post_password, 
     217                                "wp_author"                     => $nicename, 
     218                                "wp_page_parent_id"     => $page->post_parent, 
     219                                "wp_page_order"         => $page->menu_order 
     220                        ); 
     221 
     222                        return($page_struct); 
     223                } 
     224                // If the page doesn't exist indicate that. 
     225                else { 
     226                        return(new IXR_Error(404, "Sorry, no such page.")); 
     227                } 
     228        } 
     229 
     230        /** 
     231         * WordPress XML-RPC API 
     232         * wp_getPages 
     233         */ 
     234        function wp_getPages($args) { 
     235                $this->escape($args); 
     236 
     237                $blog_id        = $args[0]; 
     238                $username       = $args[1]; 
     239                $password       = $args[2]; 
     240 
     241                if(!$this->login_pass_ok($username, $password)) { 
     242                        return($this->error); 
     243                } 
     244 
     245                // Lookup info on pages. 
     246                $pages = array(); 
     247                $pages = get_pages(); 
     248                $num_pages = count($pages); 
     249 
     250                // If we have pages, put together their info. 
     251                if($num_pages >= 1) { 
     252                        $pages_struct = array(); 
     253 
     254                        for($i = 0; $i < $num_pages; $i++) { 
     255                                $page = wp_xmlrpc_server::wp_getPage(array( 
     256                                        $blog_id, $pages[$i]->ID, $username, $password 
     257                                )); 
     258                                $pages_struct[] = $page; 
     259                        } 
     260 
     261                        return($pages_struct); 
     262                } 
     263                // If no pages were found return an error. 
     264                else { 
     265                        return(new IXR_Error(404, "Sorry, no pages were found.")); 
     266                } 
     267        } 
     268 
     269        /** 
     270         * WordPress XML-RPC API 
     271         * wp_newPage 
     272         */ 
     273        function wp_newPage($args) { 
     274                $this->escape($args); 
     275 
     276                $blog_id        = $args[0]; 
     277                $username       = $args[1]; 
     278                $password       = $args[2]; 
     279                $page           = $args[3]; 
     280                $publish        = $args[4]; 
     281 
     282                if(!$this->login_pass_ok($username, $password)) { 
     283                        return($this->error); 
     284                } 
     285 
     286                // Set the user context and check if they are allowed 
     287                // to add new pages. 
     288                $user = set_current_user(0, $username); 
     289                if(!current_user_can("publish_pages")) { 
     290                        return(new IXR_Error(401, "Sorry, you can not add new pages.")); 
     291                } 
     292 
     293                // Mark this as content for a page. 
     294                $args[3]["post_type"] = "page"; 
     295 
     296                // Let mw_newPost do all of the heavy lifting. 
     297                return($this->mw_newPost($args)); 
     298        } 
     299 
     300        /** 
     301         * WordPress XML-RPC API 
     302         * wp_deletePage 
     303         */ 
     304        function wp_deletePage($args) { 
     305                $this->escape($args); 
     306 
     307                $blog_id        = $args[0]; 
     308                $username       = $args[1]; 
     309                $password       = $args[2]; 
     310                $page_id        = $args[3]; 
     311 
     312                if(!$this->login_pass_ok($username, $password)) { 
     313                        return($this->error); 
     314                } 
     315 
     316                // Get the current page based on the page_id and 
     317                // make sure it is a page and not a post. 
     318                $actual_page = wp_get_single_post($page_id, ARRAY_A); 
     319                if( 
     320                        !$actual_page 
     321                        || ($actual_page["post_type"] != "page") 
     322                ) { 
     323                        return(new IXR_Error(404, "Sorry, no such page.")); 
     324                } 
     325 
     326                // Set the user context and make sure they can delete pages. 
     327                set_current_user(0, $username); 
     328                if(!current_user_can("delete_page", $page_id)) { 
     329                        return(new IXR_Error(401, "Sorry, you do not have the right to delete this page.")); 
     330                } 
     331 
     332                // Attempt to delete the page. 
     333                $result = wp_delete_post($page_id); 
     334                if(!$result) { 
     335                        return(new IXR_Error(500, "Failed to delete the page.")); 
     336                } 
     337 
     338                return(true); 
     339        } 
     340 
     341        /** 
     342         * WordPress XML-RPC API 
     343         * wp_editPage 
     344         */ 
     345        function wp_editPage($args) { 
     346                $this->escape($args); 
     347 
     348                $blog_id        = $args[0]; 
     349                $page_id        = $args[1]; 
     350                $username       = $args[2]; 
     351                $password       = $args[3]; 
     352                $content        = $args[4]; 
     353                $publish        = $args[5]; 
     354 
     355                if(!$this->login_pass_ok($username, $password)) { 
     356                        return($this->error); 
     357                } 
     358 
     359                // Get the page data and make sure it is a page. 
     360                $actual_page = wp_get_single_post($page_id, ARRAY_A); 
     361                if( 
     362                        !$actual_page 
     363                        || ($actual_page["post_type"] != "page") 
     364                ) { 
     365                        return(new IXR_Error(404, "Sorry, no such page.")); 
     366                } 
     367 
     368                // Set the user context and make sure they are allowed to edit pages. 
     369                set_current_user(0, $username); 
     370                if(!current_user_can("edit_page", $page_id)) { 
     371                        return(new IXR_Error(401, "Sorry, you do not have the right to edit this page.")); 
     372                } 
     373 
     374                // Mark this as content for a page. 
     375                $content["post_type"] = "page"; 
     376 
     377                // Arrange args in the way mw_editPost understands. 
     378                $args = array( 
     379                        $page_id, 
     380                        $username, 
     381                        $password, 
     382                        $content, 
     383                        $publish 
     384                ); 
     385 
     386                // Let mw_editPost do all of the heavy lifting. 
     387                return($this->mw_editPost($args)); 
     388        } 
     389 
     390        /** 
     391         * WordPress XML-RPC API 
     392         * wp_getPageList 
     393         */ 
     394        function wp_getPageList($args) { 
     395                global $wpdb; 
     396 
     397                $this->escape($args); 
     398 
     399                $blog_id                                = $args[0]; 
     400                $username                               = $args[1]; 
     401                $password                               = $args[2]; 
     402 
     403                if(!$this->login_pass_ok($username, $password)) { 
     404                        return($this->error); 
     405                } 
     406 
     407                // Get list of pages ids and titles 
     408                $page_list = $wpdb->get_results(" 
     409                        SELECT ID page_id, 
     410                                post_title page_title 
     411                        FROM {$wpdb->posts} 
     412                        WHERE post_type = 'page' 
     413                        ORDER BY ID 
     414                "); 
     415 
     416                return($page_list); 
     417        } 
     418 
     419        /** 
     420         * WordPress XML-RPC API 
     421         * wp_getAuthors 
     422         */ 
     423        function wp_getAuthors($args) { 
     424                global $wpdb; 
     425 
     426                $this->escape($args); 
     427 
     428                $blog_id        = $args[0]; 
     429                $username       = $args[1]; 
     430                $password       = $args[2]; 
     431 
     432                if(!$this->login_pass_ok($username, $password)) { 
     433                        return($this->error); 
     434                } 
     435 
     436                // Get basic info on all users. 
     437                $all_users = $wpdb->get_results(" 
     438                        SELECT u.ID id, 
     439                                u.user_login username 
     440                        FROM {$wpdb->users} u 
     441                        ORDER BY u.user_login 
     442                "); 
     443 
     444                return($all_users); 
     445        } 
     446 
     447        /** 
     448         * WordPress XML-RPC API 
     449         * wp_newCategory 
     450         */ 
     451        function wp_newCategory($args) { 
     452                $this->escape($args); 
     453 
     454                $blog_id                                = $args[0]; 
     455                $username                               = $args[1]; 
     456                $password                               = $args[2]; 
     457                $category                               = $args[3]; 
     458 
     459                if(!$this->login_pass_ok($username, $password)) { 
     460                        return($this->error); 
     461                } 
     462 
     463                // Set the user context and make sure they are 
     464                // allowed to add a category. 
     465                set_current_user(0, $username); 
     466                if(!current_user_can("manage_categories", $page_id)) { 
     467                        return(new IXR_Error(401, "Sorry, you do not have the right to add a category.")); 
     468                } 
     469 
     470                // We need this to make use of the wp_insert_category() 
     471                // funciton. 
     472                require_once(ABSPATH . "wp-admin/admin-db.php"); 
     473 
     474                // If no slug was provided make it empty so that 
     475                // WordPress will generate one. 
     476                if(empty($category["slug"])) { 
     477                        $category["slug"] = ""; 
     478                } 
     479 
     480                // If no parent_id was provided make it empty 
     481                // so that it will be a top level page (no parent). 
     482                if(empty($category["parent_id"])) { 
     483                        $category["parent_id"] = ""; 
     484                } 
     485 
     486                // If no description was provided make it empty. 
     487                if(empty($category["description"])) { 
     488                        $category["description"] = ""; 
     489                } 
     490                 
     491                $new_category = array( 
     492                        "cat_name"                              => $category["name"], 
     493                        "category_nicename"             => $category["slug"], 
     494                        "category_parent"               => $category["parent_id"], 
     495                        "category_description"  => $category["description"] 
     496                ); 
     497 
     498                $cat_id = wp_insert_category($new_category); 
     499                if(!$cat_id) { 
     500                        return(new IXR_Error(500, "Sorry, the new category failed.")); 
     501                } 
     502 
     503                return($cat_id); 
     504        } 
     505 
     506        /** 
     507         * WordPress XML-RPC API 
     508         * wp_suggestCategories 
     509         */ 
     510        function wp_suggestCategories($args) { 
     511                global $wpdb; 
     512 
     513