Skip to content

Commit

Permalink
Custom replace theme name in style.css docs.
Browse files Browse the repository at this point in the history
Ever since
Automattic/_s@5c3689c
ce019863 we kept a leading space in front of the theme name so it can
properly replaced.

No more!
  • Loading branch information
obenland committed Dec 31, 2014
1 parent 1191790 commit c6886ab
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion plugins/underscoresme-generator/underscoresme-generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,11 @@ function do_replacements( $contents, $filename ) {
'Text Domain' => $this->theme['slug'],
);

foreach ( $theme_headers as $key => $value )
foreach ( $theme_headers as $key => $value ) {
$contents = preg_replace( '/(' . preg_quote( $key ) . ':)\s?(.+)/', '\\1 ' . $value, $contents );
}

$contents = str_replace( '_s is based on Underscores', sprintf( '%s is based on Underscores', $this->theme['name'] ), $contents );
$contents = preg_replace( '/\b_s\b/', $this->theme['name'], $contents );

return $contents;
Expand Down

0 comments on commit c6886ab

Please sign in to comment.