Developer's Custom Fields
Post ID within register function (1 post)

  1. ch8rt
    Posted 4 years ago #

    Hi guys,

    I'm trying to get the ID of the post being edited from within the register_my_custom_fields function, and having tried a number of different methods I've hit a brick wall.

    I've tried...
    global $post; $post_id = $post->ID;
    global $post; $post_id = ($post_id)?($post_id):($post->ID);
    global $wp_query; $post_id = $wp_query->post->ID;
    $post_id = the_ID();

    But as I said before, its always blank.

    The reason for wanting the ID at this stage is so I can check on the value of other meta fields and show additional fields in response.

    Any ideas?


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Developer's Custom Fields
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.