| @@ -94,8 +94,18 @@ | ||
| 94 | 94 | ); |
| 95 | 95 | |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | + // Parser returned null = accessor not recognised. Give the fallback | |
| 99 | + // filter a chance so dynamic blocks can register handlers for codes | |
| 100 | + // their parser doesn't know about (e.g. PDF item table). | |
| 101 | + if ($parsedValue === null) { | |
| 102 | + $fallback = apply_filters($this->hookPrefix . 'smartcode_fallback', $code, $data); | |
| 103 | + if ($fallback !== $code) { | |
| 104 | + $parsedValue = $fallback; | |
| 105 | + } | |
| 106 | + } | |
| 107 | + | |
| 98 | 108 | return $this->transform($parsedValue, $code, $data); |
| 99 | 109 | } |
| 100 | 110 | |
| 101 | 111 | /** |