Why can not I select from the database meta data to be inserted in the message body?
example1 subscribe2.php in function substitute($string = '', $post_ID):
...
$sent = get_post_meta($post_ID, 'my_meta', true);
...
$string = str_replace("{TITLE}", stripslashes($sent), $string);
...
$post_ID passed to the function. Dont work, $sent is empty
example2 subscribe2.php in function substitute($string = '', $post_ID):
...
$results = $wpdb->get_results("SELECT meta_key, meta_value FROM wp_postmeta WHERE post_id = $post_ID");
foreach ($results as $result){
......
}
...
$string = str_replace("{TITLE}", stripslashes($sent), $string);
...
Dont work, $sent is empty
selecting only: edit_lock, s2mail, _edit_last
Why can not retrieve other metadata?