The customer reported that a specific custom field group was missing from the post edit screen.
Solution:
The post field group was available, but since the section was part of the accordion, the arrow next to it needed to be clicked, in order to open/collapse it.
The problem here is that the user is getting the following error.
PHP Fatal error: Uncaught Error: Class 'OTGS\Toolset\Access\Controllers\UploadPermissions' not found in .../wp-content/plugins/types-access/application/models/capabilities.php:613
Problem:
The user is unable to use Toolset Blocks after updating PHP version to 8.1.
Solution:
We do have an ongoing project to make Toolset plugins PHP8 compatible. However, currently, it is not yet ready for it. And you will need to downgrade to PHP 7. Our website(toolset.com) is currently running on PHP 7.4.
Check our requirements here
The customer asked how can the page be scrolled to the top when the results are updated through AJAX pagination.
Solution:
Informed that a fix for an issue that led him to use the AJAX pagination has been provided in the relevant ticket, so he can switch back to the non-AJAX pagination.
The issue here is that the user wanted to prefilter their post reference field options. In this case they wanted to retrieve specific posts from a particular taxonomy.
Solution:
This can be done by using the hook below.
/**
* Limit the posts offered in the Post Reference dropdown to those with a particular term assigned
*
* Edit
* 1. the slug of the post type in the if statement as required ('review' in this example) as well as the custom field slug 'wpcf-my-reference'
* 2. the slug of the taxonomy ('colour' in this example)
* 3. the slug(s) of the terms that should match ('red' in this example)
*/
function ts_filter_related_post_selector( $query )
{
if ( defined('DOING_AJAX') && $_REQUEST['action'] === 'types_post_reference_field' && $_REQUEST['field_slug'] === 'wpcf-my-reference' && $query->query['post_type'][0] === 'review' ) { // edit
$taxquery = array(
array(
'taxonomy' => 'colour', // edit
'field' => 'slug',
'terms' => array('red'), // edit
'operator' => 'IN'
)
);
$query->set('tax_query', $taxquery);
}
}
add_action('pre_get_posts', 'ts_filter_related_post_selector');
Add this code to the Toolset Custom code settings at Toolset -> Settings -> Custom Code and activate it.