| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 39 | public function get_image( $filename ) { |
||
| 40 | $relative_file = self::IMG_ASSETS_DIR . $filename; |
||
| 41 | $file_url = $this->get_plugin_url( $relative_file ); |
||
| 42 | |||
| 43 | // Build absolute path to file to confirm file exists. |
||
| 44 | $file_path = $this->get_root_dir() . $relative_file; |
||
| 45 | |||
| 46 | if ( ! file_exists( $file_path ) ) { |
||
| 47 | return self::IMG_NOT_FOUND; |
||
| 48 | } |
||
| 49 | |||
| 50 | return $file_url; |
||
| 51 | } |
||
| 52 | } |
||
| 53 |