• Resolved aaronmagnus

    (@aaronmagnus)


    Hi,

    I’ve noticed that I can import meta title’s and description into pages, products etc. with no issues – the custom field to choose starts with “genesis”.

    When it comes to product categories however, I can’t. It’s like WP All Import cannot detect the field in the same way. Is the information stored for product categories in the same way it is for pages, products?

    Thanks

Viewing 1 replies (of 1 total)
  • Plugin Author Sybre Waaijer

    (@cybr)

    Hi @aaronmagnus,

    Term data is stored via the new WordPress meta API since version 2.7 of TSF. With that, we are using different keys from Genesis.

    Only when Genesis is active the term meta from Genesis will be read, as the compatibility file isn’t loaded otherwise.

    Some technical information:
    Constant THE_SEO_FRAMEWORK_TERM_OPTIONS is used to as a key to store the term metadata.
    We store this data NoSQL-like. This means that the data is parsed after it’s fetched for improved performance, extensibility, and reliability.

    A DIY implementation:
    The following snippet is taken (and adjusted) from the compatibility file.

    Add the following snippet to your theme’s functions.php file and the imported data should be used as pre-set defaults on terms you haven’t updated/saved with TSF active.

    TSF adds a flag to each term to determine which term meta version to use. Once TSF sets the flag, the snippet below won’t do anything for the term. Then, TSF uses its own version.

    add_filter( 'the_seo_framework_get_term_meta', 'my_genesis_get_term_meta', 10, 2 );
    /**
     * Returns Genesis term meta.
     *
     * @param array $data The current term meta.
     * @param int $term_id The current term ID.
     * @return array The Genesis Term meta.
     */
    function my_genesis_get_term_meta( $data = array(), $term_id = 0 ) {
    	$data['doctitle'] = get_term_meta( $term_id, 'doctitle', true );
    	$data['description'] = get_term_meta( $term_id, 'description', true );
    	$data['noindex'] = get_term_meta( $term_id, 'noindex', true );
    	$data['nofollow'] = get_term_meta( $term_id, 'nofollow', true );
    	$data['noarchive'] = get_term_meta( $term_id, 'noarchive', true );
    	return $data;
    }
Viewing 1 replies (of 1 total)
  • The topic ‘Product Categories and WP All Import’ is closed to new replies.