Changeset 12338 for sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/theme-single.php
- Timestamp:
- 12/15/2022 06:14:16 PM (22 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/theme-single.php
r9727 r12338 1 <?php 2 $is_commercial = has_term( 'commercial', 'theme_business_model', $theme ); 3 $external_support_url = $is_commercial ? get_post_meta( $theme->ID, 'external_support_url', true ) : ''; 4 $is_community = has_term( 'community', 'theme_business_model', $theme ); 5 $external_repository_url = $is_community ? get_post_meta( $theme->ID, 'external_repository_url', true ) : ''; 6 $can_configure_categorization_options = current_user_can( 'theme_configure_categorization_options', $theme ); 7 ?> 1 8 <div> 2 9 <div class="theme-navigation"> … … 8 15 </div> 9 16 <div class="theme-wrap"> 10 < div class="theme-about hentry">17 <?php printf( '<div class="theme-about hentry" data-slug="%s">' . "\n", $theme->slug ); ?> 11 18 <?php if ( time() - strtotime( $theme->last_updated ) > 2 * YEAR_IN_SECONDS ) { ?> 12 19 <div class="theme-notice notice notice-warning notice-alt"> … … 29 36 30 37 <div class="theme-head"> 38 <?php if ( $is_community ) : ?> 39 <div class="widget categorization-widget categorization-widget-community"> 40 <h3><?php esc_html_e( 'Community Theme', 'wporg-themes' ); ?></h3> 41 <?php 42 if ( $external_repository_url ) : ?> 43 <a href="<?php echo esc_url( $external_repository_url ); ?>" rel="nofollow"><?php _e( 'Contribute', 'wporg-themes' ); ?></a> 44 <?php endif; ?> 45 <p><?php esc_html_e( 'This theme is developed and supported by a community.', 'wporg-themes' ); ?></p> 46 </div> 47 <?php endif; ?> 48 49 <?php if ( $is_commercial ) : ?> 50 <div class="widget categorization-widget categorization-widget-commercial"> 51 <h3><?php esc_html_e( 'Commercial Theme', 'wporg-themes' ); ?></h3> 52 <?php 53 if ( $external_support_url ) : ?> 54 <a href="<?php echo esc_url( $external_support_url ); ?>" rel="nofollow"><?php _e( 'Support', 'wporg-themes' ); ?></a> 55 <?php endif; ?> 56 <p><?php esc_html_e( 'This theme is free but offers additional paid commercial upgrades or support.', 'wporg-themes' ); ?></p> 57 </div> 58 <?php endif; ?> 59 31 60 <div class="theme-actions clear"> 32 61 <a href="<?php echo esc_url( $theme->preview_url ); ?>" class="button button-secondary alignleft"><?php _e( 'Preview', 'wporg-themes' ); ?></a> … … 114 143 <div class="theme-downloads"> 115 144 </div><!-- .theme-downloads --> 145 146 <?php if ( $can_configure_categorization_options && $is_community ) : ?> 147 <?php $field_name = 'external_repository_url'; ?> 148 <div class="theme-categorization-options"> 149 <h3><?php esc_html_e( 'Community Options', 'wporg-themes' ); ?></h2> 150 151 <p><?php esc_html_e('This theme is developed and supported by a community.', 'wporg-themes' ); ?></p> 152 153 <form id="community" class="categorization" method="POST"> 154 <p> 155 <?php printf( '<label for="%s">%s</label>', esc_attr( $field_name ), esc_attr__( 'Development repository URL', 'wporg-themes' ) ); ?> 156 <?php printf( 157 '<input id="%s" type="text" name="%s" value="%s" data-original-value="%s">', 158 esc_attr( $field_name ), 159 esc_attr( $field_name ), 160 esc_url( $external_repository_url ), 161 esc_url( $external_repository_url ) 162 ); ?> 163 <span class="help"><?php esc_attr_e( 'Optional. The URL where development happens, such as at github.com.', 'wporg-themes' ); ?></span> 164 </p><p> 165 <button class="button button-secondary" type="submit"><?php esc_attr_e( 'Save', 'wporg-themes' ); ?></button> 166 <span class="success-msg"><?php esc_html_e( 'Saved!', 'wporg-themes' ); ?></span> 167 </p> 168 </form> 169 </div> 170 <?php endif; ?> 171 172 <?php if ( $can_configure_categorization_options && $is_commercial ) : ?> 173 <?php $field_name = 'external_support_url'; ?> 174 <div class="theme-categorization-options"> 175 <h3><?php esc_html_e( 'Commercial Options', 'wporg-themes' ); ?></h2> 176 177 <p><?php esc_html_e('This theme is free but offers paid upgrades, support, and/or add-ons.', 'wporg-themes' ); ?></p> 178 179 <form id="commercial" class="categorization" method="POST"> 180 <p> 181 <?php printf( '<label for="%s">%s</label>', esc_attr( $field_name ), esc_attr__( 'Commercial support URL', 'wporg-themes' ) ); ?> 182 <?php printf( 183 '<input id="%s" type="text" name="%s" value="%s" data-original-value="%s">', 184 esc_attr( $field_name ), 185 esc_attr( $field_name ), 186 esc_url( $external_support_url ), 187 esc_url( $external_support_url ) 188 ); ?> 189 <span class="help"><?php esc_attr_e( 'Optional. The URL for theme support, other than its support forum on wordpress.org.', 'wporg-themes' ); ?></span> 190 </p><p> 191 <button class="button button-secondary" type="submit"><?php esc_attr_e( 'Save', 'wporg-themes' ); ?></button> 192 <span class="success-msg"><?php esc_html_e( 'Saved!', 'wporg-themes' ); ?></span> 193 </p> 194 </form> 195 </div> 196 <?php endif; ?> 116 197 </div> 117 198
Note: See TracChangeset
for help on using the changeset viewer.