@meir321
/**
* @param array $args
* @return array
*/
add_filter('helpful/ajax_get_posts_data/args', function(array $args) {
$args['post_type'] = 'helpie_faq'; // <-- here
return $args;
});
I have checked this on 4 pages for me. It works fine, directly in the functions.php. Here in the example I have selected only the post.
In the settings I have selected a completely different. Then only the post are shown to me. With a custom post type I have also tested this. It always works fine.
You may have to check in another place why this is not working. You can use the Query Monitor, but also set WP_DEBUG and WP_DEBUG_LOG to true, in your wp-config.php file. After that, in the debug.log directly in your wp-content/ folder, should put all the info, if there is an error.
Otherwise your post type will be registered differently, or incorrectly. You can still try to put an init in front of it if necessary:
add_action('init', function() {
/**
* @param array $args
* @return array
*/
add_filter('helpful/ajax_get_posts_data/args', function(array $args) {
$args['post_type'] = 'helpie_faq'; // <-- here
return $args;
});
});
Also with this, it works for me right away, without any problems.
Debugging in WordPress: https://helpful-plugin.info/docs/getting-started/debugging-in-wordpress/
-
This reply was modified 3 years, 3 months ago by
Pixelbart.