首先将get添加到查询变量数组:
function add_query_vars_wpa12572($vars) {
$vars[] = \'get\'
return $vars;
}
add_filter(\'query_vars\', \'add_query_vars_wp12572\');
然后添加重写规则
function author_rewrite_rules_wpa12572( $wp_rewrite ) {
$newrules = array();
$new_rules[\'get_(\\d*)$\'] = \'index.php?get=$matches[1]\';
$wp_rewrite->rules = $new_rules + $wp_rewrite->rules;
}
add_filter(\'generate_rewrite_rules\',\'author_rewrite_rules_wpa12572\');