Articles of core modifications

Create custom WP_List_Table in post_type

I have a post type named “case”. I want to create a “Sub-page” to list only my “cases”. And add some custom HTML (search box, some labels, logos, etc..) Anyone knows how can I do this? Code to create the post_type. function my_custom_post_type_case() { $labels = array( ‘name’ => _x( ‘Cases’, ‘post type general name’ […]

How to authenticate a user with an external webservice

I was asked to login wordpress with an external webservice and at the same time to use the original wordpress database, ie, the webservice would only obtain data for the user profile and its authentication and it would not be possible to modify any of the profile data(for Security reasons), but all the content of […]

Why There Is No “get content by ID” Function

When i need to get content of a post with ID, I’m always using this function : function getContentByID($id) { // $content_post = get_post($id); $content = $content_post->post_content; $content = apply_filters(‘the_content’, $content); $content = str_replace(‘]]>’, ‘]]>’, $content); return $content; } Can you tell me, why there isn’t any core function for this ? There are functions […]

Make changes of wp-db.php file persistent against updates

I’ve added $this->query(“set session wait_timeout=600″); into wp-includes/wp-db.php file because of “MySQL has gone away” errors in every query and I need to find some way to do the changes in file persistent (I suppose update of WordPress rewrites wp-db.php file). Any ideas? Thanks

How to Dequeue All WordPress Assets

I want to dequeue all styles and scripts that are loaded on the front-end (EG. not the admin panel) by default. I found this function, but am not sure how to utilize it to accomplish my goal. I’m seeing a ton of assets that I don’t need on the front end, loaded by WP core: […]

Add Password Generator on password protected page

I’m looking for add a password generator with 14 characters on the protected pages like in the picture. I search something like what is used when you create users but for page password.

Safely editing core files

I want to edit wp-comments-post.php so that if for example someone tries to post a comment with no content they will get a popup box telling them they cannot post an empty comment instead of the page redirect that happens at the moment. if ( ” == $comment_content ) { wp_die( __( ‘<strong>ERROR</strong>: please type […]

What problems maybe happen if I remove “wp-” prefix from wordpress folders and files?

I want to hide wordpress signs from my site. So I don’t want other people know that I built the website via WordPress. So I decided to remove wp- prefixes from all wordpress folders and files. And I also removed wp- prefixes from file contents with Notepad++. So my question is what problems maybe happen […]

How to modify files inside wp-includes directory in wordpress

I want to modify wp-includes/general-template.php function _wp_render_title_tag() {} Need to allow some limit to title tag, if title of the page will be more than 10 character then it should be shown only 5 characters.

How to: Avoid a bunch of useless Auto Draft ID entries related in posts table and disable autosave feature in 'post-new.php'?

I got it! Buuuuut I had to edit 2 core files, yes! 2 core files 🙁 I know is not a cool plugin hack, but maybe a cool patch for WP, Im using 3.3.1 version. Well, here is my little hack/contribution: wp-admin/post-new.php 1 Comment: //wp_enqueue_script(‘autosave’); 2 Change: $post = get_default_post_to_edit( $post_type, true ); $post_ID = […]