“leftover” notifications left on ever admin screen?

Let’s take a look at admin_notices, since that’s where your output is. https://core.trac.wordpress.org/browser/tags/5.4/src/wp-admin/admin-header.php#L281 So, it’s simply just an action-as-an-output-spot, what this means is that if you wish, you can output anything here and most importantly, this all happens in-memory, so, debugging should be pretty straight-forward; this spot is meant to output things. That’s it. Unless … Read more

Easiest way to make post private by default

Accepted solution is not the correct answer to change the visibility of any post type to any status. Below code is the right way to change the post status. function set_post_type_status_private( $status, $post_id ) { $status=”private”; return $status; } add_filter( ‘status_edit_pre’, ‘set_post_type_status_private’, 10, 2 ); Updated: The above filter will change the post status to … Read more

Reorder custom submenu item

Got it, thanks to cjbj‘s help, I was able to get the final solution: add_filter( ‘custom_menu_order’, ‘submenu_order’ ); function submenu_order( $menu_order ) { # Get submenu key location based on slug global $submenu; $settings = $submenu[‘options-general.php’]; foreach ( $settings as $key => $details ) { if ( $details[2] == ‘blogging’ ) { $index = $key; … Read more

How to Display Post Excerpts in Admin by Default?

The names of unchecked boxes in Screen Options for Edit Post screen are stored in user’s meta, per individual user, as an array. Insert the following code in your theme’s functions.php: function wpse_edit_post_show_excerpt( $user_login, $user ) { $unchecked = get_user_meta( $user->ID, ‘metaboxhidden_post’, true ); $key = array_search( ‘postexcerpt’, $unchecked ); if ( FALSE !== $key … Read more

Using the loop inside admin

I am not sure about the issue, but my advice would be to try and refactor this to use get_posts() and template tags that can work without $post global variable. Basically do not touch globals at all. Loops in front-end are almost civilized nowadays, but internals of admin are still very wild. 🙂

How to remove items from +New admin menu?

To hide everything (menu and submenu)- function wpse_260669_remove_new_content(){ global $wp_admin_bar; $wp_admin_bar->remove_menu( ‘new-content’ ); } add_action( ‘wp_before_admin_bar_render’, ‘wpse_260669_remove_new_content’ ); To hide specific menu/submenu item(s)- function wpse_260669_remove_new_content_items(){ global $wp_admin_bar; $wp_admin_bar->remove_menu( ‘new-post’ ); // hides post CPT $wp_admin_bar->remove_menu( ‘new-product’ ); // hides product CPT $wp_admin_bar->remove_menu( ‘new-page’ ); // hides page CPT $wp_admin_bar->remove_menu( ‘new-media’ ); // hides media } … Read more

What’s the purpose of admin canonical tag?

What is frontend & what is backend in WordPress? The PHP CODE, SQL Queries etc. that are executed on your server is the backend & any HTML/CSS/JavaScript CODE that comes to the browser as a result, is the frontend. So even though, some parts of your site’s “frontend” may be restricted by a password protected … Read more

Can I rename the wp-admin folder?

Unfortunately it’s not currently possible nor does there appear to be will to consider it as a modification as you can see by this recent thread on the wp-hackers list and this ticket on trac. If you’d really like to see this be revisited I’d suggest: Present your case on wp-hackers but be forewarned your … Read more

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