Third pass on internal linking preloading. Or, what I left out of the second pass commit. see #11420.

git-svn-id: https://develop.svn.wordpress.org/trunk@16459 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin
2010-11-18 07:59:05 +00:00
parent 7554d8610b
commit 7cccd5715f
8 changed files with 164 additions and 18 deletions
+14 -2
View File
@@ -1074,9 +1074,21 @@ case 'menu-quick-search':
exit;
break;
case 'wp-link-ajax':
require_once ABSPATH . WPINC . '/js/tinymce/wp-mce-link.php';
require_once ABSPATH . 'wp-admin/includes/internal-linking.php';
wp_link_ajax( $_POST );
$args = array();
if ( isset( $_POST['title'] ) )
$args['s'] = stripslashes( $_POST['title'] );
$args['pagenum'] = ! empty( $_POST['page'] ) ? absint( $_POST['page'] ) : 1;
$results = wp_link_query( $args );
if ( ! isset( $results ) )
die( '0' );
echo json_encode( $results );
echo "\n";
exit;
break;