WordPress.org

Ready to get started?Download WordPress

Forums

Duplicate Post
[resolved] Notice in 2.2 (3 posts)

  1. sparkweb
    Member
    Posted 2 years ago #

    One of my front-facing plugin pages (where I've admittedly been messing with the post vars) I'm getting a Notice:

    Notice: Undefined variable: post in /xxxxxxxxx/wp-content/plugins/duplicate-post/duplicate-post-common.php on line 104 Notice: Trying to get property of non-object in /xxxxxxxxxxx/wp-content/plugins/duplicate-post/duplicate-post-common.php on line 104

    That's this line:

    'href' => duplicate_post_get_clone_post_link( $post->ID )

    If I add $post to the global at the top of that function it makes the notice go away and all still seems to work fine. Interestingly enough, the link still works, despite the notice.

    Just wanted to let you know in case it's worth fixing in the next update. Thanks for the great work!

    http://wordpress.org/extend/plugins/duplicate-post/

  2. lopo
    Member
    Plugin Author

    Posted 2 years ago #

    Hi,
    thank you, another user already told me about this, I fixed it by changing 'href' => duplicate_post_get_clone_post_link( $post->ID ) to 'href' => duplicate_post_get_clone_post_link( $current_object->ID ) (that's the way it was intended to be).
    The fix will be out in the next version, with a couple of other fixes.

    Thank you, bye!

  3. lopo
    Member
    Plugin Author

    Posted 2 years ago #

    Hi,
    version 2.3 (out now) includes the fix for this bug.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic