Tribe__Admin__Help_Page::add_section_content( string $section_id, string|array $content, integer $priority = 10, array $arguments = array() )

Add a New content Item to a Help page Section


Parameters #

$section_id

(string) (Required) Which section this content should be assigned to

$content

(string|array) (Required) Item text or array of items, will be passed to $this->get_content_html

$priority

(integer) (Optional) A Numeric priority

Default value: 10

$arguments

(array) (Optional) If you need arguments for item, they can be passed here

Default value: array()


Top ↑

Return #

(object) The content item added


Top ↑

Source #

File: src/Tribe/Admin/Help_Page.php

	public function add_section_content( $section_id, $content, $priority = 10, $arguments = array() ) {
		$section_id = sanitize_html_class( $section_id );

		// Check if the section exists
		if ( empty( $this->sections[ $section_id ] ) ) {
			return false;
		}

		// Make sure we have arguments as Array
		if ( ! is_array( $arguments ) ) {
			return false;
		}

		$section = &$this->sections[ $section_id ];

		// Increment the content counter
		$section->content_count++;

		$item = (object) $arguments;

		// Set the priority
		$item->priority = absint( $priority );

		// Set the uid to help ordering
		$item->unique_call_order = $section->content_count;

		// Content is not Safe, will be Sanitized on Output
		$item->content = $content;

		$section->content[] = $item;

		return $item;
	}

Top ↑

Changelog #

Changelog
Version Description
4.0 Introduced.