Forum Replies Created

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter thomastrethan

    (@thomastrethan)

    Github issue created: #26 – thx Tom

    Thread Starter thomastrethan

    (@thomastrethan)

    confirmed, I currently have the following hack running pretty fine:

    in events-manager.php in function eme_replace_placeholders():


    if (has_filter('eme_events_format_prefilter')) $format=apply_filters('eme_events_format_prefilter',$format,$event);

    and in my theme’s function.php:


    function my_eme_events_format_prefilter($html, $event) {
    ...
    }

    add_filter('eme_events_format_prefilter', 'my_eme_events_format_prefilter', 10, 2);

    Thread Starter thomastrethan

    (@thomastrethan)

    works pretty good, but one thing: it’ll be great to pass the event to the filter:

    if (has_filter(’eme_events_format_prefilter’)) $format=apply_filters(’eme_events_format_prefilter’,$format,$event);

    Thread Starter thomastrethan

    (@thomastrethan)

    correct, that would do. but how to get exactly there: after eme puts the templates together and before replacing the placeholders? does an appropriate filter exist already?

    Thread Starter thomastrethan

    (@thomastrethan)

    unfortunately not, because results are handled by another plugin; I’d need to hook a separate function to eme shortcodes before they get replaced.

    maybe an idea using conditional tags would be to check the date and show the shortcode #ATTENDEES for future events and use another (new/unused) marker (eg #RESULTS) for past events. later hook to the final text using wp filters and replace this marker. This would work, if there always would be results, but in case where no results exist I still would like to display the list of attendees.

    Thread Starter thomastrethan

    (@thomastrethan)

    works pretty well, good job, thx!

    Thread Starter thomastrethan

    (@thomastrethan)

    great! thumbs up

    Thread Starter thomastrethan

    (@thomastrethan)

    did some more analyzing and made another mistake: I don’t use eme_permalink_convert() for URLs (just for IDs), for URLs I use eme_event_category_url() (eme built in function in eme_functions.php), which then uses eme_permalink_convert().

    So this is eme core function, creating category URLs this way. Therefore I still think eme_get_category_ids() is incorrect because it is not respecting this.

    eme_permalink_convert() uses sanitize_title_with_dashes() and remove_accents() and trailingslashit(), which should all be considered when querying for category ids, which is tricky when trying to solve in sql. The only correct solution would be to query all categories, iterate and eme_permalink_convert() them and then compare them, but which is not very performant. Another idea would be to store a real slug for categories…

    Thread Starter thomastrethan

    (@thomastrethan)

    Ok, probably was too fast, did a bit of analyzing, here’s the whole story:

    1) created an event category containing a space, eg “Test Cat”
    2) have a custom widget, which creates a menu structure depending on which page you’re currently are, in case of events it reads all event categories and uses eme_permalink_convert(category_name) to create the links, thus getting …/cat/test-cat/
    3) now we’re there at what I wrote in my first post, eme_get_category_ids() doesn’t convert the space in the category name like eme_permalink_convert

    Maybe the way of using eme_permalink_convert() for categories is wrong in this place? But I still think that there’s an inconsistency here… And you’re right, any other special charaters would cause troubles too. However, the other solution is to adapt my custom widget, so no modification in eme is necessary if I’m wrong using eme_permalink_convert(). Both is ok with me.

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