Changeset 10222 for trunk/wp-admin/admin-ajax.php
- Timestamp:
- 12/18/2008 07:12:26 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-ajax.php
r10204 r10222 45 45 46 46 $s = $_GET['q']; // is this slashed already? 47 48 if ( isset($_GET['tax']) ) 49 $taxonomy = sanitize_title($_GET['tax']); 50 else 51 die('0'); 47 52 48 53 if ( false !== strpos( $s, ',' ) ) { … … 53 58 if ( strlen( $s ) < 2 ) 54 59 die; // require 2 chars for matching 55 $results = $wpdb->get_col( "SELECT t.name FROM $wpdb->term_taxonomy AS tt INNER JOIN $wpdb->terms AS t ON tt.term_id = t.term_id WHERE tt.taxonomy = 'post_tag' AND t.name LIKE ('%". $s . "%')" ); 60 61 $results = $wpdb->get_col( "SELECT t.name FROM $wpdb->term_taxonomy AS tt INNER JOIN $wpdb->terms AS t ON tt.term_id = t.term_id WHERE tt.taxonomy = '$taxonomy' AND t.name LIKE ('%" . $s . "%')" ); 62 56 63 echo join( $results, "\n" ); 57 64 die; … … 491 498 die('-1'); 492 499 493 $tags = get_tags( array( 'number' => 45, 'orderby' => 'count', 'order' => 'DESC' ) ); 500 if ( isset($_POST['tax']) ) 501 $taxonomy = sanitize_title($_POST['tax']); 502 else 503 die('0'); 504 505 $tags = get_terms( $taxonomy, array( 'number' => 45, 'orderby' => 'count', 'order' => 'DESC' ) ); 494 506 495 507 if ( empty( $tags ) ) … … 777 789 778 790 $_POST['post_category'] = explode(",", $_POST['catslist']); 779 $_POST['tags_input'] = explode(",", $_POST['tags_input']);780 791 if($_POST['post_type'] == 'page' || empty($_POST['post_category'])) 781 792 unset($_POST['post_category']);
Note: See TracChangeset
for help on using the changeset viewer.