@@ 1495-1499 (lines=5) @@ | ||
1492 | //if the file is located remotely, download it to our uploads DIR, because wp_genereate_attachmnet_metadata needs the file to be local |
|
1493 | if (strpos($guid, $wp_upload_dir['url']) === false) { |
|
1494 | //image is located remotely. download it and place it in the uploads directory |
|
1495 | if ( ! is_readable($guid)) { |
|
1496 | $migration_stage->add_error(sprintf(esc_html__("Could not create image attachment from non-existent file: %s", |
|
1497 | "event_espresso"), $guid)); |
|
1498 | return 0; |
|
1499 | } |
|
1500 | $contents = file_get_contents($guid); |
|
1501 | if ($contents === false) { |
|
1502 | $migration_stage->add_error(sprintf(esc_html__("Could not read image at %s, and therefore couldnt create an attachment post for it.", |
|
@@ 1501-1505 (lines=5) @@ | ||
1498 | return 0; |
|
1499 | } |
|
1500 | $contents = file_get_contents($guid); |
|
1501 | if ($contents === false) { |
|
1502 | $migration_stage->add_error(sprintf(esc_html__("Could not read image at %s, and therefore couldnt create an attachment post for it.", |
|
1503 | "event_espresso"), $guid)); |
|
1504 | return false; |
|
1505 | } |
|
1506 | $local_filepath = $wp_upload_dir['path'] . DS . basename($guid); |
|
1507 | $savefile = fopen($local_filepath, 'w'); |
|
1508 | fwrite($savefile, $contents); |
@@ 1386-1401 (lines=16) @@ | ||
1383 | . $tour |
|
1384 | . '.class.php' : $file_path; |
|
1385 | //if file is STILL not readable then let's do a EE_Error so its more graceful than a fatal error. |
|
1386 | if (! is_readable($file_path)) { |
|
1387 | EE_Error::add_error( |
|
1388 | sprintf( |
|
1389 | esc_html__( |
|
1390 | 'The file path given for the help tour (%s) is not a valid path. Please check that the string you set for the help tour on this route (%s) is the correct spelling', |
|
1391 | 'event_espresso' |
|
1392 | ), |
|
1393 | $file_path, |
|
1394 | $tour |
|
1395 | ), |
|
1396 | __FILE__, |
|
1397 | __FUNCTION__, |
|
1398 | __LINE__ |
|
1399 | ); |
|
1400 | return; |
|
1401 | } |
|
1402 | require_once $file_path; |
|
1403 | if (! class_exists($tour)) { |
|
1404 | $error_msg[] = sprintf( |
@@ 1215-1229 (lines=15) @@ | ||
1212 | public function get_DateTime_object($field_name) |
|
1213 | { |
|
1214 | $field_settings = $this->get_model()->field_settings_for($field_name); |
|
1215 | if (! $field_settings instanceof EE_Datetime_Field) { |
|
1216 | EE_Error::add_error( |
|
1217 | sprintf( |
|
1218 | esc_html__( |
|
1219 | 'The field %s is not an EE_Datetime_Field field. There is no DateTime object stored on this field type.', |
|
1220 | 'event_espresso' |
|
1221 | ), |
|
1222 | $field_name |
|
1223 | ), |
|
1224 | __FILE__, |
|
1225 | __FUNCTION__, |
|
1226 | __LINE__ |
|
1227 | ); |
|
1228 | return false; |
|
1229 | } |
|
1230 | return isset($this->_fields[$field_name]) && $this->_fields[$field_name] instanceof DateTime |
|
1231 | ? clone $this->_fields[$field_name] |
|
1232 | : null; |