Support » Plugin: Duplicate Post » Permalink numbering

  • Hello,

    I have a question about something that I think other happy users of Duplicate Post may have as well and there may be a solution – but I cannot find it.

    On this website a new post ‘Star Magazine Online’ is created once (sometimes twice) per week, by duplicating the previous post and editing the content. Every time the permalink is extended with “-2” unless, of course, you change the permalink manually.

    It would be really nice if, instead of
    star-magazine-online-234-2-2-2-2-2-2-2-2-2
    star-magazine-online-234-2-2-2-2-2-2-2-2-2-2
    star-magazine-online-234-2-2-2-2-2-2-2-2-2-2-2
    star-magazine-online-234-2-2-2-2-2-2-2-2-2-2-2-2

    (all automatically) I could get
    star-magazine-online-235 (changed manually, ok)
    star-magazine-online-236 (automatically)
    star-magazine-online-237
    star-magazine-online-238

    Is that possible?

    Thank you in advance for your help!

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Maybe is a wrong aproximation, but since slug is automatically generated by WordPress and this plugin is only copying the slug from original post and letting wp do the job, I cleanup the slug to the first so wp assigns correctly the new number.

    duplicate-post-admin.php:601

    
    	$post_name = $post->post_name;
    	if(get_option('duplicate_post_copyslug') != 1){
    		$post_name = '';
    	} else {
    		$result = preg_match( "/(.*)-\d*$/", $post_name, $matches);
    		if($result){
    			$post_name = $matches[1];
    		}
    	}
    

    Side effects: posts with a number at the end are cleaned up as well…

    • This reply was modified 6 months, 2 weeks ago by  yondemon.
    • This reply was modified 6 months, 2 weeks ago by  yondemon.
Viewing 1 replies (of 1 total)
  • The topic ‘Permalink numbering’ is closed to new replies.