0
Hello friends when I put there "Hemerson Assuncao" sends more when I put with acetos type Assunção does not send example
add_post_meta($id, 'full name','Hemerson Assunção');
Someone of that force There follows my code complete below
<?php
require_once 'wp-load.php';
require_once ABSPATH . 'wp-admin/includes/taxonomy.php';
// Cria o post
$id = wp_insert_post(array(
'post_title' => 'Pedido de Gas',
'post_content' => $pedido,
// 'post_date' => date('Y-m-d H:i:s'),
// 'post_author' => $user_id,
'post_type' => 'pedidos',
'post_status' => 'publish',
));
if ($id) {
// criacao de categoria
wp_set_post_terms($id, wp_create_category('gas'), 'category');
// Campos Pesonalizados
add_post_meta($id, 'nome_completo','Hemerson Assunção');
add_post_meta($id, 'endereco',$endereco);
add_post_meta($id, 'numero',$numero);
add_post_meta($id, 'bairro',$bairro);
add_post_meta($id, 'contato',$contato);
add_post_meta($id, 'troco',$troco);
add_post_meta($id, 'total',$total);
} else {
echo "WARNING: Failed to insert post into WordPress\n";
}
?>
Don’t send to where?
– Willian Coqueiro
Anything uses utf8_encode.
– Willian Coqueiro
For the wordpress panel
– Hemerson Prestes
No. Where you define your name. Make a variable declaring unnamed inside the utf8_encode and test. Type $name = utf8_encode('Hemerson Assumption');
– Willian Coqueiro
There where you entered your name puts the variable without quotation marks.
– Willian Coqueiro
Like this: <?php $full name = utf8_encode $_POST['full name'];?>
– Hemerson Prestes
Like this: <?php $full name = utf8_encode($_POST['full name']);?>
– Willian Coqueiro
If it doesn’t, try utf8_decode
– Willian Coqueiro
It worked out my director filet I’ll put a UP for you thanks!
– Hemerson Prestes
I answered. Give as correct answer.
– Willian Coqueiro