• Resolved Mike

    (@mgriffis)


    Does the thank you page ( cctm_post_form _redirect ) have access to the custom post type data that was just created (in draft mode)?

    I’d like the thank you page to parrot some of the information that was just saved in the database via the cctm_post_form. How do I know the post ID for that data, when I’m on the thank you page?

    Thanks.

    http://ww.wp.xz.cn/plugins/custom-content-type-manager/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor fireproofsocks

    (@fireproofsocks)

    Good question. Unfortunately, that’s not currently supported — the “redirect” is just a Javascript window.location.replace (because WordPress has already sent HTTP headers, the redirect can’t be low-level).

    It would be relatively easy to modify the code inside includes/CCTM.php post_form_handler() function so it passed the $post_id along with the redirect, e.g. as a $_GET URL parameter. Then your landing page could read the post_id and lookup the data (e.g. using a PHP Snippet: http://ww.wp.xz.cn/plugins/php-snippets/).

    Maybe something like:

    $redirect = CCTM::get_value($args, '_redirect');
    if ($redirect) {
    	$url = get_permalink($redirect.'&new_post_id='.$post_id);
    	CCTM::redirect($url, true);
    }

    Would make a good feature request…

    Thread Starter Mike

    (@mgriffis)

    Thanks! I”ll give that a try.

    And I’ve submitted a feature request:

    http://code.google.com/p/wordpress-custom-content-type-manager/issues/detail?id=522

    Plugin Contributor fireproofsocks

    (@fireproofsocks)

    I’ll follow up in the bug tracker.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘cctm_post_form _redirect’ is closed to new replies.