Dashboard::change_document_title( $title )

Set document title for dashboard page


Parameters

$title

(Required)


Return

(mixed)


Source

File: classes/Dashboard.php

	function change_document_title( $title ) {

		if ( is_dozent_dashboard() ) {
			$dashboard_links = dozent_dashboard_permalinks();
			$links_key_value = array_column( call_user_func_array( 'array_merge', $dashboard_links ), 'title', 'id' );

			$segment    = dozent_get_dashboard_url_segment();

			if ( strpos( $segment, '/' ) !== false ) {
				$segment = explode( '/', $segment );
				$segment = dozent_array_get( 0, $segment );
			}

			$link_title = dozent_array_get( $segment, $links_key_value );

			if ( $link_title && isset( $title['title'] ) ) {
				$title['title'] = $link_title;
			}
		}

		return $title;
	}


Changelog

Changelog
Version Description
DozentLMS 1.0.0 Introduced.