Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does 'CONCATENATE_SCRIPTS' work on wp-config?

Tags:

wordpress

The text on my wordpress text editor is white on a white background so its invisible for most people..

enter image description here

I searched it and the solution I found was to add the following code to wp-config.php

define('CONCATENATE_SCRIPTS', false ); 

It worked fine but I couldn't find what it does or why it works.

I only found a question that asks the same thing here but it didn't get an answer.

Could someone explain what the code above does and why it works?

like image 913
Daniel Avatar asked Sep 15 '15 14:09

Daniel


People also ask

What is Concatenate_scripts?

CONCATENATE_SCRIPTS is the constant that tells wordpress to, well.. concatenate all of the dependencies into one URL and load it together ( to save http requests I guess ).

What is location of WP-config php?

The wp-config. php file is usually located in the root folder of your website with other folders like /wp-content/. Once you have downloaded the wp-config. php file, you can make the appropriate changes then re-upload it to your web server.

How do I edit WP-config php from within WordPress?

Simply right click on the file and then select download from the menu. Your FTP client will now download wp-config. php file to your computer. You can open and edit it using a plain text editor program like Notepad or Text Edit.

Is WP-config php secure?

There is no sensitive information on your main wp-config. php file which makes it secure. However, the include path (i.e. /home/yourusername/) differs from a web server to web server.


1 Answers

First of all, nice question.

CONCATENATE_SCRIPTS is the constant that tells wordpress to, well.. concatenate all of the dependencies into one URL and load it together ( to save http requests I guess ).

As far as I know, it applies only to the Admin area ( back end ). The result is a url like

<script src="http://somewordpress.site/wp-admin/load-scripts.php?c=1&load=jquery-ui-core,jquery-ui-widget,jquery-ui-mouse,jquery-ui-sortable,hoverIntent,common,jquery-color,wp-ajax-response,wp-lists,jquery-ui-resizable,quicktags,jquery-query,admin-comments,postbox,dashboard,thickbox,plugin-install,media-upload&ver=e0f647a6df61adcc7200ce17a647db7f" type="text/javascript"> 

This is the normal default behavior, and if you have problems with it, it is probably because of some javascript conflict in theme or plugin.

Another possible ( albeit less frequent ) is a browser problem due to TinyMCE caching. clear browser cache. ( edit : was true to Sep.2015 - not verified since but still worth trying )

If you really want to see where it is defined or what is it doing you can look here.

Anyhow, by defining the constant as false you are practically forcing WordPress to load each script on the administration page individually rater than collectively. So in that case - If one script fails to load and work correctly, the others can still continue to operate correctly.

This is a recommended setting for debugging and local development. However, in your case, it is a symptom of a problem, and not the problem itself. you should isolate the problem and fix it ( probably a plugin like said before )

like image 169
Obmerk Kronen Avatar answered Sep 19 '22 11:09

Obmerk Kronen