I’ve given up on programing about 17 years ago, in the times before proper internet in my country. Now I can’t afford a programer so i’ve taken up the task myself, yet my limited coding knowledge seems to have gotten me quite stuck..
Situation:
in wordpress, i have the folowing keys stored in the postmeta table for each post_id: awb_urgent_cargus, _fgo_invoice_link
Problem:
I need to create a shortcode that should display 2 input fields: [$post_id] and [$awb]. If the user enters a matching pair he gets the corresponding invoice link from the same $post_id.
Basicly after submiting,
if the corresponding awb_urgent_cargus key for the input [$post_id] is the value of input [$awb] then return the value for the key _fgo_invoice_link
else, return error
I found some documentation for this but i got stuck writing the code … couldn’t even get the inputs working 🙁
I think that swiching from ms-dos coding in c++ / pascal to the web is quite a bit over my head and while i managed to get around and modify examples for other stuff this one just simpli doesn’t click
get_post_meta( int $post_id, string $key = ”, bool $single = false );
2
Answers
You could handle input with ajax, wordpress requires you to register allowed actions on backend, perform your check and return the result.
—
You can put it all together like this.
and use like this [show_post_meta_value post_id="yourpostidhere"]