Don't assign default to pass-by-ref var. Not compatible with all PHP versions. see #6815
git-svn-id: http://svn.automattic.com/wordpress/trunk@8861 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
b8ed2c0bec
commit
6044ee63fa
|
@ -12,7 +12,7 @@
|
||||||
* @param post_data array Array of post data. Defaults to the contents of $_POST
|
* @param post_data array Array of post data. Defaults to the contents of $_POST
|
||||||
* @return object|bool WP_Error on failure, true on success.
|
* @return object|bool WP_Error on failure, true on success.
|
||||||
*/
|
*/
|
||||||
function _wp_translate_postdata( $update = false, &$post_data = null ) {
|
function _wp_translate_postdata( $update = false, $post_data = null ) {
|
||||||
|
|
||||||
if ( empty($post_data) )
|
if ( empty($post_data) )
|
||||||
$post_data = &$_POST;
|
$post_data = &$_POST;
|
||||||
|
@ -110,7 +110,7 @@ function _wp_translate_postdata( $update = false, &$post_data = null ) {
|
||||||
$post_data['post_date_gmt'] = get_gmt_from_date( $post_data['post_date'] );
|
$post_data['post_date_gmt'] = get_gmt_from_date( $post_data['post_date'] );
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return $post_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -140,9 +140,9 @@ function edit_post( $post_data = null ) {
|
||||||
return $post_ID;
|
return $post_ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
$translated = _wp_translate_postdata( true, $post_data );
|
$post_data = _wp_translate_postdata( true, $post_data );
|
||||||
if ( is_wp_error($translated) )
|
if ( is_wp_error($post_data) )
|
||||||
wp_die( $translated->get_error_message() );
|
wp_die( $post_data->get_error_message() );
|
||||||
|
|
||||||
// Meta Stuff
|
// Meta Stuff
|
||||||
if ( isset($post_data['meta']) && $post_data['meta'] ) {
|
if ( isset($post_data['meta']) && $post_data['meta'] ) {
|
||||||
|
|
Loading…
Reference in New Issue