• This plugin is really helpful for a large network and big team, but there’s a bug that removes all rewrite rules except for the two that wp-amd uses. In other words, all pages return a 404.

    I fixed it with two changes to \lib\class-scaffold.php

    Line 58:

    add_filter( 'pre_update_option_rewrite_rules', array( &$this, 'update_option_rewrite_rules' ), 1 );

    changed to

    add_filter( 'rewrite_rules_array', array( &$this, 'update_option_rewrite_rules' ), 1 );

    and line 543:

    public function update_option_rewrite_rules( $rules = array() ) {
            $new_rules = array( '' . $this->get( 'permalink' ) . '$' => 'index.php?' . self::$query_vars[0] . '=' . $this->get( 'type' ) . '&' . self::$query_vars[1] . '=1' );
            $rules =  array_merge_recursive( (array) $new_rules, (array) $rules );
            return $rules;
    }

    changed to

    public function update_option_rewrite_rules( $rules = array() ) {
            $rules[$this->get( 'permalink' ) . '$'] = 'index.php?' . self::$query_vars[0] . '=' . $this->get( 'type' ) . '&' . self::$query_vars[1] . '=1';
            return $rules;
    }

    https://www.ads-software.com/plugins/wp-amd/

  • The topic ‘4.5 fix’ is closed to new replies.