| Conditions | 1 |
| Paths | 1 |
| Total Lines | 17 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 2 |
| 1 | <?php |
||
| 45 | public function handler( $buffer ) { |
||
| 46 | |||
| 47 | // Look for the following regexs. |
||
| 48 | $regexs = array( |
||
| 49 | '/<article ([^>]*)class="([^"]*)type-post([^"]*)"([^>]*)/i', |
||
| 50 | '/<h1 ([^>]*)class="([^"]*)entry-title([^"]*)"([^>]*)/i', |
||
| 51 | ); |
||
| 52 | |||
| 53 | // Replacements. |
||
| 54 | $replacements = array( |
||
| 55 | '<article itemscope itemtype="http://schema.org/Article" ${1}class="${2}type-post${3}"${4}', |
||
| 56 | '<h1 itemprop="name" ${1}class="${2}entry-title${3}"${4}', |
||
| 57 | ); |
||
| 58 | |||
| 59 | // Perform the replacements in the buffer. |
||
| 60 | return preg_replace( $regexs, $replacements, $buffer ); |
||
| 61 | } |
||
| 62 | |||
| 64 |