Skip to content

Commit

Permalink
add spécial & remove extra log
Browse files Browse the repository at this point in the history
  • Loading branch information
yoanmarchal committed Aug 16, 2018
1 parent 5fc5ad1 commit 586f026
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
15 changes: 9 additions & 6 deletions admin/class-map-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ function store_infos($post)
$adresse = get_post_meta($post->ID, '_adresse', true);
$mail = get_post_meta($post->ID, '_mail', true);
$phone = get_post_meta($post->ID, '_phone', true);
$special = get_post_meta($post->ID, '_special', true);

$coords = get_post_meta($post->ID, '_coords', true);
get_post_meta($post->ID, '_defined_coords', true);
Expand All @@ -134,14 +135,13 @@ function store_infos($post)
<input type="checkbox" name="defined_coords" checked="checked" value="1" id="defined_coords"> <label for="defined_coords">Coordonnées définies manuellement</label>
</p>
<p>
<input type="text" name="mail" value="<?php echo $mail;
?>" placeholder="<?= __('Email', 'map-plugin');
?>" />
<input type="text" name="mail" value="<?= $mail;?>" placeholder="<?= __('Email', 'map-plugin'); ?>" />
</p>
<p>
<input type="text" name="phone" value="<?php echo $phone;
?>" placeholder="<?= __('Phone', 'map-plugin');
?>" />
<input type="text" name="phone" value="<?= $phone;?>" placeholder="<?= __('Phone', 'map-plugin'); ?>" />
</p>
<p>
<input type="text" name="special" value="<?= $special;?>" placeholder="<?= __('Special', 'map-plugin'); ?>" />
</p>
<script type="text/javascript">// <![CDATA[
jQuery(document).ready(function($){
Expand Down Expand Up @@ -228,6 +228,9 @@ public function saveMetabox($postId)
if ($phone) {
update_post_meta($postId, '_phone', $phone);
}
if ($special) {
update_post_meta($postId, '_special', $special);
}
$adress = filter_input(INPUT_POST, '_adress', FILTER_SANITIZE_STRING);
if ($adress) {
$adresse = $adress;
Expand Down
1 change: 0 additions & 1 deletion admin/js/map-admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,4 @@
* Although scripts in the WordPress core, Plugins and Themes may be
* practising this, we should strive to set a better example in our own work.
*/
console.log('hoy');
})( jQuery );

0 comments on commit 586f026

Please sign in to comment.