A Code Modification
-
Hi,
I wanted to let you know about a change that I made to your code as it is running on my website. I did it to solve an annoying problem. I created a new block using Block-Lab. I created the <child-theme>/blocks/<new-block>.css file but I didn’t like how the block displayed. But every time I made a change to the css file, I had to go to the browser’s settings and clear the image/file cache before Chrome would let go of the cached copy of the .css file.
I found in your code, line 450 in the 1.5.2 version (line 453 in 1.5.3) of php/blocks/class-loader.php and changed it from:
wp_get_theme()->get( ‘Version’ )
to
(defined(‘SCRIPT_DEBUG’) && SCRIPT_DEBUG ? time() : wp_get_theme()->get( ‘Version’ ))I used ‘SCRIPT_DEBUG’ because that’s what you used when loading the plugin’s classes during debugging.
Now, I can change my <new-block>.css file at will and immediately see the changes with a browser refresh. I am bringing this to your attention in the hopes that you might do something similar in a future release such that we can develop our new blocks more efficiently, and that I don’t have to remember to go change it again, with each new Block-Lab release. ??
- The topic ‘A Code Modification’ is closed to new replies.