Hook for post permalink update

You need to exactly use wp_insert_post_data. This contains array of post data what will be store into database after WordPress has done all of the validation/sanitization. add_filter(‘wp_insert_post_data’, ‘wpse_wp_insert_post_data’, 10, 2); function wpse_wp_insert_post_data($data, $post_attr) { // you get the post_name using $data[‘post_name’]; // post id will not be present for the first insert // but you … Read more

How to duplicate custom menu settings to export to another site

Menus aren’t stored in options. They are linked quite complicatedly so through various other tables. $wpdb->get_results(sprintf(” select tr.object_id from wp_terms t left join wp_term_taxonomy tt on t.term_id = tt.term_id left join wp_term_relationships tr on tt.term_taxonomy_id = tr.term_taxonomy_id left join wp_posts p on p.ID=tr.object_id left join wp_postmeta m on m.post_id=tr.object_id where t.slug =’%s’ and tt.taxonomy=’nav_menu’ group … Read more

Multisite, sharing content by URL

Hope I understand you correctly. Not sure if your /Widgets content would be actual widgets, or just posts/pages, but I’ve been using this plugin for duplicating content between sites on a multisite network: http://wordpress.org/extend/plugins/diamond-multisite-widgets/ Use the “Broadcast on the network” feature. You can select on which sites you’d like to duplicate the content. 2 caveats: … Read more

$wp_filesystem returns NULL. What are the dependencies?

$wp_filesystem is a global variable containing the instance of the (auto-)configured filesystem object after the filesystem “factory” has been run. To run the factory “over” the global variable (so to set it), just call the WP_Filesystem() function which is, guess what, undocumented in codex. At least the docblock contains some information and you can read … Read more

Settings API – Undefined Index when unchecking checkbox

Managed to fix this by doing the following: function dat_checkbox_field_0_render( ) { $options = get_option( ‘dat_settings’ ); $a = $options; if (array_key_exists(“dat_checkbox_field_0″,$a)) { } else { $options[‘data_checkbox_field_0’] = false; } ?> <input type=”checkbox” name=”dat_settings[dat_checkbox_field_0]” <?php checked( $options[‘dat_checkbox_field_0’], 1 ); ?> value=”1″> <?php }

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