Can I get the role of the currentUser in modern WordPress React?

You can achieve this with the help of useSelect hook and select(‘core’).getCurrentUser() here is the sample component for you. import { useSelect } from ‘@wordpress/data’; const CurrentUserComponent = () => { const { currentUser } = useSelect((select) => ({ currentUser: select(‘core’).getCurrentUser(), }), []); // Here we are checking if currentUser is available or not. if … Read more

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 code in VSCode and search for var_dump, var_export, print_r, die, and etc. I’d say first search in Theme than go for Plugins.

Display Custom Text if date_picker date is expired

If you’ve dropped it right into functions.php and not inside an action hook, the code is running before ACF has initialized. Try running on acf/init action (untested): add_action( ‘acf/init’, static function () { $currentdate = new DateTime(); $date = get_field( ‘date_picker’, false, false ); $date = new DateTime( $date ); if ( $currentdate > $date … Read more

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’, ‘rareteas.com’); define(‘PATH_CURRENT_SITE’, “https://wordpress.stackexchange.com/”); define(‘SITE_ID_CURRENT_SITE’, 1); define(‘BLOG_ID_CURRENT_SITE’, 1); If you have SUBDOMAIN_INSTALL set to false, change it to true, which is necessary for a subdomain multisite. Next, take a look at your database. Sometimes … Read more

tech