dozent_load_dashboard_page( array $data = array() )
Load Dashboard Page
Description
This function able to load even child dashboard page. for that, required pass true as first argument, and set a default template on the data variable.
Example usage:
dozent_load_dashboard_page();
dozent_load_dashboard_page( true, ['default_template' => 'dashboard/settings/profile'] );
See also
Parameters
- $sub_page_load
-
(bool) (Required)
- $data
-
(array) (Optional)
Default value: array()
Return
(bool)
Source
File: includes/template-functions.php
function dozent_load_dashboard_page( $data = [] ) { if ( ! is_dozent_dashboard() ) { return false; } $url_segment = dozent_get_dashboard_url_segment(); if ( ! $url_segment ) { $url_segment = 'index'; } $template = 'dashboard/' . $url_segment; $ful_url = untrailingslashit( $url_segment ); if ( ! strpos( $ful_url, '/' ) ) { $default_template = dozent_array_get( 'default_template', $data ); if ( $default_template ) { $template = $default_template; } } $data['url_segment'] = $url_segment; $dashboard_page_html = dozent_load_template( $template, $data, false ); echo apply_filters( 'dozent_load_dashboard_page', $dashboard_page_html, $template, $data ); }
Changelog
Version | Description |
---|---|
DozentLMS 1.0.0 | Introduced. |