| 1 |
<?php |
| 2 |
if ( ! isset( $data ) && isset( $args['data'] ) ) { |
| 3 |
$data = $args['data']; |
| 4 |
} |
| 5 |
?> |
| 6 |
<div class="github-embed github-embed-repository <?php echo $data['logo_class'] ?>"> |
| 7 |
<p> |
| 8 |
<a href="<?php echo esc_attr( $data['repo']->html_url ) ?>" target="_blank"> |
| 9 |
<strong> |
| 10 |
<?php echo esc_html( $data['repo']->description ) ?> |
| 11 |
</strong> |
| 12 |
</a> |
| 13 |
<br> |
| 14 |
<a href="<?php echo esc_attr( $data['repo']->html_url ) ?>" target="_blank"><?php echo esc_html( $data['repo']->html_url ) ?></a><br> |
| 15 |
<a href="<?php echo esc_attr( $data['repo']->html_url ) ?>/network" target="_blank"><?php echo esc_html( number_format_i18n( $data['repo']->forks_count ) ) ?></a> forks.<br> |
| 16 |
<a href="<?php echo esc_attr( $data['repo']->html_url ) ?>/stargazers" target="_blank"><?php echo esc_html( number_format_i18n( $data['repo']->stargazers_count ) ) ?></a> stars.<br> |
| 17 |
<a href="<?php echo esc_attr( $data['repo']->html_url ) ?>/issues" target="_blank"><?php echo esc_html( number_format_i18n( $data['repo']->open_issues_count ) ) ?></a> open issues.<br> |
| 18 |
<details <?php echo $data['details_expanded'] ? 'open' : ''; ?>> |
| 19 |
<summary>Recent commits:</summary> |
| 20 |
<ul class="github_commits"> |
| 21 |
<?php |
| 22 |
$i = 0; |
| 23 |
foreach ( $data['commits'] as $commit ) : ?> |
| 24 |
<li class="github_commit"> |
| 25 |
<a href="https://github.com/<?php echo $data['owner_slug'] ?>/<?php echo $data['repo_slug'] ?>/commit/<?php echo esc_attr( $commit->sha ) ?>" target="_blank"><?php echo esc_html( $commit->commit->message ) ?></a>, <?php echo esc_html( $commit->commit->committer->name ); ?> |
| 26 |
</li> |
| 27 |
<?php |
| 28 |
if (++$i == 5) break; |
| 29 |
endforeach; |
| 30 |
?> |
| 31 |
</ul> |
| 32 |
</details> |
| 33 |
</p> |
| 34 |
</div> |
| 35 |
|