Debugging WordPress

The basic technique of logging queries is that if SAVEQUERIES constant is defined to be true (it’s not by default for performance reasons) then $wpdb->queries will keep the log of queries performed. There isn’t anything on top of this that WordPress natively does. There are plenty of plugins around which work either by interpreting this … Read more

WordPress with php5-fpm and nginx

Ah, my problem ended up stemming from an issue with php5-fpm. Essentially, there were php5-fpm services running that were “old” and thus when I tried to access mysql from the web, it wasn’t detected. But when I tried to access it via cli, it was detected. That narrowed it down to php5-fpm for me, and … Read more

Auto-update tables from database

qwip, There is one way to update your custom table while wordpress users table in action and for that you require to code with custom function which is called while some action perform by user. You can handle it by add_action(). There are several action act by wordpress for user(viz. user_register, deleted_user, etc). See below … Read more

what is the best way to store user created data?

You should store additional user data in wp_usermeta table. For that, use add_user_meta() function. Here’s an example of how you can store locations $location = array(‘name’ => ‘example location name’, ‘street’ => ‘example street name’, ‘note’ => ‘example user note’ ); add_user_meta($user_id, ‘location’, $location); You can store as many locations as you want. To retrieve … Read more

Mysql SELECT posts

I resolved creating SQL query: SELECT posts.post_title, posts.post_content, trans.element_type, trans.language_code FROM wp_posts AS posts INNER JOIN wp_icl_translations AS trans ON posts.ID = trans.element_id INNER JOIN wp_postmeta AS meta ON posts.ID = meta.post_id WHERE trans.element_type=”post_product” AND trans.language_code=”de” This is added only if you need something on post_meta: … INNER JOIN wp_postmeta AS meta ON posts.ID = … Read more

I need to get an array from the wordpress database

Is this what you are asking for? Use it after the code you posted to create posts in loop and use thier ids to update meta fields. Replace “post_type” with your custom post type. foreach ($markers as $marker){ $post_id = wp_insert_post(array( “post_title” => “something”, “post_type” => “your-type”, “post_status” => “publish”, //by default they are drafts … Read more