Skip to content

Commit

Permalink
View now includes images
Browse files Browse the repository at this point in the history
  • Loading branch information
ddwwcruz committed Jun 27, 2016
1 parent 0111693 commit 4f3fbcb
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions code/wordpress/weave/components/image.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php
if (empty($node['classes'])) {
$node['classes'] = array();
}
if (empty($node['attributes']['src'])) {
$node['attributes']['src'] = '#';
}

$classes = array_unique(array_merge($node['classes'], array($node['id'])));
?>
<img class="<?= implode(' ', $classes) ?>" src="<?= $node['attributes']['src'] ?>" />

0 comments on commit 4f3fbcb

Please sign in to comment.