Get PHP Fatal error on globalized $wpdb: Call to a member function insert() on a non-object- I have no clue. What to do?

You did everything right with the globalize, the error message is just telling you that you called a function on $wpdb which does not exists. Just check prior you do that $wpdb contains the object you’re intersted in: if (is_object($wpdb) && is_a($wpdb, ‘wpdb’)) { $result = $wpdb->insert( ‘wp_weights’, array( ‘user_id’ => $userid, ‘current_weight’ => $weight … Read more

Why does WordPress remove my variables in the URL?

For one, you can’t call template files directly as you’re doing… If you want the page somepage, you should call it directly, with the query string arguments added after a trailing slash. Look into the function add_query_arg() – its a much more bulletproof way of tacking GET variables onto the end of WordPress urls. For … Read more

Shortcode content filter?

you can use regex to find your the src and use that to append your “files/myimagescript?” to it: function append_myimagescript($attr, $content){ $pattern = ‘/src=”https://wordpress.stackexchange.com/questions/11618/([^”]*)”/i’; $replacement=”files/myimagescript?${1}”; return preg_replace($pattern, $replacement, $content); }

WordPress to end support for PHP 4?

Yes, version 3.1 is the last version to support PHP 4. For WordPress 3.2, due in the first half of 2011, we will be raising the minimum required PHP version to 5.2. Why 5.2? Because that’s what the vast majority of WordPress users are using, and it offers substantial improvements over earlier PHP 5 releases. … Read more

How to call function that create table in database (plugin functionality)

The first issue as AutoBLogged pointed out is that you’ve incorrectly referenced _FILE_ and not __FILE__ in the first activation hook. There’s a possible secondary problem, and i say possible because i’ve never had to use the activation or deactivation hooks extensively myself, and that’s with calling register_activation_hook twice, once toward the top of the … Read more

APC 500 Internal server error [closed]

Raising apc.shm_size from default value 32M to 256M in php.ini seems to do the trick for us. edit: raising that value is not a bad idea, however it does not solve the issue in the long term. We are now considering removing either APC or Super Cache…

Taxonomy filter all children

This hooks into the update action for any post. It’ll copy all terms for a given set of taxonomies from a parent to it’s children. /** * Update all children of a post with the same terms as itself. * * @param int $post_ID * @param object $post */ function __update_children_with_terms( $post_ID, $post ) { … Read more