@@ 473-479 (lines=7) @@ | ||
470 | else |
|
471 | $cap = 'edit_pages'; |
|
472 | $error_message = __( 'Sorry, you are not allowed to publish pages on this site.' ); |
|
473 | } elseif ( $content_struct['post_type'] == 'post' ) { |
|
474 | if ( $publish || 'publish' == $content_struct['post_status'] ) |
|
475 | $cap = 'publish_posts'; |
|
476 | else |
|
477 | $cap = 'edit_posts'; |
|
478 | $error_message = __( 'Sorry, you are not allowed to publish posts on this site.' ); |
|
479 | } else { |
|
480 | $error_message = __( 'Invalid post type.' ); |
|
481 | } |
|
482 | } else { |
|
@@ 482-488 (lines=7) @@ | ||
479 | } else { |
|
480 | $error_message = __( 'Invalid post type.' ); |
|
481 | } |
|
482 | } else { |
|
483 | if ( $publish || 'publish' == $content_struct['post_status'] ) |
|
484 | $cap = 'publish_posts'; |
|
485 | else |
|
486 | $cap = 'edit_posts'; |
|
487 | $error_message = __( 'Sorry, you are not allowed to publish posts on this site.' ); |
|
488 | } |
|
489 | if ( current_user_can( $cap ) ) |
|
490 | return true; |
|
491 | break; |