Making WordPress.org

Changeset 8913


Ignore:
Timestamp:
06/04/2019 07:02:56 AM (5 years ago)
Author:
dd32
Message:

Theme Directory: Add the requires and requires_php to the Theme objects.

Missed in [8895].
Props flixos90 for initial work, dd32.
See #3718.

Location:
sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/class-themes-api.php

    r8273 r8913  
    6161        'photon_screenshots' => false,
    6262        'active_installs'    => false,
     63        'requires'           => false,
     64        'requires_php'       => false,
    6365    );
    6466
     
    369371            $defaults['reviews_url'] = true;
    370372            $defaults['parent'] = true;
     373            $defaults['requires'] = true;
     374            $defaults['requires_php'] = true;
    371375        }
    372376
     
    788792        }
    789793
     794        if ( $this->fields['requires'] ) {
     795            $phil->requires = wporg_themes_get_version_meta( $theme->ID, '_requires', $phil->version );
     796        }
     797
     798        if ( $this->fields['requires_php'] ) {
     799            $phil->requires_php = wporg_themes_get_version_meta( $theme->ID, '_requires_php', $phil->version );
     800        }
     801
    790802        if ( class_exists( 'GlotPress_Translate_Bridge' ) ) {
    791803            $glotpress_project = "wp-themes/{$phil->slug}";
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/class-wporg-themes-repo-package.php

    r1321 r8913  
    6969            case 'ticket' :
    7070                return $this->wp_post->_ticket_id[ $version ];
     71            case 'requires':
     72                $values = $this->wp_post->_requires;
     73                if ( isset( $values[ $version ] ) ) {
     74                    return $values[ $version ];
     75                }
     76                return '';
     77            case 'requires-php':
     78                $values = $this->wp_post->_requires_php;
     79                if ( isset( $values[ $version ] ) ) {
     80                    return $values[ $version ];
     81                }
     82                return '';
    7183            default:
    7284                return $this->wp_post->$name;
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/theme-directory.php

    r8535 r8913  
    758758        'photon_screenshots' => true,
    759759        'active_installs' => true,
     760        'requires' => true,
     761        'requires_php' => true,
    760762    );
    761763
     
    797799            'photon_screenshots' => true,
    798800            'active_installs' => true,
     801            'requires' => true,
     802            'requires_php' => true,
    799803        )
    800804    ) );
Note: See TracChangeset for help on using the changeset viewer.