Fatal error: Call to undefined function get_header() in /home/u888029364/public_html/wp-content/themes/sam-download-tr/submit.php on line 77
sorun nedir?
Fatal error: Call to undefined function get_header() in /home/u888029364/public_html/wp-content/themes/sam-download-tr/submit.php on line 77
/*
Template Name: Submit Program
*/
?>
if( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == "new_post") {
// Do some minor form validation to make sure there is content
if ($_POST['title'] != '') {
$title = $_POST['title'];
} else {
echo 'Program adını yazınız.';
return false;
}
if ($_POST['website'] != '') {
$website = $_POST['website'];
} else {
echo 'Website adresini yazınız.';
return false;
}
if ($_POST['imageurl'] != '') {
$imageurl = $_POST['imageurl'];
} else {
echo 'Resim adresi yazınız.';
return false;
}
if ($_POST['download'] != '') {
$download = $_POST['download'];
} else {
echo 'Dosya adresini yazınız.';
return false;
}
if ($_POST['description'] != '') {
$description = $_POST['description'];
} else {
echo 'Açıklama yazınız.';
return false;
}
$website = $_POST['website'];
$imageurl = $_POST['imageurl'];
$download = $_POST['download'];
$description = $_POST['description'];
// ADD THE FORM INPUT TO $new_post ARRAY
$new_post = array(
'post_title' => $title,
'post_status' => 'draft', // Choose: publish, preview, future, draft, etc.
'post_type' => 'post', //'post',page' or use a custom post type if you want to
'post_content' => $description,
'website' => $website,
'imageurl' => $imageurl,
'download' => $download
);
//SAVE THE POST
$pid = wp_insert_post($new_post);
//ADD OUR CUSTOM FIELDS
add_post_meta($pid, 'website', $website, true);
add_post_meta($pid, 'imageurl', $imageurl, true);
add_post_meta($pid, 'download', $download, true);
//INSERT OUR MEDIA ATTACHMENTS
//redirect to newly created post
wp_redirect( '../tesekkurler/' );
exit();
} // END THE IF STATEMENT THAT STARTED THE WHOLE FORM
?>
Bulunamadı
Üzgünüz, ancak aradığınız burada değil.