Add action save post when create and publish

I think one key question here is how _select_match_from_id meta value is saved? Is it some metafield on the post edit screen or from some other logic? If I may assume that it is from a metafield, then you could just read its value from the $_POST array. You could also improve your code by … Read more

Is it possible to detect if a POST action is for a “Save Post” before the save_post action?

Take a look at the Plugin API/Action Reference: Actions Run During an Admin Page Request.. Then add something simple to the appropriate hook: function wpse19260_inspect_post() { echo ‘<pre>’; // print_r( $_POST ); echo $_POST->ID; echo $_POST->post_content; echo $_POST->post_title echo ‘<pre>’; } add_action( ‘publish_post’, ‘wpse19260_inspect_post’ );

unable to save custom taxonomy terms in a custom-built metabox in wp-admin

Rather than ‘returning’ on a failure of authentication check, die with an appropriate message: For example: if ( !wp_verify_nonce( $_POST[‘states_noncename’], plugin_basename( __FILE__ ) ) ) wp_die(“Nonce-check failure”); This will indicate on what check (if any) that you are failing. In most cases, I would advise doing this rather than returning as it gives the user … Read more

Custom Post Type Meta Box Text Input Field Won’t Save When Blank

The problematic line is this one: if (isset($_POST[“book_title”]) && $_POST[“book_title”] <> ”) update_post_meta($post->ID, “book_title”, $_POST[“book_title”]); That logic says: If the submitted form contains a field called ‘book_title’ and if the content of the ‘book_title’ field does not equal an empty string, then save it. In your situation, the first condition should be met (HTML input … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)