• Resolved laurab33

    (@laurab33)


    Hi! I’m trying to implement tags but I’m getting conflicting information and none of it works.

    At the bottom of the FAQ (https://docs.codeat.co/glossary/faq/), the following snippet is provided to add tags to glossary terms:

    add_action( 'plugins_loaded', function() {
       register_taxonomy_for_object_type( 'post_tag', 'glossary' );
    }, 99999);

    However, a post from 3 years ago (https://wordpress.org/support/topic/tag-in-terms/) recommends this snippet in the functions.php file to support tags:

    add_action( 'init', 'glossary_register_taxonomy_for_object_type' );
    function glossary_register_taxonomy_for_object_type() {
    register_taxonomy_for_object_type( 'post_tag', 'glossary' );
    }

    I’ve tried both and neither work. I’ve tried clearing my caches as well. Please advise & many thanks.

Viewing 8 replies - 1 through 8 (of 8 total)
  • We did some changes and I forgot to update our doc, the new code is:

    
    add_action( 'plugins_loaded', function () {
    	add_filter( 'glossary_cpt_tags', '__return_true' );
    } );
    
    Thread Starter laurab33

    (@laurab33)

    Hi Daniele! Thank you so much for the quick response. Unfortunately, I’m still not seeing glossary term tag options in my admin area. Maybe I’m implementing the snippet wrong. I’m pasting it into: My site > public_html > wp-content > plugins > glossary-by-codeat > functions > functions.php, line 22.

    Does it belong in the main functions.php file? My site > public_html > wp-includes > functions.php?

    Many thanks for your help.

    Plugin Author Daniele Scasciafratte

    (@mte90)

    No this isn’t the right path, you have to put that code in the functions.php of your theme.

    Thread Starter laurab33

    (@laurab33)

    Hi Daniele! Thanks again for the timely and helpful support. However, this still didn’t work for me. I look forward to a future update that includes this feature; I’d happily pay for it.

    Hi, this is very strange I will investigate as it is something that should works already.

    I am doing a new release that should include the bugfix.

    EDIT: didn’t worked, I am investigating

    The right snippet is:

    add_action( 'init', function () {
    	add_filter( 'glossary_cpt_tags', '__return_true' );
    }, 5 );

    I will update the official documentation right now.

    Sorry for the various issues.

    Thread Starter laurab33

    (@laurab33)

    Amazing! That’s working perfectly now. No worries at all about how we got here, I’m just excited we did. Once I launch my site, this is the glossary plugin I’ll pay for. 12/10 support.

    For folks who might find this in the future, I pasted the provided snippet to: MyExampleSite.com > public.html > wp-content > themes > MyExampleTheme > functions.php

Viewing 8 replies - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.