Ticket #2613: private.diff
| File private.diff, 3.8 KB (added by ryan, 6 years ago) |
|---|
-
wp-includes/query.php
828 828 } else { 829 829 $where .= " AND (post_type = '$post_type' AND (post_status = 'publish'"; 830 830 831 if ( is_admin() ) 831 if ( is_admin() ) { 832 832 $where .= " OR post_status = 'future' OR post_status = 'draft'"; 833 833 834 if ( is_user_logged_in() ) 835 $where .= " OR post_author = $user_ID AND post_status = 'private'))"; 836 else 837 $where .= '))'; 834 if ( is_user_logged_in() ) { 835 if ( 'post' == $post_type ) 836 $cap = 'edit_private_posts'; 837 else 838 $cap = 'edit_private_pages'; 839 840 if ( current_user_can($cap) ) 841 $where .= "OR post_status = 'private'"; 842 else 843 $where .= " OR post_author = $user_ID AND post_status = 'private'"; 844 } 845 } 846 847 $where .= '))'; 838 848 } 839 849 840 850 // Apply filters on where and join prior to paging so that any -
wp-includes/version.php
3 3 // This just holds the version number, in a separate file so we can bump it without cluttering the SVN 4 4 5 5 $wp_version = '2.1-alpha1'; 6 $wp_db_version = 3 672;6 $wp_db_version = 3767; 7 7 8 8 ?> 9 No newline at end of file -
wp-includes/capabilities.php
296 296 // The post is published, extra cap required. 297 297 if ($post->post_status == 'publish') 298 298 $caps[] = 'delete_published_posts'; 299 else if ($post->post_status == 'private') 300 $caps[] = 'delete_private_posts'; 299 301 } 300 302 break; 301 303 case 'delete_page': … … 318 320 // The page is published, extra cap required. 319 321 if ($page->post_status == 'publish') 320 322 $caps[] = 'delete_published_pages'; 323 else if ($page->post_status == 'private') 324 $caps[] = 'delete_private_pages'; 321 325 } 322 326 break; 323 327 // edit_post breaks down to edit_posts, edit_published_posts, or … … 346 350 // The post is published, extra cap required. 347 351 if ($post->post_status == 'publish') 348 352 $caps[] = 'edit_published_posts'; 353 else if ($post->post_status == 'private') 354 $caps[] = 'edit_private_posts'; 349 355 } 350 356 break; 351 357 case 'edit_page': … … 368 374 // The page is published, extra cap required. 369 375 if ($page->post_status == 'publish') 370 376 $caps[] = 'edit_published_pages'; 377 else if ($page->post_status == 'private') 378 $caps[] = 'edit_private_pages'; 371 379 } 372 380 break; 373 381 case 'read_post': -
wp-admin/upgrade-functions.php
173 173 if ( $wp_current_db_version < 3308 ) 174 174 upgrade_160(); 175 175 176 if ( $wp_current_db_version < 3 672)176 if ( $wp_current_db_version < 3767 ) 177 177 upgrade_210(); 178 178 179 179 $wp_rewrite->flush_rules(); … … 492 492 } 493 493 } 494 494 495 if ( $wp_current_db_version < 3 513) {495 if ( $wp_current_db_version < 3767 ) { 496 496 populate_roles_210(); 497 497 } 498 498 -
wp-admin/upgrade-schema.php
352 352 $role->add_cap('delete_posts'); 353 353 $role->add_cap('delete_others_posts'); 354 354 $role->add_cap('delete_published_posts'); 355 $role->add_cap('delete_private_posts'); 356 $role->add_cap('edit_private_posts'); 357 $role->add_cap('read_private_posts'); 358 $role->add_cap('delete_private_pages'); 359 $role->add_cap('edit_private_pages'); 360 $role->add_cap('read_private_pages'); 355 361 } 356 362 357 363 $role = get_role('author');
