Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7887197
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:30:59+00:00 2026-06-03T05:30:59+00:00

I have some custom post meta being generated and am ready to add to

  • 0

I have some custom post meta being generated and am ready to add to a post’s meta. I know how to do this. However, save_post causes a redirection after POST data has been sent. This means I am redirected to the dashboard and lose access to my POST data – therefore I cannot debug easily.

Currently I am using something like:

add_action('save_post', 'something_process');

function something_process() {
   if(defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) 
       return;
   print_r($_POST);
}

Is there a way to easily debug this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T05:31:01+00:00Added an answer on June 3, 2026 at 5:31 am

    The best approach for me has been to use a function to log the values to wp-content/debug.log, lifted from http://fuelyourcoding.com/simple-debugging-with-wordpress:

    if(!function_exists('log_it')){
     function log_it( $message ) {
       if( WP_DEBUG === true ){
         if( is_array( $message ) || is_object( $message ) ){
           error_log( print_r( $message, true ) );
         } else {
           error_log( $message );
         }
       }
     }
    }
    

    Then use the function like this in your save_post hook:

    log_it($_POST);
    log_it('The value for ' . $custom_field . ' is ' . $_POST[$custom_field]);
    

    Make sure that wp-content/debug.log is writable, and that you have debugging enabled in wp-config.php:

    @ini_set('display_errors',0);
    define( 'WP_DEBUG',         true );  // Turn debugging ON
    define( 'WP_DEBUG_DISPLAY', false ); // Turn forced display OFF
    define( 'WP_DEBUG_LOG',     true );  // Turn logging to wp-content/debug.log ON
    define( 'WP_POST_REVISIONS', false); // Disables revision functionality
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an XSL style sheet for which I need to add some custom
can anybody help me with this ? I have added some custom fields to
I made some meta_values under a custom post type called 'Show'. I have confirmed
On my homepage I am bringing in some custom post types using this: <?php
I am doing some custom audio post-processing using audio units. I have two files
I have some custom post types, such as 'review'. I can't seem to find
I have some custom type: [RdfSerializable] public class Item { [RdfProperty(true)] public string Name
I have some custom logic that needs to be executed every single time a
I have some existing custom Excel workbooks/applications with code-behind C#, which work fine. They
I have authored some custom classes that I would like to create using XAML:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.