|
18 | 18 | return; |
19 | 19 | } |
20 | 20 |
|
21 | | -$hero = $this->api->get_hero_item(); |
| 21 | +$code_snippets_hero = $this->api->get_hero_item(); |
22 | 22 |
|
23 | | -$changelog_sections = [ |
| 23 | +$code_snippets_changelog_sections = [ |
24 | 24 | 'Added' => [ |
25 | 25 | 'title' => __( 'New features', 'code-snippets' ), |
26 | 26 | 'icon' => 'lightbulb', |
|
39 | 39 | ], |
40 | 40 | ]; |
41 | 41 |
|
42 | | -$plugin_types = [ |
| 42 | +$code_snippets_plugin_types = [ |
43 | 43 | 'core' => __( 'Core', 'code-snippets' ), |
44 | 44 | 'pro' => __( 'Pro', 'code-snippets' ), |
45 | 45 | ]; |
@@ -78,50 +78,50 @@ class="csp-link-<?php echo esc_attr( $link_name ); ?>"> |
78 | 78 | </nav> |
79 | 79 | </div> |
80 | 80 |
|
81 | | - <section class="csp-section-changes"> |
82 | | - <h1>📰 <?php esc_html_e( 'Latest news', 'code-snippets' ); ?></h1> |
83 | | - <div class="csp-cards"> |
84 | | - <a class="csp-card" href="<?php echo esc_url( $hero['follow_url'] ); ?>" target="_blank" |
85 | | - title="<?php esc_attr_e( 'Read more', 'code-snippets' ); ?>"> |
86 | | - <header> |
87 | | - <span class="dashicons dashicons-external"></span> |
88 | | - <h2><?php echo esc_html( $hero['name'] ); ?></h2> |
89 | | - </header> |
90 | | - <figure> |
91 | | - <div id="csp-loading-spinner" class="csp-loading-spinner"></div> |
92 | | - <img id="csp-changes-img" |
93 | | - onload="hideLoadingAnimation()" |
94 | | - src="<?php echo esc_url( $hero['image_url'] ); ?>" |
95 | | - alt="<?php esc_attr_e( 'Latest news image', 'code-snippets' ); ?>);"> |
96 | | - </figure> |
97 | | - </a> |
| 81 | + <section class="csp-section-changes"> |
| 82 | + <h1>📰 <?php esc_html_e( 'Latest news', 'code-snippets' ); ?></h1> |
| 83 | + <div class="csp-cards"> |
| 84 | + <a class="csp-card" href="<?php echo esc_url( $code_snippets_hero['follow_url'] ); ?>" target="_blank" |
| 85 | + title="<?php esc_attr_e( 'Read more', 'code-snippets' ); ?>"> |
| 86 | + <header> |
| 87 | + <span class="dashicons dashicons-external"></span> |
| 88 | + <h2><?php echo esc_html( $code_snippets_hero['name'] ); ?></h2> |
| 89 | + </header> |
| 90 | + <figure> |
| 91 | + <div id="csp-loading-spinner" class="csp-loading-spinner"></div> |
| 92 | + <img id="csp-changes-img" |
| 93 | + onload="hideLoadingAnimation()" |
| 94 | + src="<?php echo esc_url( $code_snippets_hero['image_url'] ); ?>" |
| 95 | + alt="<?php esc_attr_e( 'Latest news image', 'code-snippets' ); ?>);"> |
| 96 | + </figure> |
| 97 | + </a> |
98 | 98 |
|
99 | 99 | <a class="csp-card csp-changelog-wrapper" href="https://wordpress.org/plugins/code-snippets/changelog" target="_blank" |
100 | 100 | title="<?php esc_attr_e( 'Read the full changelog', 'code-snippets' ); ?>"> |
101 | | - <header> |
102 | | - <span class="dashicons dashicons-external"></span> |
103 | | - <h2><?php esc_html_e( 'Latest changes', 'code-snippets' ); ?></h2> |
104 | | - </header> |
105 | | - <div class="csp-section-changelog"> |
106 | | - <?php foreach ( $this->api->get_changelog() as $version => $version_changes ) { ?> |
107 | | - <h3><?php echo esc_html( $version ); ?></h3> |
108 | | - <article> |
109 | | - <?php |
110 | | - foreach ( $changelog_sections as $section_key => $section ) { |
111 | | - if ( empty( $version_changes[ $section_key ] ) ) { |
112 | | - continue; |
113 | | - } |
114 | | - ?> |
115 | | - <h4> |
116 | | - <span class="dashicons dashicons-<?php echo esc_attr( $section['icon'] ); ?>"></span> |
117 | | - <?php echo esc_html( $section['title'] ); ?> |
118 | | - </h4> |
119 | | - <ul> |
120 | | - <?php |
121 | | - foreach ( $plugin_types as $plugin_type => $type_label ) { |
122 | | - if ( empty( $version_changes[ $section_key ][ $plugin_type ] ) ) { |
123 | | - continue; |
124 | | - } |
| 101 | + <header> |
| 102 | + <span class="dashicons dashicons-external"></span> |
| 103 | + <h2><?php esc_html_e( 'Latest changes', 'code-snippets' ); ?></h2> |
| 104 | + </header> |
| 105 | + <div class="csp-section-changelog"> |
| 106 | + <?php foreach ( $this->api->get_changelog() as $version => $version_changes ) { ?> |
| 107 | + <h3><?php echo esc_html( $version ); ?></h3> |
| 108 | + <article> |
| 109 | + <?php |
| 110 | + foreach ( $code_snippets_changelog_sections as $section_key => $section ) { |
| 111 | + if ( empty( $version_changes[ $section_key ] ) ) { |
| 112 | + continue; |
| 113 | + } |
| 114 | + ?> |
| 115 | + <h4> |
| 116 | + <span class="dashicons dashicons-<?php echo esc_attr( $section['icon'] ); ?>"></span> |
| 117 | + <?php echo esc_html( $section['title'] ); ?> |
| 118 | + </h4> |
| 119 | + <ul> |
| 120 | + <?php |
| 121 | + foreach ( $code_snippets_plugin_types as $plugin_type => $type_label ) { |
| 122 | + if ( empty( $version_changes[ $section_key ][ $plugin_type ] ) ) { |
| 123 | + continue; |
| 124 | + } |
125 | 125 |
|
126 | 126 | foreach ( $version_changes[ $section_key ][ $plugin_type ] as $change ) { |
127 | 127 | ?> |
|
0 commit comments