Will

Forum Replies Created

Viewing 10 posts - 31 through 40 (of 40 total)
  • Author
    Posts
  • Will
    Participant

    Got it Barry, yeah sorry. Late night/early morning posting tends to get fuzzy.
    I’ll try to break it down again:

    First: the future problem I’m dealing with: I’m working on a dev site, on a dev server. I will be migrating the theme and the actual content into an existing WP multisite. My experience is that when I do that, all the Post IDs change (because in a lot of cases the IDs are already taken by existing posts on production server). So I can’t hard code post IDs into functions or queries. I need to dynamically return them.

    Second: I need to filter out some posts on a custom post type archive page (NOT a Tribe Event) and not show posts that have a specific Tribe_Organizer attached to them. I attached the Tribe_Organizer using an Advanced Custom Field. That archive page, then, does not exist in the context of an Event Calendar page. It is its own custom post type archive page.
    (And, I already have that query working, as long as I hard-code the ID of the organizer. I do NOT need help with that.)

    The problem comes down to when I migrate the site over. This page will immediately break and display the posts associated with that one specific Tribe Organizer, because the post IDs will all change as soon as I migrate, and I have to hard code them right now.

    So, I need a method to return the Organizer’s ID by slug, or by name, on a page that is outside the context of the calendar. USUALLY, I would just do this using built in WP functions like get_page_by_path() or get_page_by_title(), and loop through the object and get the ID. But neither of these methods work with the Tribe_Organizer, because I have no idea what the slug of the Organizer’s page is, or what the Title of the Organizer’s page is. There’s no archive page for the Organizer, no slug field, no post title.

    So, my question is, how do I get that info? Or, how do I just return a post ID of an Organizer? I can dig through the MySQL database, and I’m about to do that, as that probably would have been faster than writing this, BUT… it may help someone else later who’s trying to do the same thing.

    Does that make sense?

    Will
    Participant

    Nope, didn’t work even after creating an event and attaching an organizer to it. Though… there may be some crap code in here. I’ve been up all night, I should rest and look at this when I’m fresh.

    Will
    Participant

    tribe_get_organizer() would require the ID, which is what I need to return.

    The code on pastebin… it’s close. I used my get_ID_by_slug() function to grab the custom post that I attached the Organizer to via an ACF, but that won’t work, as it’s not using Tribe’s method of attaching an Organizer, because that page isn’t a Tribe event, it’s a custom post. I can continue whittling away, maybe eventually when I have an actual Tribe event created that uses that Organizer, I can get that event’s slug, then use your code to return the ID.

    What’s weird is that when I set up an ACF Post Object, the Organizer shows up as a post object: Tribe_Organizer. Is it not? If it is, shouldn’t there be a slug or “post name” for it?

    Will
    Participant

    Just deactivated all plugins, and switched theme to 2011, problem persists.

    in reply to: Filter Google Map Embed #29168
    Will
    Participant

    OK, here’s a better code post than my earlier one, my apologies for the rookie code post. Thanks Jonah for the link to Snippi–wish I could get their facebook login to work…

    1) Create a Google Map style here: http://gmaps-samples-v3.googlecode.com/svn/trunk/styledmaps/wizard/index.html

    2) Copy the JSON code provided.

    3) Open /wp-content/plugins/the-events-calendar/admin-views/event-map.php

    4) Add styles: method to var myOptions (starts line 16), and format it to match my example on snippi.com. (My example will change your google map to a black and white map).

    http://snippi.com/s/8i4j4qd

    in reply to: Filter Google Map Embed #29167
    Will
    Participant

    You know, with the amount of code I look at on github, you’d think I’d use it more. 😛

    in reply to: Filter Google Map Embed #29152
    Will
    Participant

    You’re welcome! I wish I could post code in a pre tag… shoot… maybe I can?

    testing 1 2 3 4

    in reply to: Filter Google Map Embed #29018
    Will
    Participant

    For anyone who is looking for a temporary fix, please note that this will get wiped out whenever the plugin gets updated, but it’s pretty easy to add back in:

    Open

    the-events-calendar/admin-views/event-map.php

    Line 19, add a comma after ROADMAP:

    mapTypeId: google.maps.MapTypeId.ROADMAP,

    Add:

    styles:

    And then paste the JSON from the wizard link in my post above into that area (it should be wrapped in [] brackets, for example:
    [
    {
    “elementType”: “geometry.fill”,
    “stylers”: [
    { “visibility”: “on” },
    { “color”: “#ffffff” }
    ]
    }
    ]

    in reply to: Filter Google Map Embed #29016
    Will
    Participant

    Hey folks,
    Here’s how I would handle this moving forward if I wanted to extend out the ability to customize a map in the calendar:
    In the Event control in the dashboard, I’d add a text area input after the google map width/height controls to allow people to add generated JSON from the style wizard on googlecode.com: http://gmaps-samples-v3.googlecode.com/svn/trunk/styledmaps/wizard/index.html and store it in a variable named something like $embedGoogleMapsStyle; or whatever makes sense to you guys, and add an apply_filters() to it:
    $embedGoogleMapsStyle = apply_filters( ‘tribe_google_maps_style’, ‘[contents of the text field, however that shows up here]’);

    In the-events-calendar/admin-views/event-map.php, after the mapTypeID entry (line 20), I’d add a comma, line break, then:
    styles: myStyles

    And before the var myOptions() on line 16, I’d add a new variable with the ability to apply filters, something like this (I’ve never actually written a filter before so please excuse the horrific syntax and erroneous code):

    var myStyles = {

    }

    in reply to: Filter Google Map Embed #29007
    Will
    Participant

    Thanks Jonah!! If I can come up with a decent javascript solution I’ll post it back here for future use.

Viewing 10 posts - 31 through 40 (of 40 total)