WordPress.org

Ready to get started?Download WordPress

Forums

Disqus Comment System
Only variables should be assigned by reference in "dsq_prev_permalink" (3 posts)

  1. myefreelance
    Member
    Posted 8 months ago #

    There is an extra character "&" in "get_post".

    function dsq_prev_permalink($post_id) {
        // if post not published, return
        $post = &get_post($post_id);
        if ($post->post_status != 'publish') {
            return;
        }
        global $dsq_prev_permalinks;
        $dsq_prev_permalinks['post_'.$post_id] = get_permalink($post_id);
    }

    [Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum's parser.]

    http://wordpress.org/plugins/disqus-comment-system/

  2. schneidan
    Member
    Posted 8 months ago #

    I got a plethora of PHP errors in my admin console related to this issue, too ("Warning: Cannot modify header information - headers already sent...").

    I removed the ampersand on line 1240 of disqus.php and it seems to have solved the problem.

    Original line:

    $post = &get_post($post_id);

    Corrected:

    $post = get_post($post_id);

  3. chinanderm
    Member
    Posted 7 months ago #

    I had this same issue this morning as well. I was able to fix it by doing BOTH of the corrections below:

    1) Outputting Javascript in footer (see Disqus plugin settings in Dashboard)
    2) Removing the "&" symbol in front of get_post($post_id); on line 1240 of disqus.php.

    Disqus needs to update plugin soon to get that & removed!

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.