Created
January 15, 2009 23:41
-
-
Save kastner/47701 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require( './wp-load.php' ); | |
$episode = intval($_REQUEST["episode"]); | |
$post_id = $wpdb->get_var($wpdb->prepare("select post_id from wp_postmeta | |
where meta_key = 'episode' and meta_value=%d", $episode)); | |
if ( $permalink =& get_permalink( $post_id ) ) { | |
Header("Location: $permalink"); | |
} | |
else { | |
echo "Can't find that post"; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment