• Resolved ratterobert

    (@ratterobert)


    Will the value entered in the “query var” field be used like the category base in the permalinks-settings? If its intended like that, I have to say it doesn’t work.

Viewing 5 replies - 1 through 5 (of 5 total)
  • I am also wondering how is the Query Var field used. The link in WP plugin info page leads to a page with a link to github page which says nothing to see there.

    Class.client.php seems to be the code where it’s used, starting from line 42:

    // Rewrite
    if ( $taxonomy['rewrite'] == 'true' ) {
      $taxonomy['rewrite'] = array( 'slug' => $taxonomy['query_var'], 'with_front' => true, 'hierarchical' => false );
    }

    This is because of a bug in the code, if you want to restore this logic until the dev gets around to it, you should be able to edit class.client.php. I have posted changes in the gist below but here is a summary. Make sure to update your permalinks after setting the query var otherwise you might run into some issues with links not working.

    to replicate how the var was being handled i first added

    $taxonomy['rewrite'] = (boolean) $taxonomy['rewrite'];

    above line 43

    if ( $taxonomy['rewrite'] == 'true' ) {
    $taxonomy['rewrite'] = array('slug' => $taxonomy['query_var'],'with_front' => true, 'hierarchical' => false);
    }

    which i also tweaked a bit to be

    if ($taxonomy['rewrite']) {
    $taxonomy['rewrite'] = array( 'slug' => $taxonomy['query_var'], 'with_front' => true, 'hierarchical' => false );
    }

    then removed

    (boolean)

    from line 56

    'rewrite' => (boolean) $taxonomy['rewrite'],

    https://gist.github.com/1621776/4ad0180cd370508d04fd4976bad761848384589e

    How does the Query Var setting behave after this?

    Plugin Author Amaury Balmer

    (@momo360modena)

    Thanks for reporting
    This bug will be fixed on version 3.4.1

    Changes on :
    https://github.com/herewithme/simple-taxonomy/commit/f1fe8bd6c6d02643e3a23da8e0a0258080728442

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Permalink Base = Query Var?’ is closed to new replies.