Making WordPress.org

Changeset 12596


Ignore:
Timestamp:
05/18/2023 04:13:33 AM (16 months ago)
Author:
dd32
Message:

Theme Directory: Community/Commercial Categorization: Fix the fallback PHP templates to display the options.

See r12338.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/theme-single.php

    r12338 r12596  
    11<?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 );
     2    // $post = WP_Post, $theme = Theme info object
     3
     4    $is_commercial = has_term( 'commercial', 'theme_business_model', $post );
     5    $external_support_url = $is_commercial ? get_post_meta( $post->ID, 'external_support_url', true ) : '';
     6    $is_community = has_term( 'community', 'theme_business_model', $post );
     7    $external_repository_url = $is_community ? get_post_meta( $post->ID, 'external_repository_url', true ) : '';
     8    $can_configure_categorization_options = current_user_can( 'theme_configure_categorization_options', $post );
    79?>
    810<div>
     
    246248
    247249                <div class="theme-report">
    248                         <h2><?php _e( 'Report', 'wporg-themes' ); ?></h2>
    249                         <p><?php _e( 'Does this theme have major issues?', 'wporg-themes' ); ?></p>
    250                         <?php
    251                         $report_url = add_query_arg(
    252                                 urlencode_deep( array_filter( array(
    253                                         'rep-theme'   => "https://wordpress.org/themes/{$theme->slug}/",
    254                                         'rep-subject' => "Reported Theme: {$theme->name}", // Not translated, email subject.
    255                                         'rep-name'    => wp_get_current_user()->user_login,
    256                                 ) ) ),
    257                                 'https://make.wordpress.org/themes/report-theme/'
    258                         );
    259                         ?>
    260                         <a rel="nofollow" href="<?php echo esc_url( $report_url ); ?>" class="button button-secondary"><?php _e( 'Report this theme', 'wporg-themes' ); ?></a>
     250                    <h2><?php _e( 'Report', 'wporg-themes' ); ?></h2>
     251                    <p><?php _e( 'Does this theme have major issues?', 'wporg-themes' ); ?></p>
     252                    <?php
     253                    $report_url = add_query_arg(
     254                        urlencode_deep( array_filter( array(
     255                            'rep-theme'   => "https://wordpress.org/themes/{$theme->slug}/",
     256                            'rep-subject' => "Reported Theme: {$theme->name}", // Not translated, email subject.
     257                            'rep-name'    => wp_get_current_user()->user_login,
     258                        ) ) ),
     259                        'https://make.wordpress.org/themes/report-theme/'
     260                    );
     261                    ?>
     262                    <a rel="nofollow" href="<?php echo esc_url( $report_url ); ?>" class="button button-secondary"><?php _e( 'Report this theme', 'wporg-themes' ); ?></a>
    261263                </div><!-- .theme-report -->
    262264
Note: See TracChangeset for help on using the changeset viewer.