PluginProbe
Github Embed / trunk
Github Embed vtrunk
trunk 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0 2.0.1 2.0.2 2.1.0 2.2.0 2.2.1
← All changes | templates/repository.php +20 -13 2.0.2trunk View file →
@@ -1,4 +1,9 @@
1 +<?php
2 + if ( ! isset( $data ) && isset( $args['data'] ) ) {
3 + $data = $args['data'];
4 + }
5 +?>
1 6 <div class="github-embed github-embed-repository <?php echo $data['logo_class'] ?>">
2 7 <p>
3 8 <a href="<?php echo esc_attr( $data['repo']->html_url ) ?>" target="_blank">
4 9 <strong>
@@ -9,19 +14,21 @@
9 14 <a href="<?php echo esc_attr( $data['repo']->html_url ) ?>" target="_blank"><?php echo esc_html( $data['repo']->html_url ) ?></a><br>
10 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>
11 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>
12 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>
13 - Recent commits:
14 - <ul class="github_commits">
15 - <?php
16 - $i = 0;
17 - foreach ( $data['commits'] as $commit ) : ?>
18 - <li class="github_commit">
19 - <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 ); ?>
20 - </li>
21 - <?php
22 - if (++$i == 5) break;
23 - endforeach;
24 - ?>
25 - </ul>
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>
26 33 </p>
27 34 </div>