Making WordPress.org


Ignore:
Timestamp:
05/23/2023 06:16:42 AM (3 years 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/plugins/theme-directory/admin-edit.php

    r12335 r12600  
    107107
    108108            // User must be able to edit theme or be the theme owner.
    109             if ( ! ( user_can( $user->ID, 'edit_post', $post ) || $user->ID === $post->post_author ) ) {
     109            if ( ! ( user_can( $user->ID, 'edit_post', $post ) || $user->ID !== $post->post_author ) ) {
    110110                return [ 'do_not_allow' ];
    111111            }
Note: See TracChangeset for help on using the changeset viewer.