WordPress开发者和主题制作者的搜索引擎



flush_rewrite_rules ›

Since3.0.0
已弃用n/a
flush_rewrite_rules ( $hard = true )
参数:
  • (bool) $hard Whether to update .htaccess (hard flush) or just update rewrite_rules transient (soft flush). Default is true (hard).
    Required: No
    默认: true
定义在:
文档:

Remove rewrite rules and then recreate rewrite rules.



源码

function flush_rewrite_rules( $hard = true ) {
	global $wp_rewrite;

	if ( is_callable( array( $wp_rewrite, 'flush_rules' ) ) ) {
		$wp_rewrite->flush_rules( $hard );
	}
}