Articles of core

Loading template files from a subfolder in my theme?

I am working on a site that will have up to 30 templates in it. I don’t want to have all those templates at the root of my theme folder cluttering up everything. I know how I can modify the get_page_templates() function in the file wp-admin/includes/theme.php to make it scan sub dirs in my theme […]

Changing subdir multisite install to subdir core directory structure

Now that WordPress 3.5 is supposed to work with core files in subdirectory, I decided to move my local development setup (subdirectory multisite) to that configuration. Fast forward and what I have is following: wordpress (3.5 core) wp-content (content dir, configured via WP_CONTENT_DIR and WP_CONTENT_URL) .htaccess with: RewriteEngine On RewriteBase / RewriteRule ^index\.php$ – [L] […]

What CSS minifier does WP core use?

I did not see the minifier among the tools in https://code.trac.wordpress.org/browser/ . Is it in the repo somewhere? Or, what is it? (Note this question has been asked previously on Stack Exchange but the author was really asking a different question, so it does not have an answer. See What exact CSS minifier does WP […]

Clarification on filters and hooks

I am about to start my first WordPress project and I have the task of moving customized core code that override the core into separate functions/files (this way it’ll be easier to maintain when we upgrade in the future. I have been doing research and it looks like add_filter and apply_filter and do_action and add_action […]

How to listen to color changes on the color picker?

I am trying to run some custom jquery function every time the colorpicker’s color change. The colorpicker is include as part of the WP core. I have been looking at the JS code, but I can’t figure out what’s the trigger that updates the color. I have tried listening for several classes, and also listening […]

HowTo: Add Class to Sidebar Widget List-Items

The newest version of Bootstrap (v3.0) adds a new List Group component which has the following structure: <ul class=”list-group”> <li class=”list-group-item”>Cras justo odio</li> <li class=”list-group-item”>Dapibus ac facilisis in</li> <li class=”list-group-item”>Morbi leo risus</li> <li class=”list-group-item”>Porta ac consectetur ac</li> <li class=”list-group-item”>Vestibulum at eros</li> </ul> I would like to be able to add a class to the ul […]

WP_Site_Query vs. WP_Network_Query in WordPress 4.6

Can someone explain the difference between WP_Site_Query and WP_Network_Query in WordPress 4.6? WP_Network_Query() : Core class used for querying networks. WP_Site_Query() : Core class used for querying sites. WP_Term_Query() : Class used for querying terms. Are there examples when you would query the Network vs. the Site vs. Posts? Wouldn’t a WP_Site_Query just be a […]

What is the purpose of this line of code in wp_trim_excerpt?

Can someone please explain what the purpose of this code is: $text = str_replace(‘]]>’, ‘]]>’, $text); I’m referring to a line of code inside wp_trim_excerpt(), but I’ve seen something very similar in some other wp functions as well. On the surface, I would say it’s not doing anything at all, but I have to give […]

How to disable `SQL_CALC_FOUND_ROWS`

Possible Duplicate: wordpress query causing load In the site I’m trying to optimize, I noticed several queries that are rather slow and start with SELECT SQL_CALC_FOUND_ROWS Searching this site, the relevant question wordpress query causing load has no adequate answer, in my opinion. Can I somehow disable SQL_CALC_FOUND_ROWS without breaking too many things – if […]

Rewriting a core function?

As I understand it, it’s possible to overwrite core functions in wordpress, without touching the core itself, which is of obvious benefit. Now, certain functions are ‘pluggable’, but not all of them. I’m trying to overwrite the function that outputs the featured image thumbnail in the admin panel to be a custom size, it’s not […]