[Resolved] Updating own plugin for v3
Let me start by saying that although the change from v2 to v3 affects a lot of things I think you’ve done some great work and moving to this format is for the best.
I developed some months ago a little plugin that allows using an encoded URL to grant an achievement to the logged user. With the changes I need some help updating some core logic:
THis is some of the code I used on v2 to get the achievement object then unlock it (I retreive it by slug)
$decrypted = -decirpted achievement slug from the url- $original_achievement = new DPA_Achievement( array( 'type' => 'single', 'slug' => $decrypted, 'user_id' => $user_id ) ); $original_achievements = array( $original_achievement ); //here I pretty much retrieve the name, image and description, I assume ill get the image now with the thumbnail feature $outputstring = "<div id='unlock-achieve'><h2>".$original_achievement->name. "</h2><div id='unlock-achieve-img'><img src='". wp_get_attachment_url($original_achievement->picture_id)."'></div><div id='unlock-achieve-desc'>".$original_achievement->description. "</div></div>"; //antes slug //the unlock itself, I hope you kept this function on v3! dpa_force_unlock_achievement($user_id ,$original_achievement->slug);
As you can imagine, right now its the class constructor “new DPA_Achievement” the one that was removed, I have been poking around the source files but still can’t find the best way to retreive the achievement object.
Another related question:
When I updated from v2 to v3 I erased the Achievements page after the upgrade and the “archive” page doesnt list anything at all when I use the url:
Did I miss something to set up? I can see the achievements section on the WP Dashboard and Individual achievements do show up.
Thanks for all the hard work
- The topic ‘[Resolved] Updating own plugin for v3’ is closed to new replies.