Modify built-in post type properties

This is a pretty late answer, but I was looking to do something similar and figured it out. I wanted to get nav_menu_items into an RSS feed, which required changing the built in nav_menu_item post type property publicly_queryable. Anyway, it was actually pretty simple, here’s a generic function to do it: function change_wp_object() { $object … Read more

How to initialize $wpdb?

First of all you probably created an isolated file that is not under the umbrella of WP files. That’s why you are not getting $wpdb. I guess you may not following the general rules/conventions of theme development. my question is now how are you accessing the file? whatever, if you include the wp_config.php in your … Read more

How do I extend one plugin I’m writing with another I’m writing using classes?

If the classes are not in the same file, you’ll need to require it into the child class ( myCustomClass ). Are you doing that? Example : //get the base class if(!class_exists(‘MyParentClass’)) { require_once plugin_dir_path( __FILE__ ) . ‘/_inc/MyParentClass.php’; } /** * Class Definition */ class MyChildClass extends MyParentClass{ // class definition }

When and Where is `global $post` Set and Available?

Global $post var is set by WP::register_globals() method. It is called by WP::main() method, on its turn called by wp() function that is called when wp-blog-header.php is loaded. If you look at the graph @Rarst built, on the left, you can see where wp() function is called. In terms of hooks, global post variable is … Read more

Is it possible to change the attributes of a registered style or script before it fires?

Modify a registered style’s path I wanted to tweak the path to one of the WordPress admin stylesheets so i could keep requests down, and because it makes little sense to include two stylesheets, when the one i’m calling redefines all the styling in the stylesheet enqueued by WordPress. The idea is basically to re-point … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)