Changeset 931

Show
Ignore:
Timestamp:
03/22/07 13:20:00 (2 years ago)
Author:
donncha
Message:

WP Merge to rev 5081

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-includes/l10n.php

    r852 r931  
    3636        else 
    3737                echo $text; 
     38} 
     39 
     40function _c($text, $domain = 'default') { 
     41        global $l10n; 
     42 
     43        if ( isset($l10n[$domain]) ) 
     44                $whole = apply_filters('gettext', $l10n[$domain]->translate($text), $text); 
     45        else 
     46                $whole = $text; 
     47 
     48        $trans = explode('|', $whole, 2);  
     49        if ( isset( $trans[1] ) ) 
     50                return $trans[1]; 
     51        else 
     52                return $trans[0];        
    3853} 
    3954 
  • trunk/wp-includes/link-template.php

    r920 r931  
    118118        global $post; 
    119119 
     120        $id = (int) $id; 
    120121        if ( !$id ) 
    121122                $id = $post->ID; 
  • trunk/xmlrpc.php

    r920 r931  
    857857          extract($actual_post); 
    858858 
     859          if ( ('publish' == $post_status) && !current_user_can('publish_posts') ) 
     860                return new IXR_Error(401, 'Sorry, you do not have the right to publish this post.'); 
     861 
    859862          $post_title = xmlrpc_getposttitle($content); 
    860863          $post_category = xmlrpc_getpostcategory($content); 
     
    10831086 
    10841087          set_current_user(0, $user_login); 
    1085           if ( !current_user_can('edit_post', $post_ID) ) 
    1086             return new IXR_Error(401, 'Sorry, you can not edit this post.'); 
    1087  
    1088           $postdata = wp_get_single_post($post_ID, ARRAY_A); 
    1089           extract($postdata); 
    1090                 $this->escape($postdata); 
    10911088 
    10921089                // The post_type defaults to post, but could also be page. 
     
    10981095                        $post_type = "page"; 
    10991096                } 
     1097 
     1098          // Edit page caps are checked in editPage.  Just check post here. 
     1099          if ( ( 'post' == $post_type ) && !current_user_can('edit_post', $post_ID) ) 
     1100            return new IXR_Error(401, 'Sorry, you can not edit this post.'); 
     1101 
     1102          $postdata = wp_get_single_post($post_ID, ARRAY_A); 
     1103          extract($postdata); 
     1104                $this->escape($postdata); 
    11001105 
    11011106                // Let WordPress manage slug if none was provided. 
     
    11691174          $post_more = $content_struct['mt_text_more']; 
    11701175          $post_status = $publish ? 'publish' : 'draft'; 
     1176 
     1177          if ( ('publish' == $post_status) ) { 
     1178                if ( ( 'page' == $post_type ) && !current_user_can('publish_pages') ) 
     1179                        return new IXR_Error(401, 'Sorry, you do not have the right to publish this page.'); 
     1180                else if ( !current_user_can('publish_posts') ) 
     1181                        return new IXR_Error(401, 'Sorry, you do not have the right to publish this post.'); 
     1182          } 
    11711183 
    11721184          if ($post_more) {