Need help fixing Custom WordPress Re-route getting custom meta for posts from custom table
$10-30 USD
Cerrado
Publicado hace más de 9 años
$10-30 USD
Pagado a la entrega
I am currently working on Re-route custom meta for posts. I have successfully made the values spit out on the page using an echo but when I return the values into the input fields I only get the first letter of each one. I have tried multiple things and have had no success. I would like someone to resolve this problem and also write a loop to then display these fields on a custom post template.
Here is the function that has the issue:
add_action( ‘get_post_metadata’, ‘my_custom_meta_get’, 0, 3 );
function my_custom_meta_get( $check, $post_id, $meta_key ) {
// var_dump($meta_key);
if ( get_post_type( $post_id) == ‘schools’ && in_array( $meta_key, array( ‘[login to view URL]’, ‘[login to view URL]’, ‘address’, ‘zip’, ‘phone’ ) ) ) {
global $wpdb;
$result = $wpdb->get_var( $wpdb->prepare(”
SELECT $meta_key
FROM wp_schoolInfo
inner join USZipCodes on [login to view URL] = [login to view URL]
inner join wp_post_to_schoolinfo on [login to view URL] = [login to view URL]
inner join wp_posts on [login to view URL] = wp_post_to_schoolinfo.post_id
WHERE post_id = %d
“, $post_id) );
return maybe_unserialize( $result );
} else {
return null;
}
}
I have read your project details, and I am interested in offering my services.
I provide 100% satisfaction guaranteed on all my work.
Milestone is required to begin; to be released when the job has been satisfactorily completed.
I estimate a 1-2hr turnaround (including weekends) on this project.
Contact me at your soonest convenience so we may get your solution delivered quickly.
Thanks,
coderXO
Hello!
With 99% completion rate, 740 successfully completed projects, and a 5.00 reputation (maximum possible, 5.0) (Yes, not even 4.99 average rating, can be verified on my profile page https://www.freelancer.com/u/rajeshsonisl.html !!)... you can never go wrong choosing me :)
I look forward to your reply.
Thanks.
Kind Regards,
Rajesh Soni
Dear Sir. We claim to get it done perfectly for you EXACTLY in the way you want it - Kindly give we a chance and we will prove myself -
Ready to prove our words, let's get it done right away and I mean RIGHT AWAY !!
Looking forward to hear from you soon - GOD Bless You.
Hi. I have more than 3 years experience working with Wordpress and PHP so I am sure I will prove to be an excellent developer and complete the task as requested, on-time and on-budget.
Thanks,
Vlad.