public function __construct(&$model) { parent::__construct($model); static $done = false; if ($done) { return; } $done = true; // avoid duplicating rewrite rules when switching blog thanks to @ScreenFeedFr // inspired by wp-includes/rewrite.php $this->root = preg_match('#^/*' . $this->index . '#', get_option('permalink_structure')) ? $this->index . '/' : ''; add_action('setup_theme', array(&$this, 'add_permastruct')); // refresh rewrite rules if the 'page_on_front' option is modified add_action('update_option_page_on_front', 'flush_rewrite_rules'); // make sure to prepare rewrite rules when flushing add_action('pre_option_rewrite_rules', array(&$this, 'prepare_rewrite_rules')); }
/** * Returns the home url * * @since 1.3.1 * * @param object $lang PLL_Language object * @return string */ public function home_url($lang) { return trailingslashit(parent::home_url($lang)); }