Closed ansonphong closed 11 years ago
I found another vital issue with the way the points are working, whereby the post types seem to be hard-coded into two of the functions.
In postworld_points.php
you can see on lines 127
and 248
there are custom post_types which are being hard coded into default results. (I changed event to 'tribe_events')
array("post_type"=> array ("post"=> 0,"link" =>0,"blog" =>0, "tribe_events" => 0));
We need to use get_post_types
to get the actual current registered post_types: http://codex.wordpress.org/Function_Reference/get_post_types
Here is a post type query which should work:
$args = array(
'public' => true,
'_builtin' => false
);
$output = 'names'; // names or objects, note names is the default
$operator = 'and'; // 'and' or 'or'
$post_types = get_post_types( $args, $output, $operator );
BTW - the 'Share Karma' is working very well - I'm happy about that.
OK this thread is closed - I can fix the hard-coded post types.
Hi Haidy, I'm working with the post points functions and I'm finding they're not doing what is expected. Here are some instances :
cache_user_posts_points() Has no method
You can see by the function, that the function is simply acting as an alias of
calculate_user_posts_points()
(which is good), although it's not doing it's work by caching the actual points or writing anything to the table.cache_user_posts_points() Returning wrong value
For instance, when running :
cache_user_posts_points()
, it seems to generally work well, although there are two major issues:Code:
Result:
wp_postworld_user_meta
table"":"81"
which is adding 81 points to the user from an unknown post type (these points don't seem to be anywhere in the points table)Please help me solve these issues so that all the good work you've invested in these functions can be implemented.