Use array calling style. Props Denis-de-Bernardy. see #6647
git-svn-id: http://svn.automattic.com/wordpress/trunk@12515 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -33,7 +33,7 @@ function get_bookmark($bookmark, $output = OBJECT, $filter = 'raw') {
|
||||
$_bookmark = & $GLOBALS['link'];
|
||||
} elseif ( ! $_bookmark = wp_cache_get($bookmark, 'bookmark') ) {
|
||||
$_bookmark = $wpdb->get_row($wpdb->prepare("SELECT * FROM $wpdb->links WHERE link_id = %d LIMIT 1", $bookmark));
|
||||
$_bookmark->link_category = array_unique( wp_get_object_terms($_bookmark->link_id, 'link_category', 'fields=ids') );
|
||||
$_bookmark->link_category = array_unique( wp_get_object_terms($_bookmark->link_id, 'link_category', array('fields' => 'ids')) );
|
||||
wp_cache_add($_bookmark->link_id, $_bookmark, 'bookmark');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
function get_all_category_ids() {
|
||||
if ( ! $cat_ids = wp_cache_get( 'all_category_ids', 'category' ) ) {
|
||||
$cat_ids = get_terms( 'category', 'fields=ids&get=all' );
|
||||
$cat_ids = get_terms( 'category', array('fields' => 'ids', 'get' => 'all') );
|
||||
wp_cache_add( 'all_category_ids', $cat_ids, 'category' );
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@ function get_category_by_path( $category_path, $full_match = true, $output = OBJ
|
||||
foreach ( (array) $category_paths as $pathdir )
|
||||
$full_path .= ( $pathdir != '' ? '/' : '' ) . sanitize_title( $pathdir );
|
||||
|
||||
$categories = get_terms( 'category', "get=all&slug=$leaf_path" );
|
||||
$categories = get_terms( 'category', array('get' => 'all', 'slug' => $leaf_path) );
|
||||
|
||||
if ( empty( $categories ) )
|
||||
return null;
|
||||
|
||||
@@ -986,7 +986,7 @@ function get_links($category = -1, $before = '', $after = '<br />', $between = '
|
||||
if ( $category == -1 ) //get_bookmarks uses '' to signify all categories
|
||||
$category = '';
|
||||
|
||||
$results = get_bookmarks("category=$category&orderby=$orderby&order=$order&show_updated=$show_updated&limit=$limit");
|
||||
$results = get_bookmarks(array('category' => $category, 'orderby' => $orderby, 'order' => $order, 'show_updated' => $show_updated, 'limit' => $limit));
|
||||
|
||||
if ( !$results )
|
||||
return;
|
||||
@@ -1083,7 +1083,7 @@ function get_links_list($order = 'name', $deprecated = '') {
|
||||
if ( !isset($direction) )
|
||||
$direction = '';
|
||||
|
||||
$cats = get_categories("type=link&orderby=$order&order=$direction&hierarchical=0");
|
||||
$cats = get_categories(array('type' => 'link', 'orderby' => $order, 'order' => $direction, 'hierarchical' => 0));
|
||||
|
||||
// Display each category
|
||||
if ( $cats ) {
|
||||
|
||||
@@ -933,7 +933,7 @@ function get_adjacent_post($in_same_cat = false, $excluded_categories = '', $pre
|
||||
$join = " INNER JOIN $wpdb->term_relationships AS tr ON p.ID = tr.object_id INNER JOIN $wpdb->term_taxonomy tt ON tr.term_taxonomy_id = tt.term_taxonomy_id";
|
||||
|
||||
if ( $in_same_cat ) {
|
||||
$cat_array = wp_get_object_terms($post->ID, 'category', 'fields=ids');
|
||||
$cat_array = wp_get_object_terms($post->ID, 'category', array('fields' => 'ids'));
|
||||
$join .= " AND tt.taxonomy = 'category' AND tt.term_id IN (" . implode(',', $cat_array) . ")";
|
||||
}
|
||||
|
||||
@@ -1075,7 +1075,7 @@ function get_boundary_post($in_same_cat = false, $excluded_categories = '', $sta
|
||||
$excluded_categories = array();
|
||||
if ( !empty($in_same_cat) || !empty($excluded_categories) ) {
|
||||
if ( !empty($in_same_cat) ) {
|
||||
$cat_array = wp_get_object_terms($post->ID, 'category', 'fields=ids');
|
||||
$cat_array = wp_get_object_terms($post->ID, 'category', array('fields' => 'ids'));
|
||||
}
|
||||
|
||||
if ( !empty($excluded_categories) ) {
|
||||
|
||||
@@ -1895,7 +1895,7 @@ function wp_publish_post($post_id) {
|
||||
|
||||
// Update counts for the post's terms.
|
||||
foreach ( (array) get_object_taxonomies('post') as $taxonomy ) {
|
||||
$tt_ids = wp_get_object_terms($post_id, $taxonomy, 'fields=tt_ids');
|
||||
$tt_ids = wp_get_object_terms($post_id, $taxonomy, array('fields' => 'tt_ids'));
|
||||
wp_update_term_count($tt_ids, $taxonomy);
|
||||
}
|
||||
|
||||
|
||||
@@ -1079,7 +1079,7 @@ function wp_delete_object_term_relationships( $object_id, $taxonomies ) {
|
||||
$taxonomies = array($taxonomies);
|
||||
|
||||
foreach ( (array) $taxonomies as $taxonomy ) {
|
||||
$tt_ids = wp_get_object_terms($object_id, $taxonomy, 'fields=tt_ids');
|
||||
$tt_ids = wp_get_object_terms($object_id, $taxonomy, array('fields' => 'tt_ids'));
|
||||
$in_tt_ids = "'" . implode("', '", $tt_ids) . "'";
|
||||
do_action( 'delete_term_relationships', $object_id, $tt_ids );
|
||||
$wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->term_relationships WHERE object_id = %d AND term_taxonomy_id IN ($in_tt_ids)", $object_id) );
|
||||
@@ -1510,7 +1510,7 @@ function wp_set_object_terms($object_id, $terms, $taxonomy, $append = false) {
|
||||
if ( ! $append && isset($t->sort) && $t->sort ) {
|
||||
$values = array();
|
||||
$term_order = 0;
|
||||
$final_tt_ids = wp_get_object_terms($object_id, $taxonomy, 'fields=tt_ids');
|
||||
$final_tt_ids = wp_get_object_terms($object_id, $taxonomy, array('fields' => 'tt_ids'));
|
||||
foreach ( $tt_ids as $tt_id )
|
||||
if ( in_array($tt_id, $final_tt_ids) )
|
||||
$values[] = $wpdb->prepare( "(%d, %d, %d)", $object_id, $tt_id, ++$term_order);
|
||||
@@ -1958,7 +1958,7 @@ function update_object_term_cache($object_ids, $object_type) {
|
||||
if ( empty( $ids ) )
|
||||
return false;
|
||||
|
||||
$terms = wp_get_object_terms($ids, $taxonomies, 'fields=all_with_object_id');
|
||||
$terms = wp_get_object_terms($ids, $taxonomies, array('fields' => 'all_with_object_id'));
|
||||
|
||||
$object_terms = array();
|
||||
foreach ( (array) $terms as $term )
|
||||
@@ -2029,7 +2029,7 @@ function _get_term_hierarchy($taxonomy) {
|
||||
return $children;
|
||||
|
||||
$children = array();
|
||||
$terms = get_terms($taxonomy, 'get=all');
|
||||
$terms = get_terms($taxonomy, array('get' => 'all'));
|
||||
foreach ( $terms as $term ) {
|
||||
if ( $term->parent > 0 )
|
||||
$children[$term->parent][] = $term->term_id;
|
||||
|
||||
Reference in New Issue
Block a user