LLMS_Query::add_endpoints()

Add Query Endpoints


Description Description


Return Return

(void)


Top ↑

Source Source

File: includes/class.llms.query.php

	public function add_endpoints() {

		foreach ( $this->get_query_vars() as $key => $var ) {
			add_rewrite_endpoint( $var, EP_PAGES );
		}

		global $wp_rewrite;
		foreach ( LLMS_Student_Dashboard::get_tabs() as $id => $tab ) {
			if ( ! empty( $tab['paginate'] ) ) {
				$regex = sprintf( '(.?.+?)/%1$s/%2$s/?([0-9]{1,})/?$', $tab['endpoint'], $wp_rewrite->pagination_base );
				$redirect = sprintf( 'index.php?pagename=$matches[1]&%s=$matches[3]&paged=$matches[2]', $tab['endpoint'] );
				add_rewrite_rule( $regex, $redirect, 'top' );
			}
		}

	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.28.2 Handle dashboard tab pagination via a rewrite rule.
1.0.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

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





Permalink: