Articles of notices

wp_get_http has been deprecated. Use WP_Http instead

I use a premium plugin (for theme dev.) that has included the WordPress Importer plugin and I get a deprecated notice: “wp_get_http has been deprecated. Use WP_Http instead” But the WP_Http send me to this function. The question is how to use wp_http_supports in the following code instead of wp_get_http: function fetch_remote_file( $url, $post ) […]

admin notice on Insert Media popup screen

I want an admin notice box on all media upload pages. I did that for media library page by code add_action( ‘load-upload.php’, array( $this, ‘media_library_message_load’ ) ); public function media_library_message_load(){ add_action( ‘admin_notices’, array( $this, ‘media_library_message_display’ ) ); } public function wpb_media_library_message_display() { echo ‘<div class=”notice update-nag”> <strong>Note: my message </strong> </div>’; } But i want […]

How to create Admin Notice from Plugin with argument?

This question already has an answer here: Passing a parameter to filter and action functions 7 answers

Show message from backend

I need to show messages on wordpress page editor, when a page is updated. I know there is a admin_notice hook to show messages. I have a save_post_page perfectly working on my code, but I need to know how to connect both of them and I don’t know why? Any help would be appreciate, Best […]

Displaying “One Time” Notification in Plugins

In WordPress’s backend, you can add notifications and errors using HTML that looks like this <div class=”updated error”> <p><?php esc_html_e( ‘A bad thing happened!’, ‘your-text-domain’ );?></p> </div> You can add these notices using the admin_notices hook. add_action( ‘admin_notices’, function(){ ?> <div class=”updated error”> <p><?php esc_html_e( ‘A bad thing happened!’, ‘your-text-domain’ );?></p> </div> <?php } ); […]

How to customize post edit notices

How to customize the notice message (‘Post published’ or ‘Post updated’) displayed when I add or edit a custom post type registered with register_post_type() function?

How to remove 'wordpress…' text from page titles in tabs

I am working on a site and sometimes I run into an error when logging out and on the site tab it says ‘WordPress Failure Notice’. I am trying to remove all instances of wordpress so users dont know Im using it, but I can not figure out how to remove the text from the […]

Plugin Options Array Set to Undefined

I want to set a number of plugin options set to blank if they are not defined so I can avoid the PHP notices. What is a better way of writing this code? $options = get_option(‘plugin_options’); // Add new plugin options defaults here if( !isset( $options[‘plugin_option_1’] ) ) $options[‘plugin_option_1’] = ”; if( !isset( $options[‘plugin_option_2’] ) […]

Debug Notice: X is deprecated since version 4.5! Use Y instead

I recently updated my WordPress to latest version, and now I’m getting following messages: Notice: get_currentuserinfo is deprecated since version 4.5! Use wp_get_current_user() instead. in /X/wordpress/wp-includes/functions.php on line 3658 Notice: add_object_page is deprecated since version 4.5! Use add_menu_page() instead. in /X/wordpress/wp-includes/functions.php on line 3658 How can I pinpoint whoever is responsible for generating these PHP […]

How to change the location of admin notice in html without using Javascript?

I am adding an admin notice via the conventional admin_notice hook in my plugin: function my_admin_notice() { ?> <div class=”notice notice-info is-dismissible”> <p><?php _e( ‘some message’, ‘my-text-domain’ ); ?></p> </div> <?php } if ( my_plugin_show_admin_notice() ) add_action( ‘admin_notices’, ‘my_admin_notice’ ); How can I control where wordpress places the admin notice, in the html on the […]