<?php
global $post;
if ( isset( $_POST['submit'] ) )
{
if( ! isset( $post ) ) {
echo 'Error: Nichts ausgewählt';
die();
}
else if( ! isset( $_POST['frontstrasse'] ) && ! empty( $_POST['frontstrasse'] ) ){
echo 'Error: Strasse Not Set';
die();
}
update_post_meta( $order->id, 'frontstrasse', sanitize_text_field( $_POST['Strasse'] ) );
}
$istrasse = get_post_meta($order->id, 'Strasse', true );
echo print_r($istrasse);
?>
<form method="post" action="">
<input type='text' name='frontstrasse' value='<?php echo isset($istrasse) ? $istrasse : ''; ?>' />
<input type='submit' value='save' />
</form>
Pieter Goosen
- 55.4k
- 23
- 115
- 209