{"id":7463441,"date":"2016-06-10T00:55:10","date_gmt":"2016-06-10T00:55:10","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/45-fix\/"},"modified":"2016-09-01T15:25:52","modified_gmt":"2016-09-01T15:25:52","slug":"45-fix","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/45-fix\/","title":{"rendered":"4.5 fix"},"content":{"rendered":"<p>This plugin is really helpful for a large network and big team, but there&#8217;s a bug that removes all rewrite rules except for the two that wp-amd uses. In other words, all pages return a 404.<\/p>\n<p>I fixed it with two changes to \\lib\\class-scaffold.php<\/p>\n<p>Line 58:<\/p>\n<pre><code>add_filter( &#039;pre_update_option_rewrite_rules&#039;, array( &amp;$this, &#039;update_option_rewrite_rules&#039; ), 1 );<\/code><\/pre>\n<p>changed to <\/p>\n<pre><code>add_filter( &#039;rewrite_rules_array&#039;, array( &amp;$this, &#039;update_option_rewrite_rules&#039; ), 1 );<\/code><\/pre>\n<p>and line 543:<\/p>\n<pre><code>public function update_option_rewrite_rules( $rules = array() ) {\n        $new_rules = array( &#039;&#039; . $this-&gt;get( &#039;permalink&#039; ) . &#039;$&#039; =&gt; &#039;index.php?&#039; . self::$query_vars[0] . &#039;=&#039; . $this-&gt;get( &#039;type&#039; ) . &#039;&amp;&#039; . self::$query_vars[1] . &#039;=1&#039; );\n        $rules =  array_merge_recursive( (array) $new_rules, (array) $rules );\n        return $rules;\n}<\/code><\/pre>\n<p>changed to <\/p>\n<pre><code>public function update_option_rewrite_rules( $rules = array() ) {\n        $rules[$this-&gt;get( &#039;permalink&#039; ) . &#039;$&#039;] = &#039;index.php?&#039; . self::$query_vars[0] . &#039;=&#039; . $this-&gt;get( &#039;type&#039; ) . &#039;&amp;&#039; . self::$query_vars[1] . &#039;=1&#039;;\n        return $rules;\n}<\/code><\/pre>\n<p>https:\/\/wordpress.org\/plugins\/wp-amd\/<\/p>\n","protected":false},"template":"","class_list":["post-7463441","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/7463441","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/7463441\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=7463441"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}