| @@ -104,8 +104,12 @@ | ||
| 104 | 104 | 'posts_per_page' => $this->_options['limit'], |
| 105 | 105 | 'offset' => ( $paged - 1 ) * $this->_options['limit'], |
| 106 | 106 | ); |
| 107 | 107 | |
| 108 | + if ( 'order-items' === $context ) { | |
| 109 | + $context_id = false; | |
| 110 | + } | |
| 111 | + | |
| 108 | 112 | $context_id = apply_filters( 'learn-press/modal-search-items/context-id', $context_id, $context ); |
| 109 | 113 | if ( $context_id ) { |
| 110 | 114 | // Admin can get all items |
| 111 | 115 | if ( ! user_can( $user_id, 'administrator' ) ) { |
| @@ -349,10 +353,10 @@ | ||
| 349 | 353 | /** |
| 350 | 354 | * @return bool|LP_Modal_Search_Items |
| 351 | 355 | */ |
| 352 | 356 | public static function instance() { |
| 353 | - static $instance = false; | |
| 354 | - if ( ! $instance ) { | |
| 357 | + static $instance; | |
| 358 | + if ( is_null( $instance ) ) { | |
| 355 | 359 | $instance = new self(); |
| 356 | 360 | } |
| 357 | 361 | |
| 358 | 362 | return $instance; |