Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #60414, comment 44


Ignore:
Timestamp:
08/09/2024 06:33:48 PM (2 months ago)
Author:
azaozz
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #60414, comment 44

    initial v1  
    33> Along similar lines, it's also regrettably practical to override a WordPress JavaScript file as Core provides a filter for the purpose:
    44
    5 Right, however JavaScript works quite differently than PHP. It is a prototype-based language, i.e. any function, object (class), method, etc. can be replaced/overridden at any time by any script, even the built-in functions. There isn't such thing as `Fatal error: Cannot redeclare function_name() (previously declared in....)` in JS.
     5Right, however JavaScript works quite differently than PHP. It is a prototype-based language, i.e. most functions, objects (classes), methods, etc. can be replaced/overridden at any time by any script, even the built-in functions. There isn't such thing as `Fatal error: Cannot redeclare function_name() (previously declared in....)` in JS.
    66
    77For that reason it seems the ability to replace core scripts from PHP was intentional in the first iterations of Script Loader back in 2007-2008.