Website Summary Files Commits Branches @commit @diff @stats
path: root / wp-content / plugins / dx-cars
diff options
context:
space:
mode:
Commitcf1261ebf098dc0e644544ca2e57ceadfe51c476 (patch)
Author
 pgmatev <petargabriel.matev@gmail.com>
2020-07-13 19:03:33 +0300
Committer
 pgmatev <petargabriel.matev@gmail.com>
2020-07-13 19:03:33 +0300
Files83da65e5bfc806bdd311201e5cc27354612dbe04 /wp-content/plugins/dx-cars
tues-interns-2020-feature-users-cm.tar
tues-interns-2020-feature-users-cm.tar.gz
tues-interns-2020-feature-users-cm.zip
Parenta31eb16e5edbb293e8714f70c5f88d89dcc5e29d (diff)
fixed saving after validation; changed file names to match proposed naming feature-users-cm
2 files changed, 27 insertions, 0 deletions
-rw-r--r--wp-content/plugins/dx-cars/car-info-display-callback.php27
-rw-r--r--wp-content/plugins/dx-cars/dx-vehicles.php (renamed from wp-content/plugins/dx-cars/dx-cars.php)0
diff --git a/wp-content/plugins/dx-cars/car-info-display-callback.php b/wp-content/plugins/dx-cars/car-info-display-callback.php
new file mode 100644
index 0000000..b8931aa
--- /dev/null
+++ b/wp-content/plugins/dx-cars/car-info-display-callback.php
@@ -0,0 +1,27 @@
+<table>
+ <tr>
+ <td><?php _e( 'Year:' ) ?></td>
+ <td><input type="text" name="car-year" value="<?php echo( sanitize_text_field( get_post_meta( get_the_ID(), __( 'car-year' ), true ) ) ) ?>"></td>
+ </tr>
+ <tr>
+ <td><?php _e( 'Millage:' ) ?></td>
+ <td><input type="text" name="car-millage" value="<?php echo( sanitize_text_field( get_post_meta( get_the_ID(), __( 'car-millage' ), true ) ) ) ?>"></td>
+ </tr>
+ <tr>
+ <td><?php _e( 'Price:' ) ?></td>
+ <td><input type="text" name="car-price" value="<?php echo( sanitize_text_field( get_post_meta( get_the_ID(), __( 'car-price' ), true ) ) ) ?>"></td>
+ </tr>
+ <tr>
+ <td><?php _e( 'Photo:' ) ?></td>
+ <td><input type="file" name="car-images[]" value="" multiple></td>
+ </tr>
+ <tr>
+ <td><?php _e( 'Uploaded photo<br>(might need page refresh):' ) ?></td>
+ <?php
+ $images = ( array )json_decode( get_post_meta( get_the_ID(), __( 'car-images' ), true ) );
+ foreach ( $images as $image ) {
+ echo( '<td> <img src="' . $image . '" alt=""></td>' );
+ }
+ ?>
+ </tr>
+</table>
diff --git a/wp-content/plugins/dx-cars/dx-cars.php b/wp-content/plugins/dx-cars/dx-vehicles.php
index e4bdaf0..e4bdaf0 100644
--- a/wp-content/plugins/dx-cars/dx-cars.php
+++ b/wp-content/plugins/dx-cars/dx-vehicles.php