redirect_post [ WordPress Function ]
redirect_post ( $post_id = '' )
| Parameters: |
|
| Defined at: |
|
Redirect to previous page.
Source
<?php
function redirect_post($post_id = '') {
if ( isset($_POST['save']) || isset($_POST['publish']) ) {
$status = get_post_status( $post_id );
if ( isset( $_POST['publish'] ) ) {
switch ( $status ) {
case 'pending':
$message = 8;
break;
case 'future':
$message = 9;
break;
default:
$message = 6;
}
} else {
$message = 'draft' == $status ? 10 : 1;
}
$location = add_query_arg( 'message', $message, get_edit_post_link( $post_id, 'url' ) );
} elseif ( isset($_POST['addmeta']) && $_POST['addmeta'] ) {
$location = add_query_arg( 'message', 2, wp_get_referer() );
$location = explode('#', $location);
$location = $location[0] . '#postcustom';
} elseif ( isset($_POST['deletemeta']) && $_POST['deletemeta'] ) {
$location = add_query_arg( 'message', 3, wp_get_referer() );
$location = explode('#', $location);
$location = $location[0] . '#postcustom';
} elseif ( 'post-quickpress-save-cont' == $_POST['action'] ) {
$location = "post.php?action=edit&post=$post_id&message=7";
} else {
$location = add_query_arg( 'message', 4, get_edit_post_link( $post_id, 'url' ) );
}
wp_redirect( apply_filters( 'redirect_post_location', $location, $post_id ) );
exit;
}
?>
Examples [ wp-snippets.com ]
Top Google zoekresultaten
- redirect_post (WordPress Function) - WPSeek.com
WordPress lookup for redirect_post, a WordPress Function. wpseek.com is a WordPress-centric search tool for developers and theme authors.
wpseek.com - Super Search:Results - Documentation - Solspace
redirect_post= redirect_post="no". By default, Super Search will redirect a POST search to contain the search query in the URI on the results page, similar to how ...
www.solspace.com - "Redirect POST Values" doesn't send any values ... | drupal.org
The "Redirect POST Values" checkbox is set. When I submit the webform, it does indeed forward to the servlet. The post data in the http request, ...
drupal.org - PHP Redirect with POST data - Stack Overflow
Redirect/POST Form Data to Site After Inputs are Validated in PHP · PHP : Post > Diaplay > Wait > Redirect · PHP header() redirect with POST ...
stackoverflow.com