Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- define( 'WP_USE_THEMES', false );
- require($_SERVER['DOCUMENT_ROOT'] .'/wp-config.php');
- echo $_GET['message'];
- echo ' new data: '. $data = str_replace('"','"',$_GET['message']);
- print_r( ' JSON: '. $newdata = json_decode($data, true));
- echo $newauthor = $newdata['auth'];
- echo $user_id = $newdata['usr'];
- //$key = 'userpost2';
- //if($_POST['muutto']){
- echo $post1 = $newdata['muutto'];
- //$post1 = 1564;
- // }
- // else
- // {
- // $post1 = get_user_meta($user_id,$key,true);
- // }
- echo 'testfun '.$post1.' NEWAUTHORE '.$newauthor;
- $newpidortest = 1488;
- $catg = 25;
- //$user_id = $current_user->ID;
- //$key2 = 'pidortest';
- //echo $pidortest = get_user_meta($user_id,$key2,true);
- //обновляем автора
- kses_remove_filters();
- wp_set_post_categories( $post1, $catg);
- echo ' Category is ok ';
- $args = array(
- 'ID' => $post1,
- 'post_author' => $newauthor,
- );
- $post_id = wp_update_post( $args );
- if (is_wp_error($post_id)) {
- $errors = $post_id->get_error_messages();
- foreach ($errors as $error) {
- echo $error;
- }
- }
- kses_init_filters();
- //update_user_meta($user_id,$key2,$newpidortest,$pidortest);
- //$post_id = $post1;
- require 'https://muutonkilpailutus.fi/wp-content/plugins/newmuutto.php?firma_id='.$newauthor.'&post_id='.$post1.'&posturl='.$current_url;
- ?>
Add Comment
Please, Sign In to add comment