Skip to content

Commit dcd3604

Browse files
committed
Use array calling style. Props Denis-de-Bernardy. see WordPress#6647
git-svn-id: https://develop.svn.wordpress.org/trunk@12515 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 30e399b commit dcd3604

16 files changed

Lines changed: 31 additions & 31 deletions

wp-admin/import/opml.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ function dispatch() {
5555
<p style="clear: both; margin-top: 1em;"><label for="cat_id"><?php _e('Now select a category you want to put these links in.') ?></label><br />
5656
<?php _e('Category:') ?> <select name="cat_id" id="cat_id">
5757
<?php
58-
$categories = get_terms('link_category', 'get=all');
58+
$categories = get_terms('link_category', array('get' => 'all'));
5959
foreach ($categories as $category) {
6060
?>
6161
<option value="<?php echo $category->term_id; ?>"><?php echo esc_html(apply_filters('link_category', $category->name)); ?></option>

wp-admin/import/wordpress.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ function checkauthor($author) {
302302
function process_categories() {
303303
global $wpdb;
304304

305-
$cat_names = (array) get_terms('category', 'fields=names');
305+
$cat_names = (array) get_terms('category', array('fields' => 'names'));
306306

307307
while ( $c = array_shift($this->categories) ) {
308308
$cat_name = trim($this->get_tag( $c, 'wp:cat_name' ));
@@ -332,7 +332,7 @@ function process_categories() {
332332
function process_tags() {
333333
global $wpdb;
334334

335-
$tag_names = (array) get_terms('post_tag', 'fields=names');
335+
$tag_names = (array) get_terms('post_tag', array('fields' => 'names'));
336336

337337
while ( $c = array_shift($this->tags) ) {
338338
$tag_name = trim($this->get_tag( $c, 'wp:tag_name' ));

wp-admin/import/wp-cat2tag.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function footer() {
3939

4040
function populate_cats() {
4141

42-
$categories = get_categories('get=all');
42+
$categories = get_categories(array('get' => 'all'));
4343
foreach ( $categories as $category ) {
4444
$this->all_categories[] = $category;
4545
if ( is_term( $category->slug, 'post_tag' ) )
@@ -49,7 +49,7 @@ function populate_cats() {
4949

5050
function populate_tags() {
5151

52-
$tags = get_terms( array('post_tag'), 'get=all' );
52+
$tags = get_terms( array('post_tag'), array('get' => 'all') );
5353
foreach ( $tags as $tag ) {
5454
$this->all_tags[] = $tag;
5555
if ( is_term( $tag->slug, 'category' ) )

wp-admin/includes/bookmark.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ function wp_delete_link( $link_id ) {
102102
*/
103103
function wp_get_link_cats( $link_id = 0 ) {
104104

105-
$cats = wp_get_object_terms( $link_id, 'link_category', 'fields=ids' );
105+
$cats = wp_get_object_terms( $link_id, 'link_category', array('fields' => 'ids') );
106106

107107
return array_unique( $cats );
108108
}

wp-admin/includes/export.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ function export_wp($author='') {
4343
// grab a snapshot of post IDs, just in case it changes during the export
4444
$post_ids = $wpdb->get_col("SELECT ID FROM $wpdb->posts $where ORDER BY post_date_gmt ASC");
4545

46-
$categories = (array) get_categories('get=all');
47-
$tags = (array) get_tags('get=all');
46+
$categories = (array) get_categories(array('get' => 'all'));
47+
$tags = (array) get_tags(array('get' => 'all'));
4848

4949
$custom_taxonomies = $wp_taxonomies;
5050
unset($custom_taxonomies['category']);
@@ -76,7 +76,7 @@ function wxr_missing_parents($categories) {
7676
}
7777

7878
while ( $parents = wxr_missing_parents($categories) ) {
79-
$found_parents = get_categories("include=" . join(', ', $parents));
79+
$found_parents = get_categories(array('include' => join(', ', $parents)));
8080
if ( is_array($found_parents) && count($found_parents) )
8181
$categories = array_merge($categories, $found_parents);
8282
else

wp-admin/includes/template.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -508,11 +508,11 @@ function wp_category_checklist( $post_id = 0, $descendants_and_self = 0, $select
508508
$args['popular_cats'] = get_terms( 'category', array( 'fields' => 'ids', 'orderby' => 'count', 'order' => 'DESC', 'number' => 10, 'hierarchical' => false ) );
509509

510510
if ( $descendants_and_self ) {
511-
$categories = get_categories( "child_of=$descendants_and_self&hierarchical=0&hide_empty=0" );
511+
$categories = get_categories(array('child_of' => $descendants_and_self, 'hierarchical' => 0, 'hide_empty' => 0));
512512
$self = get_category( $descendants_and_self );
513513
array_unshift( $categories, $self );
514514
} else {
515-
$categories = get_categories('get=all');
515+
$categories = get_categories(array('get' => 'all'));
516516
}
517517

518518
if ( $checked_ontop ) {
@@ -612,7 +612,7 @@ function wp_link_category_checklist( $link_id = 0 ) {
612612
$checked_categories[] = $default;
613613
}
614614

615-
$categories = get_terms('link_category', 'orderby=count&hide_empty=0');
615+
$categories = get_terms('link_category', array('orderby' => 'count', 'hide_empty' => 0));
616616

617617
if ( empty($categories) )
618618
return;

wp-admin/link-manager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
<input type="submit" value="<?php esc_attr_e('Apply'); ?>" name="doaction" id="doaction" class="button-secondary action" />
108108

109109
<?php
110-
$categories = get_terms('link_category', "hide_empty=1");
110+
$categories = get_terms('link_category', array("hide_empty" => 1));
111111
$select_cat = "<select name=\"cat_id\">\n";
112112
$select_cat .= '<option value="all"' . (($cat_id == 'all') ? " selected='selected'" : '') . '>' . __('View all Categories') . "</option>\n";
113113
foreach ((array) $categories as $cat)

wp-app.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ function get_categories_xml() {
374374
$home = esc_attr(get_bloginfo_rss('home'));
375375

376376
$categories = "";
377-
$cats = get_categories("hierarchical=0&hide_empty=0");
377+
$cats = get_categories(array('hierarchical' => 0, 'hide_empty' => 0));
378378
foreach ((array) $cats as $cat) {
379379
$categories .= " <category term=\"" . esc_attr($cat->name) . "\" />\n";
380380
}

wp-includes/bookmark.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function get_bookmark($bookmark, $output = OBJECT, $filter = 'raw') {
3333
$_bookmark = & $GLOBALS['link'];
3434
} elseif ( ! $_bookmark = wp_cache_get($bookmark, 'bookmark') ) {
3535
$_bookmark = $wpdb->get_row($wpdb->prepare("SELECT * FROM $wpdb->links WHERE link_id = %d LIMIT 1", $bookmark));
36-
$_bookmark->link_category = array_unique( wp_get_object_terms($_bookmark->link_id, 'link_category', 'fields=ids') );
36+
$_bookmark->link_category = array_unique( wp_get_object_terms($_bookmark->link_id, 'link_category', array('fields' => 'ids')) );
3737
wp_cache_add($_bookmark->link_id, $_bookmark, 'bookmark');
3838
}
3939
}

wp-includes/category.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616
function get_all_category_ids() {
1717
if ( ! $cat_ids = wp_cache_get( 'all_category_ids', 'category' ) ) {
18-
$cat_ids = get_terms( 'category', 'fields=ids&get=all' );
18+
$cat_ids = get_terms( 'category', array('fields' => 'ids', 'get' => 'all') );
1919
wp_cache_add( 'all_category_ids', $cat_ids, 'category' );
2020
}
2121

@@ -113,7 +113,7 @@ function get_category_by_path( $category_path, $full_match = true, $output = OBJ
113113
foreach ( (array) $category_paths as $pathdir )
114114
$full_path .= ( $pathdir != '' ? '/' : '' ) . sanitize_title( $pathdir );
115115

116-
$categories = get_terms( 'category', "get=all&slug=$leaf_path" );
116+
$categories = get_terms( 'category', array('get' => 'all', 'slug' => $leaf_path) );
117117

118118
if ( empty( $categories ) )
119119
return null;

0 commit comments

Comments
 (0)