Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter ipoint-tech

    (@ipoint-tech)

    HOW TO FIX:
    EDIT store_locator.php
    REMOVE: (Lines 17-47)

    function create_store_post_type() {
    	register_post_type( 'pazzey_store',
    		array(
    			'labels' => array(
    				'name' => __( 'Stores' ),
    				'singular_name' => __( 'Store' ),
    				'add_new' => __( 'Add New Store' ),
    				'add_new_item' => __( 'Add Store' ),
    				'edit' => __( 'Edit' ),
    				'edit_item' => __( 'Edit Store' ),
    				'new_item' => __( 'New Store' ),
    				'view' => __( 'View Store' ),
    				'view_item' => __( 'View Store' ),
    				'search_items' => __( 'Search Stores' ),
    				'not_found' => __( 'No Stores found' ),
    				'not_found_in_trash' => __( 'No Stores found in Trash' ),
    				'parent' => __( 'Parent Store' ),
    
    			),
    			'public' => true,
    			'show_ui' => true,
    			'publicly_queryable' => truew,
    			'exclude_from_search' => true,
    			'menu_position' => 20,
    			'hierarchical' => true,
    			'query_var' => true,
    			'supports' => array( 'title', 'editor', 'excerpt','thumbnail','page-attributes' ),
    		)
    	);
    	flush_rewrite_rules( false );
    }

    REPLACE WITH:

    function create_store_post_type() {
    	$labels = array(
    		'name'               => _x( 'Stores', 'post type general name', 'your-plugin-textdomain' ),
    		'singular_name'      => _x( 'Store', 'post type singular name', 'your-plugin-textdomain' ),
    		'add_new'            => _x( 'Add New Store', 'book', 'your-plugin-textdomain' ),
    		'add_new_item'       => __( 'Add Store', 'your-plugin-textdomain' ),
    		'new_item'           => __( 'New Store', 'your-plugin-textdomain' ),
    		'edit_item'          => __( 'Edit Store', 'your-plugin-textdomain' ),
    		'view_item'          => __( 'View Store', 'your-plugin-textdomain' ),
    		'all_items'          => __( 'All Stores', 'your-plugin-textdomain' ),
    		'search_items'       => __( 'Search Stores', 'your-plugin-textdomain' ),
    		'not_found'          => __( 'No stores found.', 'your-plugin-textdomain' ),
    		'not_found_in_trash' => __( 'No stores found in Trash.', 'your-plugin-textdomain' )
    	);
    
    	$args = array(
    		'labels'             => $labels,
    		'public'             => true,
    		'publicly_queryable' => true,
    		'show_ui'            => true,
    		'show_in_menu'       => true,
    		'query_var'          => true,
    		'rewrite'            => array( 'slug' => 'stores' ),
    		'capability_type'    => 'post',
    		'has_archive'        => false,
    		'hierarchical'       => true,
    		'menu_position'      => null,
    		'supports'           => array( 'title', 'editor', 'excerpt', 'thumbnail', 'page-attributes' )
    	);
    
    	// Add new taxonomy, make it hierarchical (like categories)
    	$labels = array(
    		'name'              => _x( 'Genres', 'taxonomy general name' ),
    		'singular_name'     => _x( 'Genre', 'taxonomy singular name' ),
    		'search_items'      => __( 'Search Genres' ),
    		'all_items'         => __( 'All Genres' ),
    		'parent_item'       => __( 'Parent Genre' ),
    		'parent_item_colon' => __( 'Parent Genre:' ),
    		'edit_item'         => __( 'Edit Genre' ),
    		'update_item'       => __( 'Update Genre' ),
    		'add_new_item'      => __( 'Add New Genre' ),
    		'new_item_name'     => __( 'New Genre Name' ),
    		'menu_name'         => __( 'Genre' ),
    	);
    
    	$args = array(
    		'hierarchical'      => true,
    		'labels'            => $labels,
    		'show_ui'           => true,
    		'show_admin_column' => true,
    		'query_var'         => true,
    		'rewrite'           => array( 'slug' => 'genre' ),
    	);
    
    	register_taxonomy( 'genre', array( 'book' ), $args );
    
    	// Add new taxonomy, NOT hierarchical (like tags)
    	$labels = array(
    		'name'                       => _x( 'Locations', 'taxonomy general name' ),
    		'singular_name'              => _x( 'Location', 'taxonomy singular name' ),
    		'search_items'               => __( 'Search Locations' ),
    		'popular_items'              => __( 'Popular Locations' ),
    		'all_items'                  => __( 'All Locations' ),
    		'parent_item'                => null,
    		'parent_item_colon'          => null,
    		'edit_item'                  => __( 'Edit Location' ),
    		'update_item'                => __( 'Update Location' ),
    		'add_new_item'               => __( 'Add New Location' ),
    		'new_item_name'              => __( 'New Location Name' ),
    		'separate_items_with_commas' => __( 'Separate locations with commas' ),
    		'add_or_remove_items'        => __( 'Add or remove locations' ),
    		'choose_from_most_used'      => __( 'Choose from the most used locations' ),
    		'not_found'                  => __( 'No locations found.' ),
    		'menu_name'                  => __( 'Locations' ),
    	);
    
    	$args = array(
    		'hierarchical'          => false,
    		'labels'                => $labels,
    		'show_ui'               => true,
    		'show_admin_column'     => true,
    		'update_count_callback' => '_update_post_term_count',
    		'query_var'             => true,
    		'rewrite'               => array( 'slug' => 'writer' ),
    	);
    
    	register_taxonomy( 'writer', 'book', $args );
    
    	register_post_type( 'pazzey_store', $args );
    
    }

    Not sure if this code is perfect, I used it from a WordPress example, but it works.

    This is a Godsend! I had just figured out that Pazzey’s was breaking my WooCommerce endpoints, and you just happened to post this earlier today. Thanks – worked for me too!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Not compatible with WooCommerce 2.1.x’ is closed to new replies.