Disable the “Skip to Toolbar” tabbing accessibility feature

It’s not possible without JavaScript. The HTML for it is output in the WP_Admin_Bar in a private and protected method with no filter. You can remove them after the page has loaded with JS like so: function wpse_287259_remove_skip_link() { echo “<script>jQuery( ‘.screen-reader-shortcut’ ).remove();</script>”; } add_action( ‘wp_after_admin_bar_render’, ‘wpse_287259_remove_skip_link’ ); I hope it goes without saying that … Read more

How do I add a contact form?

There are many free and paid plugins you can activate to do this quickly and easily. Contact Form 7, Ninja Forms, and Caldera Form are very popular but there are many more. Just go to the WP Dashboard Plugin > Add New > Search for Contact Forms > Install > Activate > Go to Plugin … Read more

admin_enqueue_scripts not working

If you remove that conditional in the first line of the enqueue function, your scripts should load. I can’t see the broader context of why your function is written that way, but if you just copied it from a tutorial or something, you don’t need it here. Try: <?php function sunset_load_admin_scripts(){ wp_enqueue_media(); wp_register_script(‘sunset-admin-script’,get_template_directory_uri() .’/js/news_admin.js’, array(‘jquery’), … Read more

Admin multiple column sorting

Since WordPress already allows for the sorting of page titles alphabetically (either ascending or descending order), all that is actually needed is to add an Author filter. This can be achieved by adding the following to the functions.php file of your active theme: function rudr_filter_by_the_author() { $params = array( ‘name’ => ‘author’, // this is … Read more

creating custom rewrite rules for admin pages

How would I setup a custom rewrite rule to redirect /wp-admin/(page-slug).php to /wp-admin/admin.php?page=(page-slug) You can’t, WP Admin doesn’t make use of the rewrite rules system like the frontend, so rewrite rules have no effect on WP Admin pages. You can only use WP rewrite rules to map pretty URLs on to versions that take the … Read more

Can I mass change all admin emails for a multisite instance?

Okay so thanks to the suggestion from Rup I got this to work and apply to all my sites locally (will double check this before using on live!) $blogs = get_sites([‘public’ => 1, ‘orderby’ => ‘registered’, ‘order’ => ‘DESC’, ‘number’ => 1000]); foreach($blogs as $blog) { $bid = $blog->blog_id; switch_to_blog($bid); update_option( ‘admin_email’, ‘[email protected]’ ); update_option( … Read more

Fallback media image for featured image not working in admin column

wp_get_attachment_image_src(156, ‘archive_thumbnail’)[0] will only echo the URL of the image. You need to add it to html to display the image. Try this: echo ‘<img src=”‘.wp_get_attachment_image_src(156, ‘archive_thumbnail’)[0].'”/>’; You could add the width etc as well echo ‘<img src=”‘.wp_get_attachment_image_src(156, ‘archive_thumbnail’)[0].'” width=”.wp_get_attachment_image_src(156, ‘archive_thumbnail’)[1].” height=”.wp_get_attachment_image_src(156, ‘archive_thumbnail’)[2].” />’; what happens if someone deletes this image though? Do you have … Read more

Find Memory Usage of Admin

The easist way is the plugin WP System Health, great plugin and works fine. Alternativ you build a function and hook in wp-admin; example admin_footer

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