key, $this->dismissed_notices, true ) ) { return false; } $rating_notice_trigger = sellkit_get_option( 'sellkit_rating_notice_trigger' ); if ( ! empty( $rating_notice_trigger ) && time() < $rating_notice_trigger ) { return false; } if ( ! $this->has_sellkit_post() ) { return false; } return true; } /** * Set the priority of notice. * * @since 1.5.7 * @return int */ public function priority() { return 1; } /** * Checks if some posts has been created or not in the SellKit. * * @since 1.5.7 * @return boolean */ public function has_sellkit_post() { $time = strtotime( '-7 days' ); $query = new \WP_Query( [ 'post_type' => [ 'sellkit-funnels', 'sellkit-discount', 'sellkit-coupon', 'sellkit-alert' ], 'date_query' => [ [ 'before' => [ 'year' => intval( date( 'Y', $time ) ), 'month' => intval( date( 'm', $time ) ), 'day' => intval( date( 'd', $time ) ), ], 'inclusive' => false, ], ], ] ); if ( ! empty( $query->posts ) ) { return true; } return false; } /** * Notice content wrapper. * * @since 1.5.7 */ public function notice_content_wrapper() { ?>