• Resolved khairianr

    (@khairianr)


    How to work with custom taxonomies?

    My term name and term slug do not import properly. The term meta imported successfully just not term name and slugs. See sample taxonomy. My custom taxonomy “mukims”. Can I get some help with this?

    After imported (screenshot) – https://ibb.co/6W7Vc2d
    In database (screenshot) – https://ibb.co/zVyN0PD
    Sample data to import- https://ibb.co/stBzScw

    just for tests below did not change term name and slug

    <?php
    add_filter('wp_insert_term_data', 'hookwp', 10, 3);
    
    function hookwp ($data, $taxonomy, $args) {
    	if ($taxonomy == 'mukims') {
    		$data['name']="My term Name";
    		$data['slug'] = "my-term-slug";
    	}
    	return $data;
    }
    ?>
Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter khairianr

    (@khairianr)

    tried custom slug here https://ibb.co/2SxJtZ3 but term slug still not applying

    Thread Starter khairianr

    (@khairianr)

    Learned i need to use this wp_all_import_use_wp_set_object_terms function to set taxonomy relationships. how do i use it when importing?

    function wpai_wp_all_import_use_wp_set_object_terms( $use_wp_set_object_terms, $tx_name ) {
        return true;
    }
    
    add_filter( 'wp_all_import_use_wp_set_object_terms', 'wpai_wp_all_import_use_wp_set_object_terms', 10, 2 );
    
    Plugin Author WP All Import

    (@wpallimport)

    Hi @khairianr,

    Since you’re using a “Taxonomies” import, you should be able to import the name and slug without any custom code. I tried replicating the issues shown in your screenshots, but everything is working for me.

    Since we can’t replicate it, we’ll need you to reproduce the issue on a sandbox site at https://www.wpallimport.com/debug/ and open a support request at https://www.wpallimport.com/support/ with the sandbox site details. Please include a link to this thread for reference as well.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to import taxonomy with term name and slug’ is closed to new replies.