Site logo

[Resolved] Working together with a Glossary plugin, is it possible ?

Home Forums Support [Resolved] Working together with a Glossary plugin, is it possible ?

Home Forums Support Working together with a Glossary plugin, is it possible ?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1760061
    Jimi

    Hi,

    Thanks for helping me, my site is looking great now, and is getting the best scores on Google Pagespeed, and GT Metrix 🙂

    One more question though. I don’t get the possibility to edit using Generatepress, or GenerateBlocks, on the pages that my Glossary /wiki plugin makes.

    You can see one of them here:https://onlinemarketingbureauet.dk/ordbog/seo/

    I asked the maker of this plugin and he told me this:

    “Hi there,

    Thanks for purchasing my plugin. I would be happy to help you.

    You can add Gutenberg / Block Editor support to my custom post type easily by adding following script to your current theme’s functions.php file”

    function wpg_post_editor ( $args ) {
    $args[‘show_in_rest’] = true;
    return $args;
    }
    add_filter ( ‘wpg_post_type_glossary_args’, ‘wpg_post_editor’ );

    Is it true what he says ? And how do I add it in the functions.php ? Inside my Cpanel ?

    Thanks,
    Jimi

    #1760696
    David
    Staff
    Customer Support

    Hi there,

    that function registers Rest support for plugins template – which is required for using the Block Editor… so if the Author says that will work then we have no reason to say it would not.

    The code is PHP – this article explains 2 methods of adding it your site:

    https://docs.generatepress.com/article/adding-php/

    #1761496
    Jimi

    It worked 🙂

    And here is an even better code for that purpose:

    function wpg_post_editor ( $args ) {
    $args[‘show_in_rest’] = true; // for Gutenberg Editor
    return $args;
    }
    add_filter ( ‘wpg_post_type_glossary_args’, ‘wpg_post_editor’ );

    add_filter( ‘register_taxonomy_args’, ‘my_taxonomy_args’, 10, 2 );

    function my_taxonomy_args( $args, $taxonomy_name ) {

    if ( ‘glossary_cat’ === $taxonomy_name ) {
    $args[‘show_in_rest’] = true;
    }

    if ( ‘glossary_tag’ === $taxonomy_name ) {
    $args[‘show_in_rest’] = true;
    }

    return $args;
    }

    #1761645
    David
    Staff
    Customer Support

    Glad to hear that – and thanks for sharing your final code!

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.