Plugin Directory

Changeset 1763939


Ignore:
Timestamp:
11/11/2017 06:49:54 PM (8 years ago)
Author:
MagicStick
Message:

small bug fixes releating to publish date and permlink structure

Location:
multisite-post-duplicator
Files:
45 added
5 edited

Legend:

Unmodified
Added
Removed
  • multisite-post-duplicator/trunk/README.md

    r1740522 r1763939  
    8787== Changelog ==
    8888
     89= 1.7.5 =
     90* Permlink stucture now behaves as expected when copying post to the same site
     91* Publish date now persists on linked posts if requested (thanks again Iskren Ivov Chernev)
     92
    8993= 1.7.4 =
    9094* Bug fixes
  • multisite-post-duplicator/trunk/inc/core.php

    r1730972 r1763939  
    6666    }
    6767
     68    //Permalink Setup
     69    $post_name = $mpd_process_info['destination_id'] == $source_blog_id ? null : $mdp_post->post_name;
     70
    6871    //Using the orgininal post object we now want to insert our any new data based on user settings for use
    6972    //in the post object that we will be adding to the destination site
     
    7780            'post_excerpt'  => $mdp_post->post_excerpt,
    7881            'post_content_filtered' => $mdp_post->post_content_filtered,
    79             'post_name' => $mdp_post->post_name
     82            'post_name'     => $post_name
    8083
    8184    ), $mpd_process_info);
     
    228231    //Get the taxonomy terms for the post
    229232    $source_taxonomies = mpd_get_post_taxonomy_terms($persist_post->source_post_id, false, false);
     233
     234    //Permalink Setup
     235    $post_name = $persist_post->destination_id == $source_blog_id ? null : $mdp_post->post_name;
    230236
    231237    //Using the orgininal post object we now want to insert our any new data based on user settings for use
     
    240246            'post_excerpt'  => $mdp_post->post_excerpt,
    241247            'post_content_filtered' => $mdp_post->post_content_filtered,
    242             'post_name' => $mdp_post->post_name,
     248            'post_name' => $post_name,
    243249            'post_status' => $mdp_post->post_status
    244250
  • multisite-post-duplicator/trunk/inc/mpd-functions.php

    r1740522 r1763939  
    13501350
    13511351/**
     1352 *
     1353 * If the user chooses to, this function will copy the publish date to the
     1354 * copied post.
     1355 *
     1356 * @param $mdp_post Array of the destination post info prior to post being created in database
     1357 * @param $persist_post Object of source post being duplicated
     1358 *
     1359 * @return array Modified $mpd_post that would be used for duplicate post creation
     1360 */
     1361function mpd_update_published_date($mpd_post, $persist_post) {
     1362
     1363  $options = get_option( 'mdp_settings' );
     1364
     1365  if(isset($options['mdp_retain_published_date'])){
     1366      $mpd_post['post_date'] = get_post_field('post_date', $persist_post->source_post_id);
     1367  }
     1368
     1369  return $mpd_post;
     1370 
     1371}
     1372
     1373add_filter('mpd_setup_persist_destination_data', 'mpd_update_published_date', 10, 2);
     1374
     1375
     1376/**
    13521377 *
    13531378 * Do the markup for a link to MDP setting page
     
    17721797   
    17731798}
     1799
  • multisite-post-duplicator/trunk/mpd.php

    r1740522 r1763939  
    55Plugin URI:     http://www.wpmaz.uk
    66Description:    Duplicate/Copy/Clone any individual page, post or custom post type from one site on your multisite network to another.
    7 Version:        1.7.4
     7Version:        1.7.5
    88Author:         Mario Jaconelli
    99Author URI:     http://www.wpmaz.uk
  • multisite-post-duplicator/trunk/readme.txt

    r1740522 r1763939  
    8787== Changelog ==
    8888
     89= 1.7.5 =
     90* Permlink stucture now behaves as expected when copying post to the same site
     91* Publish date now persists on linked posts if requested (thanks again Iskren Ivov Chernev)
     92
    8993= 1.7.4 =
    9094* Bug fixes
Note: See TracChangeset for help on using the changeset viewer.