Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm using the following code to create drop-down menu and filter button for two custom taxonomies assigned to a custom post type called Page Content (full previous code here):

        function parse_query($query) {
            global $pagenow;
            $qv = &$query->query_vars;
            if ($pagenow=='edit.php' &&
                isset($qv['taxonomy']) && $qv['taxonomy']=='locations' &&
                isset($qv['term']) && is_numeric($qv['term'])) {
                    $term = get_term_by('id',$qv['term'],'locations');
                    $qv['term'] = $term->slug;
                }
            if ($pagenow=='edit.php' &&
                isset($qv['taxonomy']) && $qv['taxonomy']=='page_sections' &&
                isset($qv['term']) && is_numeric($qv['term'])) {
                    $term = get_term_by('id',$qv['term'],'page_sections');
                    $qv['term'] = $term->slug;
                }
        }
        // Add filter drop-down menu for the custom taxonomies
        function restrict_manage_posts() {
            global $typenow;
            global $wp_query;
            if ($typenow=='page_content') {
                $taxonomy = 'locations';
                $locations = get_taxonomy($taxonomy);
                wp_dropdown_categories(array(
                    'show_option_all' =>  __("Show All {$locations->label}"),
                    'taxonomy'        =>  $taxonomy,
                    'name'            =>  $taxonomy,
                    'orderby'         =>  'name',
                    'selected'        =>  $wp_query->query['term'],
                    'hierarchical'    =>  true,
                    'depth'           =>  3,
                    'show_count'      =>  true,  // This will give a view
                    'hide_empty'      =>  true,   // This will give false positives, i.e. one's not empty related to the other terms. TODO: Fix that
                ));
            }
            if ($typenow=='page_content') {
                $taxonomy = 'page_sections';
                $page_sections = get_taxonomy($taxonomy);
                wp_dropdown_categories(array(
                    'show_option_all' =>  __("Show All {$page_sections->label}"),
                    'taxonomy'        =>  $taxonomy,
                    'name'            =>  $taxonomy,
                    'orderby'         =>  'name',
                    'selected'        =>  $wp_query->query['term'],
                    'hierarchical'    =>  true,
                    'depth'           =>  3,
                    'show_count'      =>  true,  // This will give a view
                    'hide_empty'      =>  true,   // This will give false positives, i.e. one's not empty related to the other terms. TODO: Fix that
                ));
        }
    }
    YourSite_PageContent::on_load();
}

But I'm getting the following warning:

    Parse error: syntax error, unexpected T_STRING, 
expecting T_FUNCTION in /home/alex/www/wpac/wp-content/themes
/prominent/functions/custom-post-types.php on line 181 

This is line 181: YourSite_PageContent::on_load();

share|improve this question
    
Missing closing brace on the final if condition. –  t31os Feb 7 '11 at 12:56
    
@t31os Thanks, I found it. How can I accept your answer? –  janoChen Feb 7 '11 at 14:15
    
Added as answer. :) –  t31os Feb 7 '11 at 16:03
add comment

1 Answer

up vote 1 down vote accepted

You're missing a closing brace on the final if condition. ;)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.