From this repo...
- Get
badgeup
directory and make it a zip archive - Log in to your WordPress dashboard
- Navigate to the Plugins menu and click
Add New
- Click
Upload Plugin
and upload and install zippedbadgeup
directory
Use badgeup
directory in this repo and upload it to /wp-content/plugins
on your site and activate the plugin.
Alternatively, when available on wordpress.org,
- Log in to your WordPress dashboard
- Navigate to the Plugins menu and click
Add New
- Search for 'BadgeUp'
- Click
Install now
- PHP version 7.0.0 or greater
- MySQL version 5.6 or greater
- WordPress 4.4+
Achievements are cached for 24 hours, to force reload add a query parameter badgeup_reload_cache
to frontend page where achievements widget is visible.
OR
Got to achievement settings page Log in to WordPress the go to Settings
> BadgeUp
> Achievements
tab then click Reload achievements cache
button.
Adds an admin notice
Notice is display when next admin_notices
hook is called.
Returns bool Success
BadgeUp::notify( "Hi Admin! What's going on?" );
Get BadgeUp API object, to interact with API
Returns BadgeUp_API Instance
$bup_api = badgeup_api();
$bup_api->create_event( 'event-name' ); // Call any BadgeUp_API method here
Creates a new event
Returns promise, which is resolved on shutdown
hook.
- @param string $event Event key to create event with
- @param callable $done Called promise is fulfilled or rejected
Returns bool|Exception|Promise Exception or false on error and promise on success.
badgeup_api()->create_event( 'namespace:subnamespace:event-name' );
Call methods on BadgeUp API client instance
By default resolves the promise right away and returns reponse (or Exception).
- @param 'getAchievement'|'getAchievements'|'getEarnedAchievements'|'createEvent' $method Method to call
- @param array $args Arguments for method
- @param bool $wait Whether or not to resolve the promise right away, true by default
Return Exception|mixed Exception on error and response on success.
badgeup_api()->api( 'getEarnedAchievements', [ $user_id ] );
Get achievements array with name, description and icon of each achievement. With achievement ID as key in the array
Returns array Achievements create on badgeup
! Not to be confused with earned achievements which are subject specific.
This returns all achievements added by user in BadgeUp dashboard.
$achievements = badgeup_api()->get_achievements();
This plugin uses Sass for styling.
- To watch for changes, run
npm run watch
- To build it manually, run
npm run build
- Install PHPUnit
- Open plugin directory in command line
- Setup tests
bin/install-wp-tests.sh wordpress_test root '' localhost latest
- Run tests
phpunit
For more about testing, check out https://make.wordpress.org/cli/handbook/plugin-unit-tests/