Created
July 27, 2014 17:48
-
-
Save norcross/345dba60a501628f7451 to your computer and use it in GitHub Desktop.
filter the available post types in the internal linking
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 | |
/** | |
* filter the query args in `wp_link_query` | |
* to only show specific post types | |
* | |
* @param array $query the default args | |
* @return array $query the args with our new post type array | |
*/ | |
function rkv_filter_link_types( $query ) { | |
// set an array of the types I want to include | |
$query['post_type'] = array( 'post', 'page' ); | |
// return query | |
return $query; | |
} | |
add_filter( 'wp_link_query_args', 'rkv_filter_link_types' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment