David

Forum Replies Created

Viewing 15 posts - 1 through 15 (of 29 total)
  • Author
    Posts
  • David
    Participant

    Thanks for the fix – but in all honesty, 4 months to put back a feature that was broken by a previous release and worked just fine prior to that is insane – this resulted in me having to buy another plugin to associate posts together as I could not rely on you to fix it – it turns out, my judgement was correct as 4 months is far too long to have to wait

    in reply to: Using add_filter( 'tribe_get_cost', … #1586019
    David
    Participant

    Hi Sky, thanks for taking a look, here’s my code …

    add_filter( ‘tribe_get_cost’, ‘cost_show_details’, 10, 2 );

    function cost_show_details( $cost, $post_id ) {

    $special_offer_price = get_post_meta($post_id, ‘wpcf-special-offer-price’, true);
    $special_offer_date = date(‘d M Y’, get_post_meta($post_id, ‘wpcf-special-offer-applicable-to-date’, true));
    $currency = tribe_get_event_meta( $post_id, ‘_EventCurrencySymbol’, true );

    if ($special_offer_price > 0 && ($cost > $special_offer_price)) {
    $cost = ‘<span style=”display: inline-block; text-decoration: line-through” class=”original-cost”>’ . $cost . ‘</span>  ‘ . $currency . $special_offer_price;

    if ($atts[‘participant_display_style’] == ‘adjacent’) {
    $cost .= ‘ * per participant’;
    }

    if ($atts[‘special_offer_display_style’] == ‘paragraph’) {
    $special_offer_note = ‘ <p style=”margin-top: -2em;” class=”header-deposit hide-for-medium hide-for-small”>Special offer pricing available until ‘ . $special_offer_date . ‘, other conditions may apply.‘;
    }
    else if ($atts[‘special_offer_display_style’] == ‘inline’) {
    $special_offer_note = ‘<span style=”font-weight: normal !important;”>, (special offer pricing available until ‘ . $special_offer_date . ‘, other conditions may apply)</span>’;
    }

    $cost .= $special_offer_note;
    }
    else {
    if ($atts[‘participant_display_style’] == ‘adjacent’) {
    $cost .= ‘ per participant’;
    }

    }

    return $cost;
    }

    And in the meta information for the event I see the html escaped

    in reply to: Abstract post types ordering #1520495
    David
    Participant

    If as you said earlier – a fix is a month away – that will be it broken for 4 – 6 weeks – that is appalling and makes my decision to see an alternative robust way of linking posts together the correct one

    in reply to: Abstract post types ordering #1519831
    David
    Participant

    Cliff – several observations – a breaking change with no real documentation that you introduced is dreadful, it throws a spanner in the works of a site entirely, the lead time between your replies for a breaking change of five days is pretty awful, your documentation is out of date if you introduce a breaking change such as this – if the rest of the team are not aware of a breaking change – it is a crap change – you can post videos and justify it all you like, the change was breaking, the documentation was non-existent and your support was terrible! All you achieved was me going and purchasing another plugin and I will not be renewing my TEC Pro licence – I hope that was your aim because if not, you really screwed up!

    • This reply was modified 6 years ago by David.
    in reply to: Abstract post types ordering #1517334
    David
    Participant

    Cliff – stop – you look silly – you have not tried to replicate the issue – Victor did yesterday, he came up with the same result as me – communication is key, go and speak to the rest of the team

    https://theeventscalendar.com/support/forums/topic/tribe_get_linked_posts_by_post_type-now-returns-empty-array/

    He concluded … Unfortunately, I’ve just tried on my end and I can confirm the tribe_get_linked_posts_by_post_type() no longer works in the latest version of The Events Calendar.

    I have logged a bug report for this so it can be addressed in one of our next maintenance releases of our plugins.

    Then I suggest you go and speak to LaToya – who was kind enough to respond to me overnight as well – ask her for the feedback that I gave about you

    When you have done all that consider what I told LaToya … ‘as a result of Cliffs attitude – I bought the Post Connector plugin today – will be using that to achieve what I need to do – and when my pro licence for TEC is up for renewal, I have no need for any of the advanced features – and your support is not worth paying for – I will likely not be renewing’

    You and your attitude has wrecked any faith I had in TEC – Victor looked into the issue, replicated it and confirmed it as being broken – why did this pass you by?

    David
    Participant

    I still need assistance

    in reply to: Calling tribe_get_linked_posts_by_post_type #1515782
    David
    Participant

    I still need assistance

    in reply to: Abstract post types ordering #1515004
    David
    Participant

    Even $linked_posts = tribe_get_linked_posts($post_id); shows empty arrays for the four populated linked post types

    Array
    (
    [tribe_venue] => Array
    (
    )

    [tribe_organizer] => Array
    (
    [0] => WP_Post Object
    (
    [ID] => 60
    [post_author] => 2
    [post_date] => 2013-07-01 10:51:22
    [post_date_gmt] => 2013-07-01 09:51:22
    [post_content] => David Miles is lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
    [post_title] => David Miles
    [post_excerpt] =>
    [post_status] => publish
    [comment_status] => closed
    [ping_status] => closed
    [post_password] =>
    [post_name] => david
    [to_ping] =>
    [pinged] =>
    [post_modified] => 2018-04-15 08:22:14
    [post_modified_gmt] => 2018-04-15 07:22:14
    [post_content_filtered] =>
    [post_parent] => 0
    [guid] => http://beta.natureslens.co.uk/?tribe_organizer=natures-lens-2
    [menu_order] => 1
    [post_type] => tribe_organizer
    [post_mime_type] =>
    [comment_count] => 0
    [filter] => raw
    )

    [1] => WP_Post Object
    (
    [ID] => 13740
    [post_author] => 2
    [post_date] => 2017-09-30 16:02:43
    [post_date_gmt] => 2017-09-30 15:02:43
    [post_content] =>
    [post_title] => Pui Hang Miles
    [post_excerpt] =>
    [post_status] => publish
    [comment_status] => closed
    [ping_status] => closed
    [post_password] =>
    [post_name] => pui-hang
    [to_ping] =>
    [pinged] =>
    [post_modified] => 2018-04-15 08:21:58
    [post_modified_gmt] => 2018-04-15 07:21:58
    [post_content_filtered] =>
    [post_parent] => 0
    [guid] => http://beta.natureslens.co.uk/?post_type=tribe_organizer&p=13740
    [menu_order] => 0
    [post_type] => tribe_organizer
    [post_mime_type] =>
    [comment_count] => 0
    [filter] => raw
    )

    )

    [event-highlight] => Array
    (
    )

    [included-element] => Array
    (
    )

    [excluded-element] => Array
    (
    )

    [testimonial-snippet] => Array
    (
    )

    )

    What is interesting is that your venue post-type array is empty as well – even though there is a venue associated with this event

    Your function for registering a post_type to be linked has not apparently changed in signature

    /**
    * Registers a post type as a linked post type for events
    *
    * Notable arguments that can be passed/filtered while registering linked post types:
    * – labels[‘name’]
    * – labels[‘singular_name’]
    * – allow_multiple (default: true) specifies how many of the post type can be linked with an event
    * – allow_creation (default: false) specifies whether or not post creation should be allowed
    *
    * @since 4.2
    *
    * @param string $post_type Post type slug
    * @param array $args Arguments for the linked post type – note: gets merged with get_post_type_object data
    *
    * @return boolean
    */
    public function register_linked_post_type( $post_type, $args = array() )

    I am at a loss at to where the ordering part is supposed to go – and why you cannot answer why the basic function is no longer backwardly compatible

    • This reply was modified 6 years ago by David.
    • This reply was modified 6 years ago by David.
    in reply to: Abstract post types ordering #1514819
    David
    Participant

    Your instructors post contains a lot of capability I do not need – I don’t need filter bar, I don’t need x, y or z – what I do need is the way it used to work working again, you keep pointing me to an overly complex plugin – yet mine used to work – you fail to address the key question of why your function no longer works as it used to – backward compatibility would have been awesome – but instead insist that I look at a plugin which has redundant features, does not answer my questions and is bloated

    in reply to: Abstract post types ordering #1514789
    David
    Participant

    Cliff – very simple question – if I call tribe_get_linked_posts_by_post_type as described in the documentation on https://theeventscalendar.com/function/tribe_get_linked_posts_by_post_type/

    i.e. tribe_get_linked_posts_by_post_type(16011, ‘excluded-element’) – would I expect to get an empty array? When prior to the latest update this worked

    in reply to: Abstract post types ordering #1514758
    David
    Participant

    Cliff – I just looked at the line of code you pointed me at – this is nothing to do with the ordering (yet) – but is to do with the get_linked_posts_by_post_type function now returning an empty array

    in reply to: Abstract post types ordering #1514753
    David
    Participant

    Why change the original function to not work at all? And have nothing in the release notes – based off you old code this worked

    in reply to: Abstract post types ordering #1513150
    David
    Participant

    Started drilling into your code – linked_posts.php

    	public function get_linked_posts_by_post_type( $post_id, $post_type ) {
    		$result = array();
    
    		if ( $linked_post_ids = get_post_meta( $post_id, $this->get_meta_key( $post_type ) ) ) {
    			$args = array();
    			// Sort by drag-n-drop order
    			$linked_ids_order = get_post_meta( $post_id, $this->get_order_meta_key( $post_type ), true );
    			if ( ! empty( $linked_ids_order ) ) {
    				$linked_post_ids = $linked_ids_order;
    				$args['post__in'] = $linked_ids_order;
    				$args['orderby'] = 'post__in';
    			}
    
    			echo $post_type;
    			echo print_r($args, true);
    			//echo print_r($linked_post_ids, true);
    			
    			$result = $this->get_linked_post_info( $post_type, $args, $linked_post_ids );
    			
    			echo print_r($result, true);
    		}

    That final echo is an empty array – so I went deeper to line 469

    	public function get_linked_post_info( $linked_post_type, $args = array(), $linked_post_ids = null ) {
    		$func_args = func_get_args();
    		$cache_key = $this->cache->make_key( $func_args, 'linked_post_info_' );
    		if ( isset( $this->cache[ $cache_key ] ) ) {
    			return $this->cache[ $cache_key ];
    		}
    
    		$defaults = array(
    			'post_type'            => $linked_post_type,
    			'post_status'          => array(
    				'publish',
    				'draft',
    				'private',
    				'pending',
    			),
    			'orderby'              => 'title',
    			'order'                => 'ASC',
    			'ignore_sticky_posts ' => true,
    			'nopaging'             => true,
    		);
    
    		if ( is_array( $linked_post_ids ) ) {
    			$defaults['post__in'] = $linked_post_ids;
    		} else {
    			$defaults['p'] = $linked_post_ids;
    		}
    
    		$args = wp_parse_args( $args, $defaults );
    
    		/**
    		 * Filters the linked posts query allowing third-party plugins to replace it.
    		 *
    		 * This is an opt-out filter: to avoid The Events Calendar from running the linked posts query as it would
    		 * normally do third parties should return anything that is not exactly <code>null</code> to replace the query and provide
    		 * alternative linked posts.
    		 *
    		 * @param array $linked_posts Defaults to <code>null</code>; will be an array if another plugin did run the query.
    		 * @param array $args         An array of query arguments in the same format used to provide arguments to WP_Query.
    		 *
    		 */
    		$linked_posts = apply_filters( 'tribe_events_linked_posts_query', null, $args );
    
    		if ( null !== $linked_posts ) {
    			return $linked_posts;
    		}
    
    		$result = new WP_Query( $args );
    
    		if ( $result->have_posts() ) {
    			$linked_posts = $result->posts;
    		} else {
    			$linked_posts = array();
    		}
    
    		$this->cache[ $cache_key ] = $linked_posts;
     print_r($linked_posts);
    		return $linked_posts;
    	}

    That print_r that I have added is also returning an empty array – so it appears that the WP-Query is no longer returning what it used to for this function

    in reply to: Abstract post types ordering #1513141
    David
    Participant

    I tried the new shortcode in your venues and organisers plugin – that works – but obviously does not get me just the linked posts for a specific post

    [tec_get_linked_posts]
    [tec_list_linked_posts post_type=’included-element’]
    [tec_list_linked_posts post_type=’excluded-element’]
    [tec_list_linked_posts post_type=’testimonial-snippet’]
    [list_venues thumb=’yes’ details=’yes’ count=’yes’]
    [list_organizersthumb=’yes’ details=’yes’ count=’yes’]
    [tec_list_linked_posts post_type=’included_element’ thumb=’yes’ details=’yes’ count=’yes’]

    in reply to: Abstract post types ordering #1513139
    David
    Participant

    tribe_get_linked_posts_by_post_type is empty – I call it with the correct post type name and the correct post id – but nothing is now returned

Viewing 15 posts - 1 through 15 (of 29 total)