• Resolved Giovanni Invernizzi

    (@paperplanenan)


    Hello,
    when using your plugin to optimize database in combination with Polylang (both free and PRO) if the option “Clean orphaned relationship data” is selected some custom taxomomies terms are deleted, even if there are even if there are contents associated with that taxonomy.
    Please lat me know if you need more details.

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi @paperplanenan,

    Thank you for your report.
    Could you tell us know what type of data is affected? What are the relationships? eg. Posts types and taxonomy types?

    Thanks!

    Thread Starter Giovanni Invernizzi

    (@paperplanenan)

    Hello Marc,
    this is the code for CPT:

    function cptui_register_my_cpts_prodotto() {
    
    	/**
    	 * Post Type: Prodotti.
    	 */
    
    	$labels = array(
    		"name" => __( "Prodotti", "custom-post-type-ui" ),
    		"singular_name" => __( "Prodotto", "custom-post-type-ui" ),
    	);
    
    	$args = array(
    		"label" => __( "Prodotti", "custom-post-type-ui" ),
    		"labels" => $labels,
    		"description" => "",
    		"public" => true,
    		"publicly_queryable" => true,
    		"show_ui" => true,
    		"delete_with_user" => false,
    		"show_in_rest" => false,
    		"rest_base" => "",
    		"rest_controller_class" => "WP_REST_Posts_Controller",
    		"has_archive" => false,
    		"show_in_menu" => true,
    		"show_in_nav_menus" => true,
    		"exclude_from_search" => false,
    		"capability_type" => "post",
    		"map_meta_cap" => true,
    		"hierarchical" => false,
    		"rewrite" => array( "slug" => "prodotto", "with_front" => true ),
    		"query_var" => true,
    		"supports" => array( "title", "editor", "thumbnail", "author" ),
    		"taxonomies" => array( "cat_prodotto" ),
    	);
    
    	register_post_type( "prodotto", $args );
    }
    
    add_action( 'init', 'cptui_register_my_cpts_prodotto' );
    

    and this is the related taxonomy:

    function cptui_register_my_taxes_cat_prodotto() {
    
    	/**
    	 * Taxonomy: Categorie prodotto.
    	 */
    
    	$labels = array(
    		"name" => __( "Categorie prodotto", "custom-post-type-ui" ),
    		"singular_name" => __( "Categoria prodotto", "custom-post-type-ui" ),
    	);
    
    	$args = array(
    		"label" => __( "Categorie prodotto", "custom-post-type-ui" ),
    		"labels" => $labels,
    		"public" => true,
    		"publicly_queryable" => true,
    		"hierarchical" => true,
    		"show_ui" => true,
    		"show_in_menu" => true,
    		"show_in_nav_menus" => true,
    		"query_var" => true,
    		"rewrite" => array( 'slug' => 'cat_prodotto', 'with_front' => true, ),
    		"show_admin_column" => true,
    		"show_in_rest" => false,
    		"rest_base" => "cat_prodotto",
    		"rest_controller_class" => "WP_REST_Terms_Controller",
    		"show_in_quick_edit" => false,
    		);
    	register_taxonomy( "cat_prodotto", array( "prodotto" ), $args );
    }
    add_action( 'init', 'cptui_register_my_taxes_cat_prodotto' );
    

    If you need more info just ask.

    @paperplanenan Thanks. We will investigate.

    If I choose to clean orphaned relationship data, my WP links are dropped.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Clean orphaned relationship data issue’ is closed to new replies.