Are other achievements still working?
Can you share how these custom achievements were implemented?
Other achievements, related to posting, commenting, and friend requests seem to be working.
The achievement is fired by an ajax call, which I have confirmed is still working.
Here is the handler function:
`function aw_init() {
add_action( ‘wp_ajax_aw_handle_ajax_request’, ‘aw_handle_ajax_request’ );
}
add_action( ‘dpa_init’, ‘aw_init’ );
function aw_handle_ajax_request() {
if ( empty( $_POST ) )
return false;
if ( empty( $_POST ) ){
return false;
} else { $module = (int)$_POST; }
$member_id = (int)$_POST;
if ( !get_userdata( $member_id ) )
return false;
$achievement_slug = “quizmaster-”.$module;
dpa_force_unlock_achievement( $member_id, $achievement_slug );
}`
Below is the ajax call (javascript):
`if (condition) {
jQuery.post(“http://mysite.com/wp-load.php “, { action: “aw_handle_ajax_request”, cookie: encodeURIComponent(document.cookie), member_id: userID.toString(), module_number: module_number } );
}`
Thanks again!
PS – This board’s formatting seems to be url-encoding the double-quote after the URL on that jQuery.post(). In my code it is properly-quoted.
Hi. Thanks for the paypal. First thing I see is that you’re sending the javascript to wp-load.php; we changed this in BP 1.6 to become more standard with WordPress. Change it to http://example.com/wp-admin/admin-ajax.php
I doubt that will fix anything, but give it a go. Tomorrow evening i’ll copy/paste your code into a dev site, and check it out.
I think that may have fixed it! I’ll email and update here if not…