| 1 |
<?php |
| 2 |
/** |
| 3 |
* Achievement Type Meta Boxes |
| 4 |
* |
| 5 |
* @package GamiPress\Admin\Meta_Boxes\Achievement_Type |
| 6 |
* @author GamiPress <[email protected]>, Ruben Garcia <[email protected]> |
| 7 |
* @since 1.4.7 |
| 8 |
*/ |
| 9 |
// Exit if accessed directly |
| 10 |
if( !defined( 'ABSPATH' ) ) exit; |
| 11 |
|
| 12 |
/** |
| 13 |
* Register achievement type meta boxes |
| 14 |
* |
| 15 |
* @since 1.0.0 |
| 16 |
*/ |
| 17 |
function gamipress_achievement_type_meta_boxes() { |
| 18 |
|
| 19 |
// Start with an underscore to hide fields from custom fields list |
| 20 |
$prefix = '_gamipress_'; |
| 21 |
|
| 22 |
// Achievement Type Data |
| 23 |
gamipress_add_meta_box( |
| 24 |
'achievement-type-data', |
| 25 |
__( 'Achievement Type Data', 'gamipress' ), |
| 26 |
'achievement-type', |
| 27 |
array( |
| 28 |
'post_title' => array( |
| 29 |
'name' => __( 'Singular Name', 'gamipress' ), |
| 30 |
'tooltip' => __( 'The singular name for this achievement type.', 'gamipress' ), |
| 31 |
'label_cb' => 'cmb_tooltip_label_cb', |
| 32 |
'type' => 'text_medium', |
| 33 |
), |
| 34 |
$prefix . 'plural_name' => array( |
| 35 |
'name' => __( 'Plural Name', 'gamipress' ), |
| 36 |
'tooltip' => __( 'The plural name for this achievement type.', 'gamipress' ), |
| 37 |
'label_cb' => 'cmb_tooltip_label_cb', |
| 38 |
'type' => 'text_medium', |
| 39 |
), |
| 40 |
'post_name' => array( |
| 41 |
'name' => __( 'Slug', 'gamipress' ), |
| 42 |
'desc' => '<span class="gamipress-permalink hide-if-no-js">' . site_url() . '/<strong class="gamipress-post-name"></strong>/</span><br>', |
| 43 |
'tooltip' => __( 'Slug is used for internal references, as some shortcode attributes, to completely differentiate this achievement type from any other (leave blank to automatically generate one).', 'gamipress' ), |
| 44 |
'label_cb' => 'cmb_tooltip_label_cb', |
| 45 |
'type' => 'text_medium', |
| 46 |
'attributes' => array( |
| 47 |
'maxlength' => 20 |
| 48 |
) |
| 49 |
), |
| 50 |
), |
| 51 |
array( 'priority' => 'high', ) |
| 52 |
); |
| 53 |
|
| 54 |
} |
| 55 |
add_action( 'gamipress_init_achievement-type_meta_boxes', 'gamipress_achievement_type_meta_boxes' ); |