Support » Plugin: Toolset Types - Custom Post Types, Custom Fields and Taxonomies » PHP errors when creating post types and taxonomies

  • When I create a new post type or taxonomy, I get the following errors:

    Warning: array_combine() [function.array-combine]: Both parameters should have at least 1 element in /nfs/c04/h05/mnt/68507/domains/lektrikwp.bluebonnets.org/html/wp-content/plugins/types/wpcf.php on line 170

    Warning: array_merge() [function.array-merge]: Argument #1 is not an array in /nfs/c04/h05/mnt/68507/domains/lektrikwp.bluebonnets.org/html/wp-content/plugins/types/wpcf.php on line 170

    Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /nfs/c04/h05/mnt/68507/domains/lektrikwp.bluebonnets.org/html/wp-content/plugins/types/wpcf.php on line 177

    Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /nfs/c04/h05/mnt/68507/domains/lektrikwp.bluebonnets.org/html/wp-content/plugins/types/wpcf.php on line 177

    Warning: in_array() expects parameter 2 to be array, null given in /nfs/c04/h05/mnt/68507/domains/lektrikwp.bluebonnets.org/html/wp-content/plugins/types/wpcf.php on line 179

    Warning: array_combine() [function.array-combine]: Both parameters should have at least 1 element in /nfs/c04/h05/mnt/68507/domains/lektrikwp.bluebonnets.org/html/wp-content/plugins/types/wpcf.php on line 170

    Warning: array_merge() [function.array-merge]: Argument #1 is not an array in /nfs/c04/h05/mnt/68507/domains/lektrikwp.bluebonnets.org/html/wp-content/plugins/types/wpcf.php on line 170

    Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /nfs/c04/h05/mnt/68507/domains/lektrikwp.bluebonnets.org/html/wp-content/plugins/types/wpcf.php on line 177

    Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /nfs/c04/h05/mnt/68507/domains/lektrikwp.bluebonnets.org/html/wp-content/plugins/types/wpcf.php on line 177

    Warning: in_array() expects parameter 2 to be array, null given in /nfs/c04/h05/mnt/68507/domains/lektrikwp.bluebonnets.org/html/wp-content/plugins/types/wpcf.php on line 179

    Warning: Cannot modify header information – headers already sent by (output started at /nfs/c04/h05/mnt/68507/domains/lektrikwp.bluebonnets.org/html/wp-content/plugins/types/wpcf.php:170) in /nfs/c04/h05/mnt/68507/domains/lektrikwp.bluebonnets.org/html/wp-includes/pluggable.php on line 875

    Suggestions?

    http://wordpress.org/plugins/types/

Viewing 3 replies - 1 through 3 (of 3 total)
  • I’m having the same problem

    Yep, me too. You only need to refresh the browser.

    Until there’s an official fix you can modify the wpcf.php file to avoid these messages. Look for the “Add custom types” and “Add taxonomies” code starting around line 157 and change the code to something like this:

    // Add custom types
        $custom_types = array_keys( (array) get_option( 'wpcf-custom-types', array() ) );
    	if ( empty( $custom_taxonomies ) )
    	    $post_types = get_post_types();
    	else
    	    $post_types = array_merge( array_combine( $custom_types,
        	                $custom_types ), get_post_types() );
        // Unset to avoid checking itself
        if ( $context == 'post_type' && isset( $post_types[$name] ) ) {
            unset( $post_types[$name] );
        }
    
        // Add taxonomies
        $custom_taxonomies = array_keys( (array) get_option( 'wpcf-custom-taxonomies',
                        array() ) );
    	if ( empty( $custom_taxonomies ) )
    	    $taxonomies = get_taxonomies();
    	else
        	$taxonomies = array_merge( array_combine( $custom_taxonomies,
            	            $custom_taxonomies ), get_taxonomies() );
        // Unset to avoid checking itself
        if ( $context == 'taxonomy' && isset( $taxonomies[$name] ) ) {
            unset( $taxonomies[$name] );

    The “if ( empty” logic avoids the array_combine and array_merge calls until you’ve defined custom types and/or taxonomies.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘PHP errors when creating post types and taxonomies’ is closed to new replies.