Debugging PHP object during Ajax call in WordPress

If you want to see your object in that variable you have to convert it to a string: $data_str = print_r( $this, true ); Then you can include it on your error array, or if you’re just debugging your code you can send it to your web server’s error log file using error_log: error_log( $data_str … Read more

How can I export post data in xml format?

I just want to make my own exporter Well, export_wp() will fetch the data (it builds the sql query, I think). So I’m not sure the benefit of using an api request to try and hand that data to export_wp(), unless you mean to generate the arguments for it via an endpoint, or some values … Read more

Display children and grandchildren of a custom post type

You can create walker for the wp_list_pages() this function use the Walker_Page you can extends him. Walker fo example you put it in the functions.php I added comments with the class name No_Link_First_Child_Walker so you could see what I changed you can search for them. class No_Link_First_Child_Walker extends Walker_Page { public function start_el( &$output, $page, … Read more

From where come that JS files in ?

Quick but not recommended solution – remove wp_head() function from your header.php file. NOT RECOMMENDED, because new plugins may not work once you did this. The best way is to find that files in you theme code, just perform a search within your theme files for wp_enqueue_script – you have to find the hook where … Read more

save_post vs post_updated

OK, so let’s start with Codex: save_post is an action triggered whenever a post or page is created or updated, which could be from an import, post/page edit form, xmlrpc, or post by email. The data for the post is stored in $_POST, $_GET or the global $post_data, depending on how the post was edited. … Read more

Create table in database when activating plugin

I think you’re missing a comma after product_categoy_url varchar(500) NOT NULL then if still not working, be aware that register_activation_hook( __FILE__, ‘gg_create_table’); will work only if placed in the main plugin file, not in an included file. To execute the activation function from a different file you’ve to define in the main file: define(‘MY_PLUGIN_PATH’,__FILE__); than … Read more