From 8326925eaf7926535f43f259d0d5215a83d45397 Mon Sep 17 00:00:00 2001 From: Siroco Date: Sun, 8 Jan 2023 21:14:14 +0000 Subject: [PATCH] Add: Date Soundmaker Metabox --- soundmap.php | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/soundmap.php b/soundmap.php index c00aa62..e7959d9 100644 --- a/soundmap.php +++ b/soundmap.php @@ -91,16 +91,24 @@ if (!class_exists('Soundmap')){ function metaboxes_register_callback(){ add_meta_box('soundmap-map', __("Place the Marker", 'soundmap'), array($this, 'map_meta_box'), 'marker', 'normal', 'high'); add_meta_box('soundmap-media-info', __("Info", 'soundmap'), array($this,'info_meta_box'), 'marker', 'side', 'high'); - add_meta_box('soundmap-media-attachments', __("Media files attached.", 'soundmap'), array($this, 'attachments_meta_box'), 'marker', 'side', 'high'); - // Ya no es necesario - //add_meta_box('soundmap-email', __("Uploader Mail", 'soundmap'), array($this, 'email_meta_box'), 'marker', 'side', 'low'); + add_meta_box('soundmap-media-attachments', __("Media files attached.", 'soundmap'), array($this, 'attachments_meta_box'), 'marker', 'side', 'high'); + add_meta_box('soundmap-media-date', __("Media data registered.", 'soundmap'), array($this, 'date_meta_box'), 'marker', 'side', 'high'); + // Ya no es necesario + //add_meta_box('soundmap-email', __("Uploader Mail", 'soundmap'), array($this, 'email_meta_box'), 'marker', 'side', 'low'); } //metaboxes_register_callback + function date_meta_box( $post ) { + $custom_date = get_post_meta( $post->ID, 'soundmap_marker_date', true ); + ?> + + ID, 'EMAIL', TRUE); echo "

" . $mail . "

"; - } + } function info_meta_box(){ @@ -124,9 +132,9 @@ if (!class_exists('Soundmap')){ $data = wp_prepare_attachment_for_js( $file ); $out .= "
-
{$data['title']}
+
{$data['title']}

Borrar
"; } @@ -325,10 +333,12 @@ if (!class_exists('Soundmap')){ $soundmark_lat = $_POST['soundmap_marker_lat']; $soundmark_lng = $_POST['soundmap_marker_lng']; $soundmark_author = $_POST['soundmap_marker_author']; + $soundmark_date = $_POST['soundmap_marker_date']; update_post_meta($post_id, 'soundmap_marker_lat', $soundmark_lat); update_post_meta($post_id, 'soundmap_marker_lng', $soundmark_lng); update_post_meta($post_id, 'soundmap_marker_author', $soundmark_author); + update_post_meta($post_id, 'soundmap_marker_date', $soundmark_date); //before searching on all the $_POST array, let's take a look if there is any upload first!