Skip to content

Commit

Permalink
fix: add filter to modify current page id (#678)
Browse files Browse the repository at this point in the history
  • Loading branch information
saimonh3 authored and sabbir1991 committed Nov 7, 2019
1 parent 92948fa commit 20d42f3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions classes/rewrites.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@ function register_rule() {
public function resolve_wc_query_conflict( $query_vars ) {
global $post;

$dashboard = dokan_get_option( 'dashboard', 'dokan_pages', 0 );
$dashboard_id = apply_filters( 'dokan_get_dashboard_page_id', dokan_get_option( 'dashboard', 'dokan_pages', 0 ) );

if ( ! empty( $post->ID ) && $post->ID === absint( $dashboard ) ) {
if ( ! empty( $post->ID ) && apply_filters( 'dokan_get_current_page_id', $post->ID ) === absint( $dashboard_id ) ) {
unset( $query_vars['orders'] );
unset( $query_vars['edit-account'] );
}
Expand Down
4 changes: 2 additions & 2 deletions includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,11 @@ function dokan_is_product_edit_page() {
function dokan_is_seller_dashboard() {
$page_id = dokan_get_option( 'dashboard', 'dokan_pages' );

if ( ! $page_id ) {
if ( ! apply_filters( 'dokan_get_dashboard_page_id', $page_id ) ) {
return false;
}

if ( $page_id == get_the_ID() ) {
if ( $page_id == apply_filters( 'dokan_get_current_page_id', get_the_ID() ) ) {
return true;
}

Expand Down

0 comments on commit 20d42f3

Please sign in to comment.