Make WordPress Core

Changes between Version 1 and Version 7 of Ticket #57393


Ignore:
Timestamp:
01/31/2023 07:32:38 PM (20 months ago)
Author:
TobiasBg
Comment:

Replying to mjdewitt:

My issue here is that the way it is now is counter-intuitive or backwards: if disabled is checked, disabled is true meaning that codemirror does not load up features.

That still sounds totally right to me. If the "Disable ..." checkbox is checked, the value of syntax_highlighting is false. If the value of syntax_highlighting is false, WordPress will not load the CodeMirror integration (as the function wp_enqueue_code_editor() will be left early).

If plugins like Code Snippet also interpret the syntax_highlighting value, it's on them to load relevant JavaScript files (like for CodeMirror) themselves.

Given that these checkboxes have been in WordPress for multiple years (see https://core.trac.wordpress.org/changeset/41376#file12), I believe that any functional issues would already have been detected.

That said, I do agree that the wording of the checkbox texts can be improved. I have added a patch that reverses the checkbox behavior and adjusts the wording of the checkbox texts, and brings some consistency to the handling of that code. I think that this might indeed make sense here, and I'll move this suggestion for potential inclusion in WP 6.2, if a Core committer agrees, and I'll update the ticket title and description to reflect the suggested changes.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #57393

    • Property Focuses ui added
    • Property Component changed from External Libraries to Administration
    • Property Summary changed from CodeMirror Features Disabled by wp_enqueue_code_editor Activation Conditions to Unify checkbox handling and match wording with function on the User Profile screen
    • Property Version changed from 6.1.1 to 4.9
    • Property Milestone changed from Awaiting Review to 6.2
    • Property Keywords has-patch added
    • Property Type changed from defect (bug) to enhancement
  • Ticket #57393 – Description

    v1 v7  
     1[The focus of this ticket shifted from discussing a potential functional bug to an improvement of wording and a more consistent behavior of checkboxes.
     2Using texts like "Disable" for toggled-on checkboxes can be confusing to users. For a better user experience, the toggled-on state should mean "enabled".]
     3
     4Original ticket description:
     5
    16CodeMirror highlighting, line numbers, code-folding, brace-matching and other customizations are disabled when highlighting is disabled. This is a real issue for plugins like code-snippets which rely on these features.
    27