How to add a link to the tax term in the admin Edit page?

The dynamic hook {taxonomy}_term_edit_form_top can be used to output a link to the term’s archive page. Since we’re dealing with terms under the genre taxonomy, we will attach our callback to the genre_term_edit_form_top hook. /** * Adds a link to top of edit term form for terms under the * genre taxonomy. * * @param … Read more

How do I fire a snackbar notice in admin?

WordPress has some global actions you can use here. If you want to add your own notice in the lower corner (like the screenshot), you can do that like this: wp.data.dispatch(“core/notices”).createNotice( “success”, // Can be one of: success, info, warning, error. “This is my custom message.”, // Text string to display. { type: “snackbar”, isDismissible: … Read more

Is it possible to set a option, and then redirect to another page directly from a admin notice link?

You could use /wp-admin/admin-post.php. Link: $url = admin_url( ‘admin-post.php?action=somethingunique’ ); print “<a href=”https://wordpress.stackexchange.com/questions/85825/$url”>Update and redirect</a>”; Then you should register a callback for that action: add_action( ‘admin_post_somethingunique’, ‘wpse_85825_callback’ ); And in that callback you can do what you want: function wpse_85825_callback() { if ( current_user_can( ‘manage_options’ ) ) update_option( ‘my_option’, ‘some_value’ ); wp_redirect( admin_url( ‘users.php’ ) … Read more

admin_notices after register_uninstall / deactivate_hook

The short answer is no, it is not possible. When you deactivate your plugin, it’s deactivated so doesn’t run your admin_notices action when the admin screen is refreshed. You can confirm it for yourself by using the action in a slightly different way. In your deactivation function include the following line: set_transient(‘my_deactivation_transient’, ‘My plugin is … Read more

wp_logout_url() – WordPress Failure Notice

I have the exact same problem and can duplicate the behavior. It only happens when a password is successfully changed. If after a password change you navigate to a different page, all is well again. But clicking the logout link then invokes wp_logout_url() and I consistently get that error. The error is also triggered if … Read more

Add custom post notice after post delete

Checking the bulk counts We can check the bulk counts, to see if any post was deleted: add_filter( ‘bulk_post_updated_messages’, function( $bulk_messages, $bulk_counts ) { // Check the bulk counts for ‘deleted’ and add notice if it’s gt 0 if( isset( $bulk_counts[‘deleted’] ) && $bulk_counts[‘deleted’] > 0 ) add_filter( ‘admin_notices’, ‘wpse_243594_notice’ ); return $bulk_messages; }, 10, … Read more

register_sidebar notice [closed]

Find file where is register_sidebar ( must be on theme folder or plugins ) add ID to sidebar register_sidebar( array( ‘name’ => __( ‘Main Sidebar’, ‘theme-slug’ ), ‘id’ => ‘change_me’, // Add only this line ‘description’ => __( ‘Widgets in this area will be shown on all posts and pages.’, ‘theme-slug’ ), ‘before_widget’ => ‘<li … Read more

WordPress admin notice in plugin function

Your problem is pretty simple. Your callback for this hook is not a simple function but some method of a class. If you add action like this: add_action(‘admin_notices’, ‘simple_notice’); you tell WP that there is some simple function called simple_notice and it should be called when hook admin_notices is processed. But… There is no such … Read more

How to customize post edit notices

You can used the post_updated_messages filter. add_filter( ‘post_updated_messages’, ‘rw_post_updated_messages’ ); function rw_post_updated_messages( $messages ) { $post = get_post(); $post_type = get_post_type( $post ); $post_type_object = get_post_type_object( $post_type ); $messages[‘my-post-type’] = array( 0 => ”, // Unused. Messages start at index 1. 1 => __( ‘My Post Type updated.’ ), 2 => __( ‘Custom field updated.’ … Read more

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