Code Updates
-
Hello,
There were just a few ticks that were bugging me about this plugin, so I went in and got the functionality to perform like I wanted.When on the list of sites location, there is the hyperlink Copy. Whenever I clicked on it, it didn’t update the dropdown menu with the site I wanted to copy, but would leave it as the top most domain.
I updated the code in blog-copier.php on line 102
$from_blog_id = ( isset( $_POST['source_blog'] ) ) ? (int) $_POST['source_blog'] : -1;
to be as follows:if ( isset( $_POST['source_blog'] ) ) { $from_blog_id = (int) $_POST['source_blog']; } elseif ( isset( $_GET['blog'] ) ) { $from_blog_id = (int) $_GET['blog']; } else { $from_blog_id = -1; }
That solved that quirk.
The other issue I had is when I would copy the site, and click on the hyperlink of the site that was generated, it would take me to the parent based blog, which I didn’t like.
I updated line 252 from:
$msg = sprintf(__( 'Copied: %s in %s seconds', $this->_domain ),'<a href="https://'.$newdomain.'" target="_blank">'.$title.'</a>', number_format_i18n(timer_stop()));
to be:
$msg = sprintf(__( 'Copied: %s in %s seconds', $this->_domain ),'<a href="https://'.$newdomain.$path.'" target="_blank">'.$title.'</a>', number_format_i18n(timer_stop()));
Which took care of that issue. Hopefully this will help someone else fix that problem if they are annoyed by it.
Have a great day!
Seth
- The topic ‘Code Updates’ is closed to new replies.