Plugin activation/deactivation page transitions with page parameters, then vanished
Plugin activation/deactivation page transitions with page parameters, then vanished
Plugin activation/deactivation page transitions with page parameters, then vanished
If $wp_query->post_count == 0 I cant see how $wpdb->get_results( $wp_query->request ) would return any posts. So basically $request = $wpdb->get_results( $wp_query->request ); contains nothing and $request[0] doesn’t exist. Ergo PHP Notice: Undefined offset: 0 It would be interesting to know, what this could is supposed to achieve.
Yes, this is possible (but a pain). Admin messages are creating when WordPress runs this line in admin-header.php: do_action( ‘admin_notices’ ); The action called before this one is: do_action( ‘in_admin_header’ ); So, we can hook in there and run some code to make some changes to filter out messages before WordPress can render them. First … Read more
You could filter the_content: add_action( ‘post_updated’, ‘wpse105892_add_message’, 10 ); function wpse105892_add_message() { add_filter( ‘the_content’, ‘wpse105892_display_message’ ); } function wpse105892_display_message( $content ) { // remove the action once it’s run remove_action( ‘post_updated’, ‘wpse105892_add_message’, 11 ); $content = “<div class=”your-message”>You did it!</div>\n\n” . $content; return $content; }
Numbered placeholders don’t work as you’d expect, and are going to be removed altogether at some point in the future, so should be considered invalid syntax. So with this in mind, the error describes the problem- your query has 7 placeholders, but you only pass 4 values. For the repeated values, you just need to … Read more
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
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