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?
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
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]
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]
Yes it works shortcode within shortcode - its been working like that for about 5 years
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]
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
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