WordPress.org

Ready to get started?Download WordPress

Forums

WP User Frontend
How can i get the id of the post i am editing on the edit post page (2 posts)

  1. Connor Miles
    Member
    Posted 1 year ago #

    hello,

    i have come up with a really good idea to preview the post as your editing it and that is to get a iframe with a src of http://localhost/?p=<?php the_ID(); ?>&preview=true but unfortunately this creates a infinate loop of iframes of the actual edit page not the page your editing in the edit page.

    so i am looking to get the id of the page im editing in the edit page.

    Thanks in advanced..

    ps. would be cool "like that preview commments thing on css-tricks"

    http://wordpress.org/extend/plugins/wp-user-frontend/

  2. professor99
    Member
    Posted 1 year ago #

    the_ID() only works for posts being displayed by the loop

    From it's Codex desciption

    Displays the numeric ID of the current post. This tag must be within The Loop.

    .

    In any case there's more too it that just using the preview=true url with the id of the post.

    FrontEnd uses the WordPress wp_editor() function to edit the post which displays the post in the TinyMCE editor.

    To preview the post you could try emulating the code for the Preview buttons for the standard admin Add New Post (post-new.php) and Edit Post (post.php) pages.

    It would be nice to have this as a feature of Frontend so if you have any luck please let us know.

    Cheers
    TheProfessor

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags