LLMS_Metabox_Textarea_W_Tags_Field

LLMS_Metabox_Textarea_W_Tags_Field class.


Source Source

File: includes/admin/post-types/meta-boxes/fields/llms.class.meta.box.textarea.tags.php

class LLMS_Metabox_Textarea_W_Tags_Field extends LLMS_Metabox_Field implements Meta_Box_Field_Interface {

	/**
	 * Class constructor.
	 *
	 * @since Unknown
	 *
	 * @param array $_field Array containing information about field.
	 * @return void
	 */
	public function __construct( $_field ) {
		$this->field = $_field;
	}

	/**
	 * Outputs the Html for the given field.
	 *
	 * @since Unknown
	 * @since 6.0.0 Allow displaying a custom value.
	 *               Added options for defining textarea rows and columns.
	 *
	 * @return void
	 */
	public function output() {
		parent::output();
		$cols = $this->field['cols'] ?? 60;
		$rows = $this->field['rows'] ?? 4;
		?>
		<textarea
			name="<?php echo $this->field['id']; ?>"
			id="<?php echo $this->field['id']; ?>"
			cols="<?php echo $cols; ?>"
			rows="<?php echo $rows; ?>"
			><?php echo ! empty( $this->field['value'] ) ? $this->field['value'] : $this->meta; ?></textarea>
		<?php
		parent::close_output();
	}
}


Top ↑

Methods Methods


Top ↑

User Contributed Notes User Contributed Notes

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