Robert

Forum Replies Created

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • Robert
    Participant

    src/Tribe/Legacy_Provider_Support.php

    	public function on_init() {
    		$this->find_active_legacy_modules();
    
    		if ( ! count( $this->active_legacy_modules ) ) {
    			return;
    		}
    
    		add_action( 'tribe_events_tickets_metabox_advanced', array( $this, 'add_fields' ), 5 );
    		add_filter( 'tribe_events_tickets_ajax_ticket_edit', array( $this, 'add_fields_ajax' ) );
    	}

    In this snipet you are doing the same as me in my custom code.

    Robert
    Participant

    My goal is to customize your plugin a little. I’m adding location and date to the tickets and I’m selling a CPT Course. There is one course which has multiple tickets. Each ticket has location and date and you can buy the correct one provided by a form.

    Also I think it’s not my custom code because my custom code is nearly a copy of your Legacy Support part. Same hooks and code. So if my code is buggy your legacy support will behave the same way.

    Robert
    Participant

    My custom code adds extra fields to the add/edit ticket form. If I remove my code then the fields won’t be added. My problem is the fields are added multiple time when you click on the Edit button for a ticket. (on cpt edit page)

    If you click twice my fields will be added 3 times. If you click 5 times my fields will be added 6 times.
    And from the 5 same field only one filled with values which is coming from tribe_events_tickets_ajax_ticket_edit hook. The other fields might be added by tribe_events_tickets_metabox_advanced hook.

    And the problem appears only if I use the 4.1 version.

    Robert
    Participant

    Of course I’m not asking you to check my code because it is working perfectly with early versions. So I just showing you how to replicate the problem. I’m using the same filters like you use in your plugin for Legacy support so if my code is bad your code will be buggy as well.

    in reply to: Capability problems on CPT Tickets #1087645
    Robert
    Participant

    Hi,

    It’s done.

    Robert

    in reply to: List view and DESC order on past events #1053162
    Robert
    Participant

    Thank you. This is what I was looking for.

    in reply to: Past Events via Posts 2 Post plugin #1012170
    Robert
    Participant

    Hm, post__not_in works fine. But it still requires "eventDisplay" => "custom", argument in the query to work like a normal WP_Query. So I keep up that not P2P plugin uses wordpress functions in a bad way, but you should change the logic with this “eventDisplay” argument. It should be normal WP_Query without this argument, and you should use eventDisplay => "tribe" to make your custom queries working.

    Thanks!

    in reply to: Past Events via Posts 2 Post plugin #1011798
    Robert
    Participant

    This is not only a P2P problem. The tribe_get_events(array("exclude" => array($promoted_event))) should also work. But for some reason its not excluding the given event. So i guess there should be some problem in the plugin custom query modifications.

    in reply to: Past Events via Posts 2 Post plugin #1010484
    Robert
    Participant

    Anyone?

    in reply to: Past Events via Posts 2 Post plugin #1010061
    Robert
    Participant

    Are you sure you not crashing something with the query?

    Just because i can see some strange behavior:

        $args = array (
          "exclude" => array($promoted_event),
          "posts_per_page" => 4,
          "post_type" => "tribe_events",
          "orderby" => "event_date",
          "order" => "ASC"
        );

    $events = get_posts( $args );
    This gives me back the good result with 4 events past and future promoted excluded.

    $events = tribe_get_events( $args );
    This gives me back bad result because the excluded event is there.

    $events = new WP_Query( $args );
    This gives me back only the future events including the excluded event.

    Or if I add eventDisplay => 'custom' to the query args it gives back the same result like tribe_get_events( $args );

    So there should be something wrong no?

Viewing 10 posts - 1 through 10 (of 10 total)