Make metabox of custom post type fully autosave- and bulk-/quick-edit compatible

WordPress does not send the content of custom fields during autosave (just title, slug and content). That’s why the custom field content will be deleted if you try to save the data: You cannot see the difference between deleted and missing content. I would create a separate autosave function for that, because the way WordPress … Read more

Custom post preview without saving

I found a nice way to do this using the preview_post_link filter, which allows you to rewrite the URL used by the preview operation. In my case I did something like: add_filter( ‘preview_post_link’, function ( $link ) { return ‘http://domain.com/mobile-preview/?src=”https://wordpress.stackexchange.com/questions/191918/. urlencode($link) .”%26admin_bar=false’; } ); When I click my preview button WordPress opens up my custom … Read more

Auto save permalink setting page with the plugin activation

You should use flush_rewrite_rules function for that. You have to remember, that this is expensive task, so you should not do it every time the site loads (many tutorials are making such mistake). Of course you can use it in your plugin activation hook: register_activation_hook( __FILE__, ‘myplugin_flush_rewrites’ ); function myplugin_flush_rewrites() { // call your rewrite … Read more

Trigger Autosave or disable unsaved changes dialog

You could disable it with: source function disableAutoSave(){ wp_deregister_script(‘autosave’); } add_action( ‘wp_print_scripts’, ‘disableAutoSave’ ); Also not a real answer, edit the interval in the WP-config: http://codex.wordpress.org/Editing_wp-config.php#Modify_AutoSave_Interval The autosave function itself is in wp-includes/js/autosave(.dev).js

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