/* Plugin Name: CP Redirect Plugin URI: http://www.copress.org/wiki/CP_Redirect_plugin Description: Redirects old College Publisher URLs to the new ones in WordPress, based on the article ID stored in the custom field. Version: 0.1.1 Author: Daniel Bachhuber Author URI: http://www.danielbachhuber.com/ */ /** * * Warning: version 0.1.1 is a beta release and has only been tested on a few production sites * **/ function cp_redirect_options () { $message = null; $message_updated = __("Your settings have been updated.", 'cp-redirect'); // Get the past settings if appropriate $cp_redirect = $newoptions = get_option('cp_redirect_settings'); if ($_POST['cp_redirect-submit']) { $message = $message_updated; $newoptions['status'] = (bool)$_POST['cp_redirect-status']; $newoptions['system'] = $_POST['cp_redirect-previous_system']; $newoptions['custom_field'] = stripslashes(strip_tags($_POST['cp_redirect-custom_field'])); $newoptions['id_match'] = (bool)$_POST['cp_redirect-id_match']; } if ($newoptions != $cp_redirect) { $cp_redirect = $newoptions; update_option('cp_redirect_settings', $cp_redirect); } ?>
Redirect your old College Publisher URLs to your new WordPress URLs by configuring this plugin. The previous article ID will need to be stored in either a custom field or match the WordPress post ID.