Use array calling style. Props Denis-de-Bernardy. see #6647

git-svn-id: https://develop.svn.wordpress.org/trunk@12515 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2009-12-23 15:31:02 +00:00
parent 30e399b3e7
commit dcd3604d90
16 changed files with 31 additions and 31 deletions
+1 -1
View File
@@ -55,7 +55,7 @@ switch ($step) {
<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 />
<?php _e('Category:') ?> <select name="cat_id" id="cat_id">
<?php
$categories = get_terms('link_category', 'get=all');
$categories = get_terms('link_category', array('get' => 'all'));
foreach ($categories as $category) {
?>
<option value="<?php echo $category->term_id; ?>"><?php echo esc_html(apply_filters('link_category', $category->name)); ?></option>
+2 -2
View File
@@ -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' ));
+2 -2
View File
@@ -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' ) )
+1 -1
View File
@@ -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 );
}
+3 -3
View File
@@ -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
+3 -3
View File
@@ -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;
+1 -1
View File
@@ -107,7 +107,7 @@ if ( isset($_GET['deleted']) ) {
<input type="submit" value="<?php esc_attr_e('Apply'); ?>" name="doaction" id="doaction" class="button-secondary action" />
<?php
$categories = get_terms('link_category', "hide_empty=1");
$categories = get_terms('link_category', array("hide_empty" => 1));
$select_cat = "<select name=\"cat_id\">\n";
$select_cat .= '<option value="all"' . (($cat_id == 'all') ? " selected='selected'" : '') . '>' . __('View all Categories') . "</option>\n";
foreach ((array) $categories as $cat)