• Resolved alex.bradaric

    (@alexbradaric)


    Hi,

    The plugin was breaking the admin bar on individual posts (not on pages). Tracked it down to post ID detection code (for Purge Current Page menu item).

    Here’s the diff:

    diff --git a/wp-content/plugins/w3-total-cache/Util_Environment.php b/wp-content/plugins/w3-total-cache/Util_Environment.php
    index 22bd41821..87ac0bcfb 100644
    --- a/wp-content/plugins/w3-total-cache/Util_Environment.php
    +++ b/wp-content/plugins/w3-total-cache/Util_Environment.php
    @@ -1038,8 +1038,8 @@ class Util_Environment {
                            return $post_ID;
                    } elseif ( $comment_post_ID ) {
                            return $comment_post_ID;
    -               } elseif ( ( is_single() || is_page() ) && isset( $posts[0]->ID ) ) {
    -                       return $posts[0]->ID;
    +               } elseif ( ( is_single() || is_page() ) && isset( $posts->posts[0]->ID ) ) {
    +                       return $posts->posts[0]->ID;
                    } elseif ( isset( $posts->ID ) ) {
                            return $posts->ID;
                    } elseif ( isset( $_REQUEST['p'] ) ) {
    • This topic was modified 4 years, 9 months ago by alex.bradaric.
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘WP Admin Bar Issue’ is closed to new replies.