Changeset 34020 for trunk/src/wp-admin/includes/post.php
- Timestamp:
- 09/10/2015 09:30:24 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/post.php
r33970 r34020 1770 1770 } 1771 1771 } 1772 1773 /** 1774 * Redirect to previous page. 1775 * 1776 * @param int $post_id Optional. Post ID. 1777 */ 1778 function redirect_post($post_id = '') { 1779 if ( isset($_POST['save']) || isset($_POST['publish']) ) { 1780 $status = get_post_status( $post_id ); 1781 1782 if ( isset( $_POST['publish'] ) ) { 1783 switch ( $status ) { 1784 case 'pending': 1785 $message = 8; 1786 break; 1787 case 'future': 1788 $message = 9; 1789 break; 1790 default: 1791 $message = 6; 1792 } 1793 } else { 1794 $message = 'draft' == $status ? 10 : 1; 1795 } 1796 1797 $location = add_query_arg( 'message', $message, get_edit_post_link( $post_id, 'url' ) ); 1798 } elseif ( isset($_POST['addmeta']) && $_POST['addmeta'] ) { 1799 $location = add_query_arg( 'message', 2, wp_get_referer() ); 1800 $location = explode('#', $location); 1801 $location = $location[0] . '#postcustom'; 1802 } elseif ( isset($_POST['deletemeta']) && $_POST['deletemeta'] ) { 1803 $location = add_query_arg( 'message', 3, wp_get_referer() ); 1804 $location = explode('#', $location); 1805 $location = $location[0] . '#postcustom'; 1806 } else { 1807 $location = add_query_arg( 'message', 4, get_edit_post_link( $post_id, 'url' ) ); 1808 } 1809 1810 /** 1811 * Filter the post redirect destination URL. 1812 * 1813 * @since 2.9.0 1814 * 1815 * @param string $location The destination URL. 1816 * @param int $post_id The post ID. 1817 */ 1818 wp_redirect( apply_filters( 'redirect_post_location', $location, $post_id ) ); 1819 exit; 1820 }
Note: See TracChangeset
for help on using the changeset viewer.