Michael Beckwith on "[Plugin: BadgeOS] Exclude post types from from count of posts from steps"

ساخت وبلاگ

So I used the code above, which I am glad isnt far off from my thought process. However the step of 5 posts is not being trigged if I submit a post type post (currently sitting at 4), which would push it to 5 posts. So something is not working.

Is BadgeOS coded to JUST count posts with the type of post ?

Is it not easier to change the step (or maybe I mean trigger technically) itself to only count posts of a certain type using a filter or action? So when I choose the step "Require Publish a Post", can we not specifiy (not in the UI) that it only looks for post with the type post.

It seems the way we are doing it is checking AFTER the post is published, in which case there are already 20 or so posts with the type solium_award (the one we want to exclude).

OR

So the filter user_deserves_achievement is applied to the function badgeos_check_achievement_completion_for_user in rules-engine.php.

Is badgeos_check_achievement_completion_for_user triggered each time we press publish? Does it check JUST the one we published? Or does it do another loop over the triggers to see if we have made say 5 posts?

I know there is a trigger for Publish Page and Publish Post, but when I took at look I didnt see a why to say

if ( post_being_pushing_post_type !== 'post') {
dont_count_as_a_trigger }

Which would pose the problem of it only checking if THAT post was of that type, not all posts. And we cant use the action badgeos_new_{$post_type} either (if that action would help or not) as it poses the same problem.

So my only thought is it was to be when we are checking the triggers and counting the posts.

WordPress ...
ما را در سایت WordPress دنبال می کنید

برچسب : نویسنده : استخدام کار wpss بازدید : 248 تاريخ : جمعه 31 ارديبهشت 1395 ساعت: 4:12