Forum Replies Created
-
AuthorPosts
-
Phil
ParticipantVery happy. Thanks. We launched the site.
Phil
ParticipantI suppose I could, but I didn’t write the code. So for me to do it would be taking credit for having someone else do my homework. This is why I suggested the tri.be guys do it. 🙂
Phil
ParticipantOnly issue I still so, though not a huge deal, is that if you know the direct path to the event, you can still view it if you are not logged in.
Is this something that Google could find and index?Phil
Participantyeah! It works. I think this is great. Thanks so much guys for your help. I think you should make this a bona fide add on plugin or perhaps part of the core functionality.
Phil
ParticipantTrying to wrap this up so any suggestions are appreciated. 🙂
Phil
ParticipantSo I changed it out and the event and I don’t get the error anymore. The problem is, the event doesn’t appear on the events calendar if you are logged in or not, and it is visible on the event page itself whether you are logged in or not. http://fredpres.allsaintsmedia.com/event/test-event-2
It needs to work that the event should be invisible on both the calendar and the specific event page if you are not logged in and visible on both if you are logged in.Sorry to be a pain 🙂 Ideas?
Ideas?Phil
ParticipantSorry, didn’t see the reply
Phil
ParticipantAny luck Daniel. I sent admin info yesterday.
Phil
Participanthere is a link to the event with the warning
http://fredpres.allsaintsmedia.com/event/test-event-2Phil
ParticipantI changed your hidden slug to private because that is the slug for my Private category. When I upload the plugin, then create an event and use the Private event category, when I update or publish the event I get that warning and then the event doesn’t appear on the calendar, even if I am logged in. It does however show in the backend list of events.
here is the link to the site being developed
http://fredpres.allsaintsmedia.com/eventsPhil
ParticipantHere you go
http://pastebin.com/p0Vc9bdFPhil
ParticipantHere is my plugin code…
https://github.com/skstarkiller/code/wiki/Private-Event-CodePhil
ParticipantHere is my code…
TribeEvents::TAXONOMY,
‘field’ => ‘slug’,
‘terms’ => array( ‘private’ ),
‘operator’ => ‘NOT IN’ );/*
* The we merge our new tax_query with the
* original one, so we don’t loose any category
* filter we may need to use in the Front End
*/$taxquery = array_merge( $taxquery, $query->tax_query->queries );
/*
* And at the end we add the new resulting tax_query
* to the main events query, _before_ said query
* so we don’t need to traverse the whole results
* and delete the events we don’t want to show.
*
* This is the equivalent of using pre_get_posts
* to filter things out in the standard WordPress
* way
*
*/$query->set( ‘tax_query’, array( $taxquery ) );
return $query;
}Phil
ParticipantOK, I think I typed up the plugin properly. When I uploaded it to my site and try it out I get the following warning and the event doen’t show on the calendar, even if I am logged in….
Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home/allsaintsmedia/fred_pres/wp-content/plugins/Events_Calendar-Private_event.php_/Events_Calendar-Private_event.php on line 35
Phil
ParticipantWasn’t sure if your snippet did both or if it needed to be combined with what Barry originally posted.
-
AuthorPosts
