LLMS_Meta_Box_Achievement::get_fields()
Builds array of metabox options.
Description Description
Array is called in output method to display options. Appropriate fields are generated based on type.
Return Return
(array)
Source Source
File: includes/admin/post-types/meta-boxes/class.llms.meta.box.achievement.php
public function get_fields() {
$fields = array();
if ( 'llms_achievement' === $this->post->post_type ) {
$fields[] = array(
'label' => __( 'Achievement Title', 'lifterlms' ),
'desc' => __( 'The name of the achievement which will be shown to users', 'lifterlms' ),
'id' => $this->prefix . 'achievement_title',
'type' => 'text',
'class' => 'input-full',
'sanitize' => 'no_encode_quotes',
);
}
$fields[] = array(
'label' => __( 'Achievement Content', 'lifterlms' ),
'desc' => __( 'An optional short description of the achievement which will be shown to users', 'lifterlms' ),
'id' => $this->prefix . 'achievement_content',
'type' => 'textarea_w_tags',
'sanitize' => 'no_encode_quotes',
'cols' => 80,
'rows' => 8,
'meta' => $this->post->post_content,
);
return array(
array(
'title' => __( 'General', 'lifterlms' ),
'fields' => $fields,
),
);
}
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 6.0.0 | Removed the deprecated achievement background image meta field. Made the title field conditional based on viewed post type. |
| 3.37.12 | Allow some fields to store values with quotes. |
| 3.0.0 | Introduced. |