I am trying to:
Using the cred_save_date api hook I'm trying to access a post reference field using the get_post_meta function. However I am seeing that the post_reference meta is not even stored as part of the parent post I was editing. In some cases it is showing however.
Link to a page where the issue can be seen:
I expected to see: Here you can see I"m printing out the post fields using the get_custom_post($post_id) call on the cred_save_data hook. Here it is showing the wpcf_attorney post meta which is a post reference field. t
[28-Nov-2018 21:41:05 UTC] Array
(
[_wp_page_template] => Array
(
[0] => default
)
[wpcf-follow-up] => Array
(
[0] =>
)
[_wp_old_slug] => Array
(
[0] => cred-auto-draft-ea3b6e897ca15c0696dede64cf069ca5
)
[wpcf-statement-confirmation-received] => Array
(
[0] => 0
)
[wpcf-pfp-billed-amount] => Array
(
[0] =>
)
[wpcf-reduction-letter-amount] => Array
(
[0] =>
)
[wpcf-final-payment-amount] => Array
(
[0] =>
)
[wpcf-write-off-amount] => Array
(
[0] =>
)
[wpcf-profitability] => Array
(
[0] =>
)
[wpcf-case-status] => Array
(
[0] =>
)
[wpcf-sales-rep-assigned] => Array
(
[0] => 12
)
[_edit_lock] => Array
(
[0] => 1543418787:1
)
[_edit_last] => Array
(
[0] => 2
)
[wpcf-patient-last-name] => Array
(
[0] => fffff
)
[wpcf-patient-first-name] => Array
(
[0] => ssss
)
[wpcf-attorney] => Array
(
[0] => 152
)
[wpcf-chiropratic-clinic] => Array
(
[0] => 274
)
[wpcf-medical-clinic] => Array
(
[0] => 274
)
[wpcf-clinic-city] => Array
(
[0] => Irving
)
[wpcf-doctor] => Array
(
[0] => 157
)
[_wpcf-ops-notes-sort-order] => Array
(
[0] => a:1:{i:0;i:3490;}
)
[site-sidebar-layout] => Array
(
[0] => default
)
[site-content-layout] => Array
(
[0] => default
)
[wpcf-ops-notes] => Array
(
[0] =>
)
[wpcf-lop-entry-date] => Array
(
[0] => 1543276800
)
[wpcf-patient-dob] => Array
(
[0] => 593740800
)
[wpcf-date-of-injury] => Array
(
[0] => 1542844800
)
[wpcf-date-shipped] => Array
(
[0] => 1543276800
)
[wpcf-lop-requested] => Array
(
[0] => 1543276800
)
)
Instead, I got:
In this post print as you see the wpcf-attorney is not present even though that is set on teh Post in the front-end
[28-Nov-2018 21:49:19 UTC] Array
(
[_wp_page_template] => Array
(
[0] => default
)
[_wp_old_date] => Array
(
[0] => 2018-11-27
)
[wpcf-follow-up] => Array
(
[0] =>
)
[wpcf-patient-last-name] => Array
(
[0] => llll
)
[wpcf-patient-first-name] => Array
(
[0] => rrrrrr
)
[wpcf-clinic-city] => Array
(
[0] => Arlington
)
[_wp_old_slug] => Array
(
[0] => cred-auto-draft-ea3b6e897ca15c0696dede64cf069ca5
)
[wpcf-statement-confirmation-received] => Array
(
[0] => 0
)
[wpcf-pfp-billed-amount] => Array
(
[0] =>
)
[wpcf-reduction-letter-amount] => Array
(
[0] =>
)
[wpcf-final-payment-amount] => Array
(
[0] =>
)
[wpcf-write-off-amount] => Array
(
[0] =>
)
[wpcf-profitability] => Array
(
[0] =>
)
[wpcf-case-status] => Array
(
[0] =>
)
[wpcf-sales-rep-assigned] => Array
(
[0] => 12
)
[_edit_lock] => Array
(
[0] => 1543418816:1
)
[wpcf-ops-notes] => Array
(
[0] => 2018-11-28: (start your comments here)
)
[wpcf-lop-entry-date] => Array
(
[0] => 1543276800
)
[wpcf-patient-dob] => Array
(
[0] => 110073600
)
[wpcf-date-of-injury] => Array
(
[0] => 1542067200
)
[wpcf-date-shipped] => Array
(
[0] => 1543363200
)
[wpcf-lop-requested] => Array
(
[0] => 1543276800
)
)