Articles of core modifications

Edit admin post page

I have to customize the admin page where you edit the other pages “wp-admin/post.php”. I have to add a lot of things, and delete others, change colors and add a custom menu to the top. I don’t know how to start searching for this. Are there any hooks, or funtions to change the HTML in […]

Two domains on one WordPress Installation

I recently changed the base domain on my WordPress website from http://www.fsdegrees.com to http://www.56degrees.co.uk. I would like to create various of 301 from old domain to new one, but for some reason I can still access pages using the old domain www.fsdegrees.com/blog I though it should come back with 404. I’m just afraid that Google […]

Headers already sent – WordPress core

I’m getting an error on my site regarding “headers already sent”: Warning: Cannot modify header information – headers already sent by (output started at ………/wp-admin/menu-header.php:161) in ……/wp-includes/pluggable.php on line 881 I read the WordPress FAQ that discusses this, but – as you can see – this error is caused by the WordPress core (and not […]

Why are double-periods (“..”) invalid in a WordPress image filename?

ms-files.php contains the following code fragment: $file = rtrim( BLOGUPLOADDIR, ‘/’ ) . ‘/’ . str_replace( ‘..’, ”, $_GET[ ‘file’ ] ); if ( !is_file( $file ) ) { status_header( 404 ); die( ‘404 — File not found.’ ); } This code determines whether or not the file can be found. However, it does something […]

How to edit or override a Core function?

I want to add a data argument to links generated by the paginate_links() function. Then, I can more easily extend my custom pagination to use AJAX. As far as I can tell, this function is not pluggable, nor does it have any hooks available. The links generated by paginate_links() look like this: <a class=”page-numbers” href=”https://example.com/list/page/2/”><span […]

How to disable core and plugin updates

Is there any way to disable core and plugin updates? I am modifying a plugin and bit of WordPress Core (I know its a sin to do so), but can’t help it.

Modifying the media-template.php file, the right way?

The shortcode accepts the columns=’0′ as an attribute so that it doesn’t insert any breaks in the HTML between gallery items, however this option is not available in Gallery Settings interface (“Add Media” pop-up when editing pages/posts). I’ve located the code in wp-includes\media-template.php line 396 to 406; <label class=”setting”> <span><?php _e(‘Columns’); ?></span> <select class=”columns” name=”columns” […]

How can I modify what is being output in wp_head, whether by a theme or WordPress in general?

I’ve been working on performance of my site using YSLOW, and noticed that WordPress it outputting things in my document head that I know I don’t need. For example, I’m already calling jQuery 1.9 from the Google CDN, so I don’t need the call to jQuery in wp-includes. Also, a plugin is including a stylesheet […]

How to share WordPress core library

We have ten blogs running on a little EC2 instances, we want to see if all the blogs can share the same wordpress php code so When I update the WordPress, all the blogs get updated Save memory in Apache/mod_php as no duplicated scripts or bytecode in the cache (in case of APC). We cant […]

Cleaning up WordPress to improve performance?

Looking over the current WordPress codebase it’s clear that functions are over-used. My count is over 8,100 functions/methods are defined inside the WordPress codebase. That is terrible, and a terrible use of resources. The problem with that many functions (or classes) is that means wordpress is not DRY (do not repeat yourself) and I’m sure […]