Making WordPress.org


Ignore:
Timestamp:
05/23/2023 06:16:42 AM (20 months ago)
Author:
dd32
Message:

Theme Directory: Allow the Commercial/Community options to be set.

Changes:

  • The no-js fallback form is removed, as it wasn't operational.
  • The capability check was removed from the API response, as the API is cached and cannot be used for that purpose.
  • The capability check is now performed client-side, based on a new currentUser field matching against the themes authorship.
  • The capability check is fixed to allow theme authors to self-edit.

See r12338.

File:
1 edited

Legend:

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

    r12372 r12600  
    185185                    'api'    => $api_endpoints['favorite'],
    186186                    'themes' => wporg_themes_get_user_favorites(),
    187                     'user'   => wp_get_current_user()->user_login,
    188187                    'nonce'  => is_user_logged_in() ? wp_create_nonce( 'modify-theme-favorite' ) : false,
    189188                ),
     189                'currentUser' => is_user_logged_in() ?
     190                    array(
     191                        'login'    => wp_get_current_user()->user_login,
     192                        'slug'     => wp_get_current_user()->user_nicename,
     193                        'is_admin' => current_user_can( 'edit_posts' ),
     194                    ) :
     195                    false,
    190196                'browseDefault'=> WPORG_THEMES_DEFAULT_BROWSE,
    191197                'apiEndpoint'  => $api_endpoints['query'],
Note: See TracChangeset for help on using the changeset viewer.