Set custom messages for post update/save

http://codex.wordpress.org/Function_Reference/register_post_type example: //add filter to ensure the text Book, or book, is displayed when user updates a book add_filter(‘post_updated_messages’, ‘codex_book_updated_messages’); function codex_book_updated_messages( $messages ) { global $post, $post_ID; $messages[‘book’] = array( 0 => ”, // Unused. Messages start at index 1. 1 => sprintf( __(‘Book updated. <a href=”https://wordpress.stackexchange.com/questions/17885/%s”>View book</a>’), esc_url( get_permalink($post_ID) ) ), 2 => … Read more

Update WordPress with SFTP instead of FTP

Configuration instructions in Codex on Enabling SSH Upgrade Access recommend either: Using SSH SFTP Updater Support plugin from official repository. Using built–in SSH2 support, which requires the PECL SSH2 extension installed on the server. It used to refer to this tutorial: Using SSH to Install/Upgrade in before, which might be of use.

Enable update notification, disable updates

Add the following code in your child theme’s functions.php or package it as a custom plugin to easily enable/disable: add_action( ‘wp_before_admin_bar_render’, ‘wpse161696_toolbar_menu’ ); add_action( ‘admin_menu’, ‘wpse161696_updates’ ); function wpse161696_toolbar_menu() { // Remove update menu item from the toolbar global $wp_admin_bar; $wp_admin_bar -> remove_menu( ‘updates’ ); } function wpse161696_updates() { // Remove all updating related functions … Read more

What are the best practices for updating?

Do not just upgrade immediately. Take the time you need for an informed decision. And make a backup, of course. 🙂 Read the changelog for the new version. Example for 3.4.1. The blog announcements and the Codex pages are not complete. Test the upgrade with an exact copy of your production site, including plugins and … Read more

How to create custom message on plugin update

This message is created by W3_Total_Cache->in_plugin_update_message() hooked to “in_plugin_update_message-$file”in wp_plugin_update_row(). It does some nifties to parse readme and display info from changelog, but overall you can just echo some stuff as with any other hook.

WP-CLI not recognizing commercial plugin updates

What you experienced may be some network level problem or someone temporary removed the download resources. For instance before the update. Most of the details you can get from the source code https://github.com/wp-cli/wp-cli. Plugin update function in there looks like this. function update( $args, $assoc_args ) { if ( isset( $assoc_args[‘version’] ) ) { foreach … Read more

Filter any HTTP request URI?

Less than an answer, but just a list of things straight from my experience with it – maybe you’ve overlooked something. Debugging the request & its results Without diggin’ too deep into the update process, but the WP HTTP API uses the WP_HTTP class. It also offers a nice thing: A debug hook. do_action( ‘http_api_debug’, … Read more

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