add endpoints on install
This commit is contained in:
parent
94335db2a6
commit
17ca08c020
|
@ -32,7 +32,7 @@ class WC_AJAX {
|
|||
*/
|
||||
public static function add_endpoint() {
|
||||
add_rewrite_tag( '%wc-ajax%', '([^/]*)' );
|
||||
add_rewrite_rule( 'wc-ajax/([^/]*)/?', 'index.php?wc-ajax=$matches[1]', 'top' );
|
||||
add_rewrite_rule( 'wc-ajax/([^/]*)/?', 'index.php?wc-ajax=$matches[1]', 'top' );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -73,7 +73,7 @@ class WC_API {
|
|||
* @since 2.0
|
||||
* @return void
|
||||
*/
|
||||
public function add_endpoint() {
|
||||
public static function add_endpoint() {
|
||||
|
||||
// REST API
|
||||
add_rewrite_rule( '^wc-api/v([1-2]{1})/?$', 'index.php?wc-api-version=$matches[1]&wc-api-route=/', 'top' );
|
||||
|
|
|
@ -97,6 +97,8 @@ class WC_Install {
|
|||
// Also register endpoints - this needs to be done prior to rewrite rule flush
|
||||
WC()->query->init_query_vars();
|
||||
WC()->query->add_endpoints();
|
||||
WC_API::add_endpoint();
|
||||
WC_AJAX::add_endpoint();
|
||||
|
||||
self::create_terms();
|
||||
self::create_cron_jobs();
|
||||
|
|
Loading…
Reference in New Issue