Plugin Directory

Changeset 636040


Ignore:
Timestamp:
12/09/2012 07:35:30 AM (12 years ago)
Author:
ajayver
Message:

Fixed "Warning: Invalid argument supplied for foreach() in /wp-content/plugins/cat-tag-filter-widget/cat-tag-filter.php on line 454" for multisite wordpress

Location:
cat-tag-filter-widget/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cat-tag-filter-widget/trunk/cat-tag-filter.php

    r628903 r636040  
    452452    global $wp_rewrite;
    453453    $ctf_options = get_option('widget_cat_tag_filter');
    454     foreach ($ctf_options as $widget_options){
    455         if ($widget_options['category_tax']){
    456        
    457             $taxonomies = get_taxonomies('','','');
    458        
    459             $new_rules = array(
    460                 $taxonomies[$widget_options['category_tax']]->rewrite['slug'] . '/(.+?)/' . $taxonomies[$widget_options['tag_tax']]->rewrite['slug'] . '/(.+?)/page/?([0-9]{1,})/?$' => 'index.php?' . $taxonomies[$widget_options['category_tax']]->query_var . '=' . $wp_rewrite->preg_index(1) . '&' . $taxonomies[$widget_options['tag_tax']]->query_var . '=' . $wp_rewrite->preg_index(2) . '&paged=' . $wp_rewrite->preg_index(3),
    461                 $taxonomies[$widget_options['category_tax']]->rewrite['slug'] . '/(.+?)/' . $taxonomies[$widget_options['tag_tax']]->rewrite['slug'] . '/(.+?)/?$' => 'index.php?' . $taxonomies[$widget_options['category_tax']]->query_var . '=' . $wp_rewrite->preg_index(1) . '&' . $taxonomies[$widget_options['tag_tax']]->query_var . '=' . $wp_rewrite->preg_index(2)
    462                  
    463             );
    464             $wp_rewrite->rules = $new_rules + $wp_rewrite->rules;
    465 
    466             }
    467         }
     454    if ($ctf_options){
     455        foreach ($ctf_options as $widget_options){
     456            if ($widget_options['category_tax']){
     457           
     458                $taxonomies = get_taxonomies('','','');
     459           
     460                $new_rules = array(
     461                    $taxonomies[$widget_options['category_tax']]->rewrite['slug'] . '/(.+?)/' . $taxonomies[$widget_options['tag_tax']]->rewrite['slug'] . '/(.+?)/page/?([0-9]{1,})/?$' => 'index.php?' . $taxonomies[$widget_options['category_tax']]->query_var . '=' . $wp_rewrite->preg_index(1) . '&' . $taxonomies[$widget_options['tag_tax']]->query_var . '=' . $wp_rewrite->preg_index(2) . '&paged=' . $wp_rewrite->preg_index(3),
     462                    $taxonomies[$widget_options['category_tax']]->rewrite['slug'] . '/(.+?)/' . $taxonomies[$widget_options['tag_tax']]->rewrite['slug'] . '/(.+?)/?$' => 'index.php?' . $taxonomies[$widget_options['category_tax']]->query_var . '=' . $wp_rewrite->preg_index(1) . '&' . $taxonomies[$widget_options['tag_tax']]->query_var . '=' . $wp_rewrite->preg_index(2)
     463                     
     464                );
     465                $wp_rewrite->rules = $new_rules + $wp_rewrite->rules;
     466
     467                }
     468         }
    468469   
    469 
     470     }
    470471   
    471472    }
  • cat-tag-filter-widget/trunk/readme.txt

    r628903 r636040  
    7676== Changelog ==
    7777
     78= 0.9.2 =
     79* Fixed "Warning: Invalid argument supplied for foreach() in /wp-content/plugins/cat-tag-filter-widget/cat-tag-filter.php on line 454" for multisite wordpress
     80
    7881= 0.9.1 =
    79 * fixed 404 on pages
     82* Fixed 404 on pages
    8083
    8184= 0.9 =
     
    8487= 0.8.4 =
    8588* Added an option to switch off corresponding tags mode.
    86 * fixed layout in categories with no corresponding tags.
    87 * fixed corresponding tags for categories with more than one page of posts.
     89* Fixed layout in categories with no corresponding tags.
     90* Fixed corresponding tags for categories with more than one page of posts.
    8891
    8992
    9093= 0.8.4 =
    91 * fixed layout in categories with no corresponding tags.
     94* Fixed layout in categories with no corresponding tags.
    9295
    9396= 0.8.3 =
    94 * fixed a bug with tags including\excluding.
     97* Fixed a bug with tags including\excluding.
    9598
    9699= 0.8 =
Note: See TracChangeset for help on using the changeset viewer.