Support » Plugin: Breadcrumb NavXT » Save problem

  • Resolved meneldil

    (@meneldil)


    Hello,

    I can not save my settings on the “Post Types” tab.

    Here is the mistake I have:
    “The following settings were not saved:
    apost_product_root
    bpost_product_archive_display”

    I tried to uninstall and reinstall the plugin, this does not solve the problem.

    • This topic was modified 6 months, 2 weeks ago by  meneldil.
Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author John Havlik

    (@mtekk)

    If you don’t mind, can you tell me what hook the product CPT is registered in? I think I know what is going on, but want confirmation as to when the CPT is registered.

    Hi John,

    Are you talking about that?
    add_action( 'init', 'cpt_product', 0 );

    Plugin Author John Havlik

    (@mtekk)

    That would be it. Looks like it is probably running after the period of time the plugin checks for CPTs (as I had thought), I’m tracking this bug here: https://github.com/mtekk/Breadcrumb-NavXT/issues/210

    So for the moment, impossible to fix the problem?

    Plugin Author John Havlik

    (@mtekk)

    So, looking into this, I’m unfortunately having issues reproducing it locally. The only thing I can get to show up is warnings on the frontend if the priority of the add_action call on the init action is at 11 or “lower” (any number greater than 10). Is your call to add_action in a plugin, or somewhere else? Is it running within a function that hooks into an action? If so what action?

    • This reply was modified 6 months ago by  John Havlik.
    meneldil

    (@meneldil)

    The code is in “functions.php”.

    Here is my code:

    function cpt_product() {
    
    	$labels = array(
    		'name'                  => 'Products',
    		'singular_name'         => 'Products',
    		'menu_name'             => 'Products',
    		'name_admin_bar'        => 'Products',
    		'all_items'             => 'All Products',
    		'add_new_item'          => 'Add New Product',
    		'add_new'               => 'Add New',
    		'new_item'              => 'New Product',
    		'edit_item'             => 'Edit Product',
    		'update_item'           => 'Update Product',
    		'view_item'             => 'View Product',
    		'view_items'            => 'View Products',
    		'search_items'          => 'Search Product',
    	);
    	$rewrite = array(
    		'slug'                  => 'product',
    		'with_front'            => true,
    		'pages'                 => true,
    		'feeds'                 => true,
    	);
    	$args = array(
    		'label'                 => 'Product',
    		'description'           => 'Products',
    		'labels'                => $labels,
    		'supports'              => array( 'title', 'thumbnail' ),
    		'hierarchical'          => true,
    		'public'                => true,
    		'show_ui'               => true,
    		'show_in_menu'          => true,
    		'menu_position'         => 20,
    		'menu_icon'             => 'dashicons-products',
    		'show_in_admin_bar'     => true,
    		'show_in_nav_menus'     => true,
    		'can_export'            => true,
    		'has_archive'           => 'product',
    		'exclude_from_search'   => false,
    		'publicly_queryable'    => true,
    		'rewrite'               => $rewrite,
    		'capability_type'       => 'page',
    	);
    	register_post_type( 'product', $args );
    
    }
    add_action( 'init', 'cpt_product', 0 );
    
    Plugin Author John Havlik

    (@mtekk)

    Thanks for that, it looks like there was a bug in the handling for hierarchical CPT default settings (I was testing with non-hierarchical CPTs out of convenience which is obviously an issue). I’m now able to reproduce this locally and will be issuing an update with a fix this week (6.2.1).

    meneldil

    (@meneldil)

    Good news!!!
    I look forward. πŸ™‚

    Plugin Author John Havlik

    (@mtekk)

    There should be a fixed version available up on github now.

    meneldil

    (@meneldil)

    Ok, thanks and in WordPress?

    Plugin Author John Havlik

    (@mtekk)

    Breadcrumb NavXT 6.2.1 was released yesterday (2018-10-26).

    It works!
    Thank you so much! πŸ™‚

Viewing 12 replies - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.