Insert data in custom table during new post creation

You hook a function to save_post (for saves and updates) or publish_post for publication only. The second hook is really a variable hook of the form {$new_status}_{$post->post_type} so it will be different if you aren’t dealing with a post post type. function do_on_publish_wpse_98177($id) { // your code; $id is the post ID } add_action(‘publish_post’,’do_on_publish_wpse_98177′); Make … Read more

Search Woocommerce product titles only

It turns out the free Relevanssi plugin does this rather well. I was afraid it would only search posts and not custom post types, but it does it all… and rather well! It only requires a simple filter added to your theme’s functions.php file to get it to omit the body content: // search titles … Read more

Problem for recover and save metaboxes

Your code: add_action(‘admin_menu’, ‘reaction_buttons_meta_box2’); Use ‘add_meta_boxes’ to add meta boxes. It fires in the wp-admin/edit-form-advanced.php file and passes the $post object. The ‘admin_menu’ action fires much more often. add_action( ‘add_meta_boxes’, ‘reaction_buttons_meta_box2’ ); Your code: function reaction_buttons_meta2() { global $post; echo $_POST[‘reaction_buttons_off2’]; There is nothing in $_POST when the the edit page loads. You can test … Read more

Building a simple “settings” plugin to change textstrings on the home page

As I understood you correctly you just want to rename ‘kkpo_quote’ and you have conflict. Not to have conflict try to replace all ‘kkpo_quote’ with same name, for example: if you replace ‘kkpo_quote’ with ‘new_quote’ in register_setting(KKPLUGINOPTIONS_ID.’_options’, ‘new_quote’); then make sure that you replace it with ‘new_quote’ where ever is ‘kkpo_quote’ There is 7 times … Read more

Photos do not show on SEO platform built into a wordpress plugin

Your question makes it seem like you are using relative URLs– “I used the path for the images like this: images/image.jpg …” Don’t use relative URLs in WordPress. Relative paths are not reliable, except in stylesheets. They do work in stylesheets. Use functions like admin_url and these other related functions.