Changeset 1430794
- Timestamp:
- 06/05/2016 10:39:29 AM (10 years ago)
- Location:
- react-webcam/tags/1.2.0
- Files:
-
- 1 edited
- 2 copied
-
. (copied) (copied from react-webcam/tags/1.1.0)
-
react-webcam.php (modified) (4 diffs)
-
readme.txt (copied) (copied from react-webcam/tags/1.1.0/readme.txt)
Legend:
- Unmodified
- Added
- Removed
-
react-webcam/tags/1.2.0/react-webcam.php
r1241407 r1430794 23 23 wp_enqueue_script('ReactWebcam_ActualImage', plugins_url('js/ActualImage.js', __FILE__), array('react')); 24 24 25 $upload_ dir= wp_upload_dir();25 $upload_path = wp_upload_dir(); 26 26 27 27 $ajax_url = admin_url('admin-ajax.php'); 28 $webcam_url = $upload_ dir['baseurl'] . '/' . WEBCAM_DIR . '/';29 $initial_image_url = $webcam_url . '/' . get_last_filename( );28 $webcam_url = $upload_path['baseurl'] . '/' . WEBCAM_DIR . '/'; 29 $initial_image_url = $webcam_url . '/' . get_last_filename(WEBCAM_DIR); 30 30 31 31 return ' … … 47 47 48 48 // Returns filename of the last webcam image. 49 function get_last_filename( ) {49 function get_last_filename($webcam_dir) { 50 50 51 $filenames = get_filenames( );51 $filenames = get_filenames($webcam_dir); 52 52 53 53 $last_filename = end($filenames); … … 59 59 60 60 // Returns list of all webcam image filenames. 61 function get_filenames( ) {61 function get_filenames($webcam_dir) { 62 62 63 $upload_ dir= wp_upload_dir();64 $webcam_ dir = $upload_dir['basedir'] . '/' . WEBCAM_DIR. '/';63 $upload_path = wp_upload_dir(); 64 $webcam_path = $upload_path['basedir'] . '/' . $webcam_dir . '/'; 65 65 66 66 $filenames = array(); 67 foreach (glob($webcam_ dir. '*') as $path) {67 foreach (glob($webcam_path . '*') as $path) { 68 68 array_push($filenames, basename($path)); 69 69 } … … 75 75 // AJAX call handler to return last webcam image filename. 76 76 function last_image() { 77 echo get_last_filename( );77 echo get_last_filename(WEBCAM_DIR); 78 78 wp_die(); 79 79 }
Note: See TracChangeset
for help on using the changeset viewer.