WordPress.org

Ready to get started?Download WordPress

Forums

The Events Calendar
[resolved] tribe_meta_event_cats label arg bug (9 posts)

  1. mrwweb
    Member
    Posted 2 years ago #

    I'm using tribe_meta_event_cats in a custom loop via WP_Query.

    When I use any of the following:
    tribe_meta_event_cats( null );
    tribe_meta_event_cats( '' );
    tribe_meta_event_cats( false );

    I get the following output:

    <dt>Category:</dt>
    <dd><a rel="tag" href="[cat-href]">[cat name]</a></dd>

    When I put a string in for the first argument like
    tribe_meta_event_cats( 'This is the category:' );

    I get the expected output:

    <dt>This is the category:</dt>
    <dd><a rel="tag" href="[cat-href]">[cat name]</a></dd>

    I expected that where it says "Category" in the first HTML output, it would instead be blank using at least one of ''/null/false as the first argument.

    ------------

    And a brief opinion about the function in general. It appears that it only outputs a definition term/defintion pairing and so should always be wrapped in <dl>. If the function is just using the_tags(), I wish they would leave the before and after arguments exposed. Then if a definition list is desired, it's available but not required. If it's really parallel to the_category or the_tags, I would expect the output to be similar as well.

    http://wordpress.org/extend/plugins/the-events-calendar/

  2. roblagatta
    Modern Tribe Support
    Plugin Author

    Posted 2 years ago #

    You raise a good point here, mrwweb. I'm running this by one of our devs now so they can review what you're suggesting (it's a bit outside my area of expertise). Assuming there aren't any problems with it, we should be able to tweak the function as needed in a future release.

  3. mrwweb
    Member
    Posted 2 years ago #

    Glad to hear it, Rob.

    If you do stick with the <dt> and <dd> markup, I'd at least include the wrapping <dl> element in the function output.

  4. Joey Kudish
    Member
    Posted 2 years ago #

    Hi mrwweb,

    Thanks for the feedback that you provided here. Let me address your two points:

    I expected that where it says "Category" in the first HTML output, it would instead be blank using at least one of ''/null/false as the first argument.

    I agree with you, your suggestion is completely logical. We've marked that as an enhancement for an upcoming release and will get it done.

    And a brief opinion about the function in general. It appears that it only outputs a definition term/defintion pairing and so should always be wrapped in <dl>. If the function is just using the_tags(), I wish they would leave the before and after arguments exposed. Then if a definition list is desired, it's available but not required. If it's really parallel to the_category or the_tags, I would expect the output to be similar as well.

    You're right and wrong here. The whole column is wrapped in a <dl> tag with each "label" inside a <dt> and each item inside a <dd> as per this screenshot: http://f.jkudi.sh/DI9A.

    That being said, your suggestion to leave in the before and after arguments exposed, is a good suggestion. I've added this to the enhancement for the next release, and we'll make sure to put in a filter in there so that you can overwrite the arguments of the function.

    Hope this helps, and thanks for the feedback again. Anything else, let us know.

    Cheers,
    joey

  5. mrwweb
    Member
    Posted 2 years ago #

    Joey,

    I know see why you left it off. That makes sense for the context you wrote the function for, but since you include that function in your documentation, I used it in other contexts.

    It's seeming more and more like I should've just use the_tags() myself, but what would have helped me is if you just updated the documentation on http://tri.be/support/documentation/the-events-calendar-template-tags-general-functions/#functiontribe_meta_event_cats.

    Rather than "Returns, Void," something like "returns definition list items, output should be wrapped in <dl> tags" would've been great.

    Thanks for the response!
    -Mark

  6. Joey Kudish
    Member
    Posted 2 years ago #

    Hi Mark,

    That's a great point, I'll get one of our support staff to update the documentation. Thanks! :)

    Cheers
    Joey

  7. jbravard
    Member
    Posted 1 year ago #

    Sorry to drag an old post back up, but has this issue been addressed?

  8. roblagatta
    Modern Tribe Support
    Plugin Author

    Posted 1 year ago #

    Hey jbravard. Thanks for the note; which aspect, specifically? Updating the documentation or something specific changed in the code?

    Joey unfortunately isn't with us anymore, but I can definitely look into this in his absence and try to get it resolved for you. Cheers!

  9. roblagatta
    Modern Tribe Support
    Plugin Author

    Posted 1 year ago #

    Hey jbravard, I'm going to mark this RESOLVED under the assumption you got this sorted (as I haven't heard anything in 2 months). Please let me know if you disagree.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic