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
/** | |
* Remove the slug from published post permalinks. Only affect our CPT though. | |
*/ | |
function wpex_remove_post_type_slug( $post_link, $post, $leavename ) { | |
if ( ! in_array( $post->post_type, array( 'YOUR_POST_TYPE' ) ) || 'publish' != $post->post_status ) | |
return $post_link; | |
$post_link = str_replace( '/' . $post->post_type . '/', '/', $post_link ); | |
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
// create fake page called "chat-room" | |
// modify function and variable names with "ABCD" to whatever you like | |
// modify variable $fakepage_ABCD_url to the fake URL you require | |
add_filter('the_posts','fakepage_ABCD_detect',-10); | |
function fakepage_ABCD_detect($posts){ | |
global $wp; | |
global $wp_query; | |
global $fakepage_ABCD_detect; // used to stop double loading |
NewerOlder