Skip Navigation

[Resolved] Upgraded from Types Version 3.4.7 to Version 3.4.10 & it broke wpt_field_options

This support ticket is created 2 years, 10 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

Tagged: 

This topic contains 7 replies, has 2 voices.

Last updated by Luo Yang 2 years, 8 months ago.

Assisted by: Luo Yang.

Author
Posts
#2075419

Tell us what you are trying to do?

I've been using this function for populating a select field for years:

// NEW Populate select from wp-types with memberships

add_filter( 'wpt_field_options', 'aw_custom_options', 10, 3);

function aw_custom_options( $options, $title, $type ){

$prompt[] = array(
'#value' => 0,
'#title' => 'Select Membership'
);

switch( $title ){
case 'Linked to Membership 2':
$prompt;
$options = array();
$args = array(
'post_type' => 'memberpressproduct',
'post_status' => 'publish',
'posts_per_page' => -1);
$posts_array = get_posts( $args );
foreach ($posts_array as $post) {
$options[] = array(
'#value' => $post->ID,
'#title' => $post->post_title,
);
}
$options = array_merge($prompt, $options);
break;
}
return $options;
}

This is the shortcode I am using in a view:

[mepr-membership-link id='[types field="linked-to-membership-new" output="raw"][/types]']Buy Now[/mepr-membership-link]

Upgraded from Types Version 3.4.7 to Version 3.4.10 & it broke something which was instantly fixed when I downgraded again.

Any ideas?

#2075655

Hello,

It seems to be a Types plugin shortcode [types] problem, I have escalated this issue, will update here if there is any news.
Currently, please try below Views/Blocks plugin shortcode [wpv-post-field], like this:
[wpv-post-field name="wpcf-linked-to-membership-new"]

And test again

#2078919

Thanks Luo - I can't get this to work - how would I combine the 2 shortcodes? This isn't working?

[mepr-membership-link id='[wpv-post-field name="wpcf-linked-to-membership-new"]']Buy Now[/mepr-membership-link]

#2078925

That depends on your custom shortcode [mepr-membership-link], you will need to make sure that shortcode supports the "shortcode within shortcode" feature, you might need to check the author of shortcode [mepr-membership-link]

#2079865

Yes it works shortcode within shortcode - its been working like that for about 5 years

#2079953

You can simply try these:
1) Output [wpv-post-field name="wpcf-linked-to-membership-new"] shortcode directly, check if it outputs correct results.
2) If it does output correct results, then you need to check your custom shortcode [mepr-membership-link]

#2091127

Here is the update from our developers, it will be fixed in next version of Toolset Types plugin, which is under QA status, will be released soon

#2125003

Hello,

This issue has been fixed in the latest version of Toolset Types plugin, you can download it here:
https://toolset.com/account/downloads/

Please test it and feedback if the problem is fixed, thanks

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.