AnsPress_Rewrite::add_query_var( object $wp )
Description #
Push custom query args in $wp
.
Parameters #
- $wpobject (Required) WP query object.
Source #
File: includes/rewrite.php
public static function add_query_var( $wp ) { if ( ! empty( $wp->query_vars['ap_user'] ) ) { $user = get_user_by( 'login', sanitize_text_field( urldecode( $wp->query_vars['ap_user'] ) ) ); if ( $user ) { $wp->set_query_var( 'ap_user_id', (int) $user->ID ); } else { global $wp_query; $wp_query->set_404(); status_header( 404 ); get_template_part( 404 ); exit(); } } }
Expand full source code Collapse full source code View on GitHub: includes/rewrite.php:224
Add your comment