diff --git a/wp-admin/import/opml.php b/wp-admin/import/opml.php index 7f2e1dc1ae..030f06cf83 100644 --- a/wp-admin/import/opml.php +++ b/wp-admin/import/opml.php @@ -55,7 +55,7 @@ switch ($step) {
'all')); foreach ($categories as $category) { ?> name)); ?> diff --git a/wp-admin/import/wordpress.php b/wp-admin/import/wordpress.php index 8435b0dd6a..c8b4896dff 100644 --- a/wp-admin/import/wordpress.php +++ b/wp-admin/import/wordpress.php @@ -302,7 +302,7 @@ class WP_Import { function process_categories() { global $wpdb; - $cat_names = (array) get_terms('category', 'fields=names'); + $cat_names = (array) get_terms('category', array('fields' => 'names')); while ( $c = array_shift($this->categories) ) { $cat_name = trim($this->get_tag( $c, 'wp:cat_name' )); @@ -332,7 +332,7 @@ class WP_Import { function process_tags() { global $wpdb; - $tag_names = (array) get_terms('post_tag', 'fields=names'); + $tag_names = (array) get_terms('post_tag', array('fields' => 'names')); while ( $c = array_shift($this->tags) ) { $tag_name = trim($this->get_tag( $c, 'wp:tag_name' )); diff --git a/wp-admin/import/wp-cat2tag.php b/wp-admin/import/wp-cat2tag.php index b4312b6151..b2eb40ce31 100644 --- a/wp-admin/import/wp-cat2tag.php +++ b/wp-admin/import/wp-cat2tag.php @@ -39,7 +39,7 @@ class WP_Categories_to_Tags { function populate_cats() { - $categories = get_categories('get=all'); + $categories = get_categories(array('get' => 'all')); foreach ( $categories as $category ) { $this->all_categories[] = $category; if ( is_term( $category->slug, 'post_tag' ) ) @@ -49,7 +49,7 @@ class WP_Categories_to_Tags { function populate_tags() { - $tags = get_terms( array('post_tag'), 'get=all' ); + $tags = get_terms( array('post_tag'), array('get' => 'all') ); foreach ( $tags as $tag ) { $this->all_tags[] = $tag; if ( is_term( $tag->slug, 'category' ) ) diff --git a/wp-admin/includes/bookmark.php b/wp-admin/includes/bookmark.php index 64621fdc66..eed6ab2298 100644 --- a/wp-admin/includes/bookmark.php +++ b/wp-admin/includes/bookmark.php @@ -102,7 +102,7 @@ function wp_delete_link( $link_id ) { */ function wp_get_link_cats( $link_id = 0 ) { - $cats = wp_get_object_terms( $link_id, 'link_category', 'fields=ids' ); + $cats = wp_get_object_terms( $link_id, 'link_category', array('fields' => 'ids') ); return array_unique( $cats ); } diff --git a/wp-admin/includes/export.php b/wp-admin/includes/export.php index 394a4c8e4c..63193faa02 100644 --- a/wp-admin/includes/export.php +++ b/wp-admin/includes/export.php @@ -43,8 +43,8 @@ if ( $author and $author != 'all' ) { // grab a snapshot of post IDs, just in case it changes during the export $post_ids = $wpdb->get_col("SELECT ID FROM $wpdb->posts $where ORDER BY post_date_gmt ASC"); -$categories = (array) get_categories('get=all'); -$tags = (array) get_tags('get=all'); +$categories = (array) get_categories(array('get' => 'all')); +$tags = (array) get_tags(array('get' => 'all')); $custom_taxonomies = $wp_taxonomies; unset($custom_taxonomies['category']); @@ -76,7 +76,7 @@ function wxr_missing_parents($categories) { } while ( $parents = wxr_missing_parents($categories) ) { - $found_parents = get_categories("include=" . join(', ', $parents)); + $found_parents = get_categories(array('include' => join(', ', $parents))); if ( is_array($found_parents) && count($found_parents) ) $categories = array_merge($categories, $found_parents); else diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index 39f703a252..4229726766 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -508,11 +508,11 @@ function wp_category_checklist( $post_id = 0, $descendants_and_self = 0, $select $args['popular_cats'] = get_terms( 'category', array( 'fields' => 'ids', 'orderby' => 'count', 'order' => 'DESC', 'number' => 10, 'hierarchical' => false ) ); if ( $descendants_and_self ) { - $categories = get_categories( "child_of=$descendants_and_self&hierarchical=0&hide_empty=0" ); + $categories = get_categories(array('child_of' => $descendants_and_self, 'hierarchical' => 0, 'hide_empty' => 0)); $self = get_category( $descendants_and_self ); array_unshift( $categories, $self ); } else { - $categories = get_categories('get=all'); + $categories = get_categories(array('get' => 'all')); } if ( $checked_ontop ) { @@ -612,7 +612,7 @@ function wp_link_category_checklist( $link_id = 0 ) { $checked_categories[] = $default; } - $categories = get_terms('link_category', 'orderby=count&hide_empty=0'); + $categories = get_terms('link_category', array('orderby' => 'count', 'hide_empty' => 0)); if ( empty($categories) ) return; diff --git a/wp-admin/link-manager.php b/wp-admin/link-manager.php index e818e392aa..87e32923e3 100644 --- a/wp-admin/link-manager.php +++ b/wp-admin/link-manager.php @@ -107,7 +107,7 @@ if ( isset($_GET['deleted']) ) { 1)); $select_cat = "\n"; $select_cat .= '' . __('View all Categories') . "\n"; foreach ((array) $categories as $cat) diff --git a/wp-app.php b/wp-app.php index aaa607e17c..a792144681 100644 --- a/wp-app.php +++ b/wp-app.php @@ -374,7 +374,7 @@ EOD; $home = esc_attr(get_bloginfo_rss('home')); $categories = ""; - $cats = get_categories("hierarchical=0&hide_empty=0"); + $cats = get_categories(array('hierarchical' => 0, 'hide_empty' => 0)); foreach ((array) $cats as $cat) { $categories .= " name) . "\" />\n"; } diff --git a/wp-includes/bookmark.php b/wp-includes/bookmark.php index c406fcaf50..c63323dad8 100644 --- a/wp-includes/bookmark.php +++ b/wp-includes/bookmark.php @@ -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'); } } diff --git a/wp-includes/category.php b/wp-includes/category.php index 372c4c70cb..f9da42e3b5 100644 --- a/wp-includes/category.php +++ b/wp-includes/category.php @@ -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; diff --git a/wp-includes/deprecated.php b/wp-includes/deprecated.php index f7625d8c08..0854468517 100644 --- a/wp-includes/deprecated.php +++ b/wp-includes/deprecated.php @@ -986,7 +986,7 @@ function get_links($category = -1, $before = '', $after = '', $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 ) { diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index 2a8eea4b4b..109d4d99b4 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -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) ) { diff --git a/wp-includes/post.php b/wp-includes/post.php index f2622561d4..509a5dcfa1 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -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); } diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index 262149a8f9..0a82eabb2a 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -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; diff --git a/wp-links-opml.php b/wp-links-opml.php index b9170528ce..e033d4989f 100644 --- a/wp-links-opml.php +++ b/wp-links-opml.php @@ -36,9 +36,9 @@ if ((empty ($link_cat)) || ($link_cat == 'all') || ($link_cat == '0')) { 'link', 'hierarchical' => 0)); else - $cats = get_categories('type=link&hierarchical=0&include='.$link_cat); + $cats = get_categories(array('type' => 'link', 'hierarchical' => 0, 'include' => $link_cat)); foreach ((array) $cats as $cat) { $catname = apply_filters('link_category', $cat->name); @@ -47,7 +47,7 @@ foreach ((array) $cats as $cat) { term_id}"); + $bookmarks = get_bookmarks(array("category" => $cat->term_id)); foreach ((array) $bookmarks as $bookmark) { $title = esc_attr(apply_filters('link_title', $bookmark->link_name)); ?> diff --git a/xmlrpc.php b/xmlrpc.php index 8e683b7569..7700696c51 100644 --- a/xmlrpc.php +++ b/xmlrpc.php @@ -2806,7 +2806,7 @@ class wp_xmlrpc_server extends IXR_Server { $categories_struct = array(); - if ( $cats = get_categories('get=all') ) { + if ( $cats = get_categories(array('get' => 'all')) ) { foreach ( $cats as $cat ) { $struct['categoryId'] = $cat->term_id; $struct['parentId'] = $cat->parent; @@ -2998,7 +2998,7 @@ class wp_xmlrpc_server extends IXR_Server { $categories_struct = array(); - if ( $cats = get_categories('hide_empty=0&hierarchical=0') ) { + if ( $cats = get_categories(array('hide_empty' => 0, 'hierarchical' => 0)) ) { foreach ($cats as $cat) { $struct['categoryId'] = $cat->term_id; $struct['categoryName'] = $cat->name;