id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc,focuses 21033,Add filter hook for internal linking of custom post type in wordpress editor,caseydipesh,Dipesh KC,"Currently wordpress displays all public post types at the time of selecting internal links through insert/edit link button in the wordpress tinymce editor. By providing a filter for the custom post types can be a good feature for a good CMS. In file wp-includes/class-wp-editor-php line no 711 {{{ public static function wp_link_query( $args = array() ) { $pts = get_post_types( array( 'public' => true ), 'objects' ); $pt_names = array_keys( $pts ); $query = array( 'post_type' => $pt_names, 'suppress_filters' => true, 'update_post_term_cache' => false, 'update_post_meta_cache' => false, 'post_status' => 'publish', 'order' => 'DESC', 'orderby' => 'post_date', 'posts_per_page' => 20, ); }}} eg solution {{{ $pts = get_post_types( array( 'public' => true ), 'objects' ); $pt_names = apply_filters('custom_insert_link_suggestion_filter',array_keys( $pts )); $query = array(... }}} we can add some sort of filter say wp_custom_post_type_link_suggest_filter so that we can allow only certain post types. Eventually in our theme function function my_filter_function($allowed_post_types) { if( ) { return array('page',''); } } add_filter('custom_insert_link_suggestion_filter','my_filter_function',10,1);",enhancement,closed,normal,,Editor,3.4,normal,duplicate,,,