themeskult / wp-svbtle

Wordpress Admin & Theme inspired by Svbtle
http://wp-svbtle.com
1.45k stars 220 forks source link

admin bar item not working, when wordpress is not in document root #126

Closed shorshe closed 11 years ago

shorshe commented 11 years ago

in functions.php line 494 has a absolute path to the wp-svbtle admin interface. This breaks, when worpress (and thus the admin interface) is not in doc root.

add_action('admin_bar_menu', 'add_items',  100);
function add_items($admin_bar)
{
    global $post;

    $args = array(
            'id'    => 'wp-svbtle-editor',
            'title' => 'wp-svbtle editor',
            'href'  => '/wp-svbtle',
            'meta'  => array('title' => __('wp-svbtle editor'))
            );

    if (is_single() or is_page()) {
        $args['href'] = get_bloginfo('url') . '/wp-svbtle/index.php?page=edit&id='.$post->ID;
        $args['title'] = 'Edit post with wp-svbtle';
    }

    //This is where the magic works.
    $admin_bar->add_menu( $args);
}
dasrecht commented 11 years ago

@shorshe i made a fix... you can get the file out of my pullrequest or wait until it's merged into upstream....

/bastian

bgadoci commented 11 years ago

Man I was wrestling with this all night last night. Glad to see it wasn't just me.

bgadoci commented 11 years ago

It's coming from the addition of the also read stuff as far as I can tell.

shorshe commented 11 years ago

@dasrecht Hey, saw your fix. Thanks that was quick. I patched manually.