Skip to main content
3 votes
Accepted

Show shipping class in admin product list

You can add a new column to the product admin overview that displays the shipping class of each product. Here's how you can do it: Add the following code to your theme's functions.php file or a ...
alexandrucarjan's user avatar
2 votes

How to Remove All Widgets from Dashboard?

Remove Default WP metabox in dashboard: @source https://github.com/vincentorback/clean-wordpress-admin/blob/master/dashboard.php /** * Removing dashboard widgets. * * @link https://developer....
Khaled Developer's user avatar
2 votes
Accepted

Set Featured Image of a post

To set a featured image when creating a post using wp_insert_post(), you can use the set_post_thumbnail() function // Create the post $post_id = wp_insert_post($args); // Check if the post was ...
vijay pancholi's user avatar
2 votes

Select a Text for CSS

Start by creating a stylesheet for your plugin.Then you can use the do_action('admin_enqueue_scripts') to enqueue it in the controlpanel only, avoiding it to be loaded in the frontend. You could do ...
WPTricksDK's user avatar
2 votes

Load specific CSS file

/** * Enqueue a script or stylesheet in the WordPress admin on edit.php. * * @param string $hook_suffix Hook suffix for the current admin page. */ function wpse426722_admin_enqueue( $hook_suffix ) ...
Chris Cox's user avatar
  • 1,850
1 vote
Accepted

Array() displaying in all pages of admin -view page source

It might be added during development, most probably coming from Theme or Plugin, The best way to debug is download active plugins and active theme using this plugin Download Plugin/ Theme, and open ...
Syed Muhammad Usman's user avatar
1 vote
Accepted

admin showing Array() after adding exit() code

Download your theme using Plugin: Download Theme, and search using code editor like VSCode.
Syed Muhammad Usman's user avatar
1 vote
Accepted

How to use native wordpress translation domain inside a custom plugin?

How to use native wordpress translation domain inside a custom plugin? You would use __() without a textdomain, but this won't work for you because that's not how post status labels work. ...
Tom J Nowell's user avatar
  • 60k
1 vote

Wordpress admin area not sending mail (but works with WP Mail SMTP, Test Mail, and PHP mail() function)

I found the issue, had to edit /etc/php/8.3/cli/php.ini file, by adding/editing following lines : [mail function] ; For Win32 only. ; https://php.net/smtp #SMTP = localhost SMTP = mysmtpserver.domain ;...
John Kravicz's user avatar
1 vote

Wp-admin wrongly redirecting on multisite

Solved it adding an annotation to the ingress: nginx.ingress.kubernetes.io/rewrite-target: / nginx.ingress.kubernetes.io/use-regex: "true" nginx.ingress.kubernetes.io/configuration-snippet: |...
Ana's user avatar
  • 11
1 vote

disable admin bar except administrator

Your third one looks like it should work, though it's a bit hard to read. I'd recommend something like this: add_filter( 'show_admin_bar', 'wpse424492_admin_bar', 10000 ); function ...
Pat J's user avatar
  • 12.2k
1 vote

Fetch Post Category

If you want to display and fetch all post categories that have posts associated with them and display them in a dropdown list in the WP admin panel, try below the code add in code to your themes ...
vijay pancholi's user avatar
1 vote

How can I have an admin only non-dashboard page in my Wordpress plugin

You'll need something like this: function your_callback() { if ( ! current_user_can( 'manage_options' ) ) { return; } // add your code here to display the menu for admins only } Basically ...
robwatson_dev's user avatar
1 vote

How does the security of admin_ajax.php work?

If you look at the source of admin-ajax.php, the answer becomes clearer: $action = $_REQUEST['action']; if ( is_user_logged_in() ) { // If no action is registered, return a Bad Request response. ...
Jacob Peattie's user avatar
1 vote
Accepted

Error 403 on wp-admin - Redirection to upgrade.php

The Error 403 with a redirection to upgrade.php in a WordPress site's admin area can be a bit tricky to diagnose and resolve, as it can stem from various issues, including file permissions, server ...
thedevelopergkt's user avatar
1 vote

Wildcard multisite wp-admin url wrongfully redirected

Take a look at your wp-config.php file. For a subdomain installation, you should have something like this: define('MULTISITE', true); define('SUBDOMAIN_INSTALL', true); define('DOMAIN_CURRENT_SITE', '...
ray-happyforms's user avatar
1 vote

login_enqueue_scripts changes are not reflecting

Edit: Turns out my issue was the LiteSpeed cache plugin. It got resolved as soon as I purged the cache. I am disabling the cache for the development server for now. 🤦🏽‍♂️
Nalin Vyas's user avatar
1 vote

Edit image preview is not displayed

Make sure that not only wp-config.php, and functions.php has no empty lines. In my case it was one of my custom theme files, which was included with include PHP function inside of single.php file. I ...
Sid's user avatar
  • 113
1 vote

How to check if a user is in a specific role?

If your site happens to be using WooCommerce, you can simply use: wc_current_user_has_role( $role ); If not, you can just create the function yourself by copying the way WooCommerce does it (...
Dane Rossenrode's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible