/**
 * Register [badgeos_achievements_list] shortcode.
 *
 * @since 1.4.0
 */
function badgeos_register_achievements_list_shortcode()
{
    // Setup a custom array of achievement types
    $achievement_types = array_diff(badgeos_get_achievement_types_slugs(), array('step'));
    array_unshift($achievement_types, 'all');
    badgeos_register_shortcode(array('name' => __('Achievement List', 'badgeos'), 'description' => __('Output a list of achievements.', 'badgeos'), 'slug' => 'badgeos_achievements_list', 'output_callback' => 'badgeos_achievements_list_shortcode', 'attributes' => array('type' => array('name' => __('Achievement Type(s)', 'badgeos'), 'description' => __('Single, or comma-separated list of, achievement type(s) to display.', 'badgeos'), 'type' => 'text', 'values' => $achievement_types, 'default' => 'all'), 'limit' => array('name' => __('Limit', 'badgeos'), 'description' => __('Number of achievements to display.', 'badgeos'), 'type' => 'text', 'default' => 10), 'show_filter' => array('name' => __('Show Filter', 'badgeos'), 'description' => __('Display filter controls.', 'badgeos'), 'type' => 'select', 'values' => array('true' => __('True', 'badgeos'), 'false' => __('False', 'badgeos')), 'default' => 'true'), 'show_search' => array('name' => __('Show Search', 'badgeos'), 'description' => __('Display a search input.', 'badgeos'), 'type' => 'select', 'values' => array('true' => __('True', 'badgeos'), 'false' => __('False', 'badgeos')), 'default' => 'true'), 'orderby' => array('name' => __('Order By', 'badgeos'), 'description' => __('Parameter to use for sorting.', 'badgeos'), 'type' => 'select', 'values' => array('menu_order' => __('Menu Order', 'badgeos'), 'ID' => __('Achievement ID', 'badgeos'), 'title' => __('Achievement Title', 'badgeos'), 'date' => __('Published Date', 'badgeos'), 'modified' => __('Last Modified Date', 'badgeos'), 'author' => __('Achievement Author', 'badgeos'), 'rand' => __('Random', 'badgeos')), 'default' => 'menu_order'), 'order' => array('name' => __('Order', 'badgeos'), 'description' => __('Sort order.', 'badgeos'), 'type' => 'select', 'values' => array('ASC' => __('Ascending', 'badgeos'), 'DESC' => __('Descending', 'badgeos')), 'default' => 'ASC'), 'user_id' => array('name' => __('User ID', 'badgeos'), 'description' => __('Show only achievements earned by a specific user.', 'badgeos'), 'type' => 'text'), 'include' => array('name' => __('Include', 'badgeos'), 'description' => __('Comma-separated list of specific achievement IDs to include.', 'badgeos'), 'type' => 'text'), 'exclude' => array('name' => __('Exclude', 'badgeos'), 'description' => __('Comma-separated list of specific achievement IDs to exclude.', 'badgeos'), 'type' => 'text'), 'wpms' => array('name' => __('Include Multisite Achievements', 'badgeos'), 'description' => __('Show achievements from all network sites.', 'badgeos'), 'type' => 'select', 'values' => array('true' => __('True', 'badgeos'), 'false' => __('False', 'badgeos')), 'default' => 'false'))));
}
/**
 * Register the [badgeos_achievement] shortcode.
 *
 * @since 1.4.0
 */
function badgeos_register_achievement_shortcode()
{
    badgeos_register_shortcode(array('name' => __('Single Achievement', 'badgeos'), 'slug' => 'badgeos_achievement', 'output_callback' => 'badgeos_achievement_shortcode', 'description' => __('Render a single achievement.', 'badgeos'), 'attributes' => array('id' => array('name' => __('Achievement ID', 'badgeos'), 'description' => __('The ID of the achievement to render.', 'badgeos'), 'type' => 'text'))));
}
 public function register_badgeos_shortcodes()
 {
     badgeos_register_shortcode(array('name' => __('User earned achievement', 'achievement-shortcode-for-badgeos'), 'slug' => 'user_earned_achievement', 'description' => __('Show or hide content depending on if the user has earned a specific achievement.', 'achievement-shortcode-for-badgeos'), 'output_callback' => array($this, 'shortcode'), 'attributes' => array('id' => array('name' => __('Achievement ID', 'achievement-shortcode-for-badgeos'), 'description' => __('The ID of the achievement the user must have earned.', 'achievement-shortcode-for-badgeos'), 'type' => 'text'))));
 }
/**
 * Register the [badgeos_nominations] shortcode.
 *
 * @since 1.4.0
 */
function badgeos_register_nominations_list_shortcode()
{
    badgeos_register_shortcode(array('name' => __('Nominations List', 'badgeos'), 'description' => __('Display a filterable list of nominations.', 'badgeos'), 'slug' => 'badgeos_nominations', 'output_callback' => 'badgeos_display_nominations', 'attributes' => array('limit' => array('name' => __('Limit', 'badgeos'), 'description' => __('Number of nominations to display.', 'badgeos'), 'type' => 'text', 'default' => '10'), 'status' => array('name' => __('Status', 'badgeos'), 'description' => __('Nomination statuses to display.', 'badgeos'), 'type' => 'select', 'values' => array('all' => __('All', 'badgeos'), 'approved' => __('Approved', 'badgeos'), 'denied' => __('Denied', 'badgeos'), 'pending' => __('Pending', 'badgeos')), 'default' => 'all'), 'show_filter' => array('name' => __('Show Filter', 'badgeos'), 'description' => __('Display filter controls.', 'badgeos'), 'type' => 'select', 'values' => array('true' => __('True', 'badgeos'), 'false' => __('False', 'badgeos')), 'default' => 'true'), 'show_search' => array('name' => __('Show Search', 'badgeos'), 'description' => __('Display a search input.', 'badgeos'), 'type' => 'select', 'values' => array('true' => __('True', 'badgeos'), 'false' => __('False', 'badgeos')), 'default' => 'true'))));
}
 public function register_badgeos_shortcodes()
 {
     // Setup a custom array of achievement types
     $achievement_types = array_diff(badgeos_get_achievement_types_slugs(), array('step'));
     array_unshift($achievement_types, 'all');
     badgeos_register_shortcode(array('name' => __('Activity Progress Bar', 'badgeos-activity-progress'), 'slug' => 'badgeos_activity_progress', 'description' => 'Show a progress bar for the users current activity points in relation to the next achievement earnable by points .', 'output_callback' => array($this, 'shortcode'), 'attributes' => array('type' => array('name' => __('Achievement Type(s)', 'badgeos-activity-progress'), 'description' => __('Single, or comma-separated list of, achievement type(s) to show progress bar for.', 'badgeos-activity-progress'), 'type' => 'text', 'values' => $achievement_types, 'default' => 'all'), 'user_id' => array('name' => __('User ID', 'badgeos-activity-progress'), 'description' => __('Show progress bar for specific user (defaults to current logged in user).', 'badgeos-activity-progress'), 'type' => 'text'), 'link_to' => array('name' => __('Link', 'badgeos-activity-progress'), 'description' => __('Enter URL to link progress bar to.', 'badgeos-activity-progress'), 'type' => 'url'), 'format' => array('name' => __('Format', 'badgeos-activity-progress'), 'description' => __('Output format.', 'badgeos-activity-progress'), 'type' => 'select', 'values' => array('simple' => __('Simple', 'badgeos-activity-progress'), 'extended' => __('Extended', 'badgeos-activity-progress')), 'default' => 'simple'))));
 }
/**
 * Register the [credly_assertion_page] shortcode.
 *
 * @since 1.4.0
 */
function badgeos_register_credly_assertion_shortcode()
{
    badgeos_register_shortcode(array('name' => __('Credly Assertion Page', 'badgeos'), 'description' => sprintf(__('Adds support for Credly\'s "Custom Assertion Location" feature, available to Credly Pro members only. After placing this shortcode on a page, copy that page\'s URL and append "?CID={id}" to the end (e.g. %1$s). Paste this full URL in the "Custom Assertion Location" field in your Credly Account Settings. All of your Credly badges will be linked back to this site where the official badge information is displayed automatically.', 'badgeos'), '<code>' . site_url('/assertion/?CID={id}') . '</code>'), 'slug' => 'credly_assertion_page', 'output_callback' => 'badgeos_credly_assertion_page', 'attributes' => array('width' => array('name' => __('Width', 'badgeos'), 'description' => __('Content width.', 'badgeos'), 'type' => 'text', 'default' => 560), 'height' => array('name' => __('Height', 'badgeos'), 'description' => __('Content height.', 'badgeos'), 'type' => 'text', 'default' => 1000), 'CID' => array('name' => __('Credly Assertion ID', 'badgeos'), 'description' => __('Optional Credly Badge ID to display instead of dynamically passed ID.', 'badgeos'), 'type' => 'text'))));
}
예제 #7
0
/**
 * Register the [badgeos_submissions] shortcode.
 *
 * @since 1.4.0
 */
function badgeos_register_submissions_list_shortcode()
{
    badgeos_register_shortcode(array('name' => __('Submissions List', 'badgeos'), 'description' => __('Display a filterable list of submissions', 'badgeos'), 'slug' => 'badgeos_submissions', 'output_callback' => 'badgeos_display_submissions', 'attributes' => array('limit' => array('name' => __('Limit', 'badgeos'), 'description' => __('Number of submissions to display.', 'badgeos'), 'type' => 'text', 'default' => 10), 'status' => array('name' => __('Status to Display', 'badgeos'), 'description' => __('Display only submissions of this status.', 'badgeos'), 'type' => 'select', 'values' => array('all' => __('All', 'badgeos'), 'approved' => __('Approved', 'badgeos'), 'denied' => __('Denied', 'badgeos'), 'pending' => __('Pending', 'badgeos')), 'default' => 'all'), 'show_filter' => array('name' => __('Show Filter', 'badgeos'), 'description' => __('Display filter controls.', 'badgeos'), 'type' => 'select', 'values' => array('true' => __('True', 'badgeos'), 'false' => __('False', 'badgeos')), 'default' => 'true'), 'show_search' => array('name' => __('Show Search', 'badgeos'), 'description' => __('Display a search input.', 'badgeos'), 'type' => 'select', 'values' => array('true' => __('True', 'badgeos'), 'false' => __('False', 'badgeos')), 'default' => 'true'), 'show_attachments' => array('name' => __('Show attachments', 'badgeos'), 'description' => __('Display submission attachments.', 'badgeos'), 'type' => 'select', 'values' => array('true' => __('True', 'badgeos'), 'false' => __('False', 'badgeos')), 'default' => 'true'), 'show_comments' => array('name' => __('Show comments', 'badgeos'), 'description' => __('Display submission comments.', 'badgeos'), 'type' => 'select', 'values' => array('true' => __('True', 'badgeos'), 'false' => __('False', 'badgeos')), 'default' => 'true'))));
}
/**
 * Register the [badgeos_submission] shortcode.
 *
 * @since 1.4.0
 */
function badgeos_register_submission_shortcode()
{
    badgeos_register_shortcode(array('name' => __('Submission Form', 'badgeos'), 'description' => __('Render a submission form.', 'badgeos'), 'slug' => 'badgeos_submission', 'output_callback' => 'badgeos_submission_form', 'attributes' => array('achievement_id' => array('name' => __('Achievement ID', 'badgeos'), 'description' => __('Achievement ID to award.', 'badgeos'), 'type' => 'text'))));
}