• For whatever reason after updating the box for adding tags to images disappeared. Any way to bring those back?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator bcworkz

    (@bcworkz)

    Sorry for the slow reply. I think a code line associating tags with attachments got wiped out by the upgrade.
    register_taxonomy_for_object_type( 'post_tag', 'attachment' );
    It should be called from a callback hooked to “init” action. The code probably disappeared because it was not put in a safe place. The only safe places for custom code is your own site specific plugin or a child theme.

    Apologies if none of that makes any sense to you. I can explain further, but didn’t want to waste time explaining if you already understand with just that.

    Thread Starter anthonyd46

    (@anthonyd46)

    Where would I go into to change the code to above?

    Moderator bcworkz

    (@bcworkz)

    There’s more to the required code than what I first posted, you need the callback code for the “init” action. Like this:

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

    To keep this code from disappearing again, it should go in functions.php of a child theme or the main plugin file of your own custom plugin. Neither one is that difficult to create. A plugin is slightly easier. Naturally you must activate which ever entity you create. Any other custom code you may need in the future can go into this same entity.

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

The topic ‘Image tags disappeared’ is closed to new replies.