• Resolved JGold1993

    (@jgold1993)


    Okay, so I am trying to add this taxonomy:

    add_action('init',
    'create_backgrounds_taxonomies');
    
    function create_backgrounds_taxonomies(){
    register_taxonomy(
    	'categories',
    	'backgrounds',
    	array(
    		'hierarchical' => true,
    		'labels' => $labels,
    		'rewrite' => array('slug' => 'categories','with_front' => true),
    		'public' => true,
    		'show_ui' => true,
        	'query_var' => true
    		)
    	);
    }

    it’s for a custom post type, but when I do, I get this error at the top of every page:

    Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /wp-includes/post.php on line 1194

    Can someone help me please????
    I had it working, and then all of the sudden it stopped working.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Dion Hulse

    (@dd32)

    Meta Developer

    what is $labels set to? If defined, it must be an array, it looks like you’ve probably not included it, resulting in passing NULL in.

    I’d highly suggest you enable WP_DEBUG in your wp-config.php file (define it to true) as it’ll help you debug issues such as this one.

    Thread Starter JGold1993

    (@jgold1993)

    Got it. Labels was plural. Feel stupid.
    Thank you btw 😀

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom Taxonomy array_merge ERROR’ is closed to new replies.