WordPress.org

Ready to get started?Download WordPress

Forums

Types - Custom Fields and Custom Post Types Management
PHP errors when creating post types and taxonomies (4 posts)

  1. Chisos Designs
    Member
    Posted 1 year ago #

    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/

  2. jonathan176
    Member
    Posted 1 year ago #

    I'm having the same problem

  3. Satrya
    Member
    Posted 1 year ago #

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

  4. David Lingren
    Member
    Posted 1 year ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.