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.


Top ↑

Return Return

(array)


Top ↑

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,
			),
		);

	}

Top ↑

Changelog Changelog

Changelog
Version Description
6.0.0 Removed the deprecated achievement background image meta field.<br> 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.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.