Support » Plugin: Genesis Author Pro » How to modify labels of this plugin?

  • Hello,
    I’m curious if there is a way to get the labels of this plugin changed? I have tried a few things in functions.php but it doesn’t seem to be working out.
    This also didn’t work for me: https://wpsmith.net/2013/use-registered_post_type-hook-to-modify-post-type-registration/

    In short, I’m trying to get the wording of “Library” changed to a different label, more especially in the back end editing area of WP dashboard.

    I’d rather not have to move a bunch of plugin files to the child theme, to preserve the plugin for regular updates. So I was hoping for a code snippet of some sort that I could modify in functions.php, if that’s feasible?

    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi there!

    You can use this filter:

    add_filter( ‘genesis_author_pro_cpt_labels’, ‘change_author_pro_cpt_name’ );
    function change_author_pro_cpt_name ( $labels ) {
    $labels[‘menu_name’] = ‘Add new name here’;
    return $labels;
    };

    You can then change menu_name to whatever you wish and you can add more to the filter, if needed.

    You can edit the filter using the applicable label from here: https://github.com/studiopress/Genesis-Author-Pro/blob/develop/classes/class.Genesis_Author_Pro_CPT.php#L108-L121

    Enjoy your day!

    Hi corinneolson, thank you so much for your reply.

    I ended up here because I’ve got the same request. However – and please forgive my ignorance – I’m not able to follow your instructions. How and where exactly should I add that filter you mention? Directly to the theme editor? In addition, can this be done in such a way it won’t revert back to the old ‘Library’ label once there’s a theme update?

    Many thanks in advance

    Hi there,

    You would add the code to your child themes function.php file.

    Keep in mind, we highly recommend using FTP or your host’s file manager to edit PHP files instead of the WordPress editor. A typo or missing comma could cause your site to show the “white screen of death” and could kick you out of your dashboard completely. If that happens, you’ll need to use FTP or a file manager to remove the code and regain access to your site. So if you are already using FTP or the file manager to make those changes, you’ll be able to remove them quickly if needed.

    We have a guide on safely editing child theme files using FTP access if you have a myStudioPress account at:https://my.studiopress.com/documentation/ftp-guide/

    If you need further assistance with customizing your theme’s code, we would encourage you to post your question in our community forum where other users and developers can provide suggestions on how to proceed. http://studiopress.com/forums/

    You could also check out the other community resources such as the Slack channel ( http://genesis.community/slack ) and Facebook group ( https://www.facebook.com/groups/genesiswp/ ).

    Thank you and enjoy the rest of your day!

    Thank you for this. However, it did nothing for me 🙂

    This is what I used, and zero changes took place in my back end:

    //Change Library label for winners 
    add_filter( ‘genesis_author_pro_cpt_labels’, ‘change_author_pro_cpt_name’ );
    function change_author_pro_cpt_name ( $labels ) {
    $labels[‘menu_name’] = ‘Winners’;
    return $labels;
    };

    Context: we’re using this plugin to display winners of a literature prize. Hence, the name of “Winners.”

    Even if it said, “Books” I think that would still be more clear than “Library.” Because for a client using the back end of WP, “Library” can refer to multiple things in that context, like a Media Library, for instance. But that’s just me… just a suggestion.

    djmathu

    (@djmathu)

    Hi Joyce, I just borrowed the answer you received and noticed that all the apostrophes/quote marks needed re-keying manually – they’re currently curly. Once you swap them the label works fine. Matt:

    // Replace library
    add_filter( ‘genesis_author_pro_cpt_labels’, ‘change_author_pro_cpt_name’ );
    function change_author_pro_cpt_name ( $labels ) {
    $labels[‘menu_name’] = ‘Magazines’;
    return $labels;
    };

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