Help with functions.php and labels

Home Forums Calendar Products Events Calendar PRO Help with functions.php and labels

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #57078
    Daniella
    Participant

    Can someone tell me how to take this code:
    /**
    * Customize your tribe event calendar meta displays with a variety of methods.
    * Place this in your functions.php file within your theme
    */
    add_action( ‘wp_head’, ‘custom_event_meta’ );
    function custom_event_meta(){

    // customize just the label
    tribe_set_meta_label( ‘tribe_event_tag’, __( ‘Tags:’ ) );

    // reregister meta (this will merge settings into the original registered settings)
    tribe_register_meta( ‘tribe_event_website’, array(
    ‘classes’ => array(‘meta_before’=> array(‘url’)),
    ‘label’ => __( ‘More Info:’ ),
    ‘register_overwrite’ => true, // set to TRUE in order to overwrite the core registration
    ‘filter_callback’ => array(‘Tribe_Register_Meta’, ‘event_website’)
    ) );

    }

    and change:
    1. event categories to just ‘categories’
    2. the ‘other’ title in the meta box to say ‘additional info’?
    Thank you!

    #57434
    Barry
    Member

    Hi Daniella,

    Sorry for the delay first of all – we’re under more demand than usual so we aren’t currently able to reply as quickly as we normally aim for.

    I have to admit that I couldn’t see a quick way of adapting that code to change the category label. Using just the tribe_set_meta_label() function from within the wp_head action ought to work just as it does for the tag label in the example you provided, but unfortunately does not seem to.

    What you can try as a temporary workaround though is this snippet. It will change “Event Category” to “Category” and should do the same for the plural form, too.

    For the both this and for the second part of your question I’m going to try and check in with a member of the dev team and see if they can provide an example of the correct way to handle this, so bear with me and I’ll update you again as soon as I can.

    Thanks!

    #57546
    Daniella
    Participant

    That would be great! Thank you for helping.

    #57893
    Timothy Wood
    Participant

    Hi Daniella, first there was a bug in our code for the meta title overrides for categories, I have created the override for the categories so once the fix comes out but there is also a pre 3.0.3 release fix (see the comments) that will do what you are looking for as well: https://gist.github.com/codearachnid/6118533

    In order to change the meta group label you need to specify meta_group for the tribe_set_meta_label tag – use something like this:

    tribe_set_meta_label( ‘tribe_event_group_custom_meta’, ‘New Custom Meta Label’, ‘meta_group’ );

    #57964
    Barry
    Member

    Great, thanks Tim. Daniella: does that get you closer?

    #58023
    Daniella
    Participant

    This reply is private.

    #58110
    Barry
    Member

    So just to be sure we’re on the same page here, can I first of all confirm if you added the code Tim shared in his Gist, and were you successfully able to change the category label?

    #58124
    Daniella
    Participant

    This reply is private.

    #58125
    Barry
    Member

    OK, that’s great news – in that case, since it’s sounding like we’re all good here, I will go ahead and close this thread. As usual if anything else crops up please do create a new forum thread and one of the team will be happy to help.

    #58862
    Barry
    Member

    Hi Daniella, this probably won’t affect you based on your last comment – but for the benefit of anyone else using Tim’s code please do take note of the comment in the second part of the snippet:

    “If you have version prior to 3.0.3 then use this for setting the custom label for event display”

    Since our maintenance release will arrive today/imminently anyone using that code should probably remove it (the code following the above comment) as soon as they have updated to 3.0.3 or greater.

    Thanks!

    #980036
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘Help with functions.php and labels’ is closed to new replies.