Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #57393


Ignore:
Timestamp:
12/28/2022 06:59:12 PM (21 months ago)
Author:
SergeyBiryukov
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #57393 – Description

    initial v1  
    22
    33Here is the condition in question:
    4 
     4{{{
    55function wp_enqueue_code_editor( $args ) {
    6 if ( is_user_logged_in() && 'false' === wp_get_current_user()->syntax_highlighting ) {
    7 return false;
    8 }
     6        if ( is_user_logged_in() && 'false' === wp_get_current_user()->syntax_highlighting ) {
     7                return false;
     8        }
     9}}}
    910
    1011I believe that the user-form-variable syntax_highlighting is probably misnamed as it should be something like disable_syntax_highlighting to reflect the choice being made.
    1112
    1213As it is, when ticked (true), highlighting should be disabled. When un-ticked (false), highlighting should be enabled.
    13 
    14     if ( ! is_user_logged_in() or 'true' === wp_get_current_user()->syntax_highlighting ) {
    15             return false;
    16     }
    17 
    18 NB: Pipe symbol is filtered and so replaced with "or"
     14{{{
     15        if ( ! is_user_logged_in() || 'true' === wp_get_current_user()->syntax_highlighting ) {
     16                return false;
     17        }
     18}}}