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 ; https://php.net/smtp-port smtp_port = 25 username = myusername password = mypassword sendmail_from = [email protected] Then a service nginx restart. I still don’t understand why PHP is able … Read more

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. get_post_status doesn’t return the name of the post status, it returns a slug, e.g. pending not Pending. The solution is in the user … 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.

How to Customize the Admin Sidebar Menu in WordPress Multisite Network by changing the backend code of the wp-admin code files?

Firstly, you should absolutely not modify core files. Ever. Any changes you make to core files can and will be overwritten any time WordPress updates. There are umpteen ways in which WP has been written to allow you to change its behaviour without hacking on core files: hooks, filters, APIs. Use those instead. In this … Read more

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 ) { if( ‘admin_print_scripts-profile’ == $hook_suffix ) { wp_enqueue_style( ‘your-stylesheet-slug’, ‘/path/to/your_stylesheet.css’ ); } } add_action( ‘admin_enqueue_scripts’, ‘wpse426722_admin_enqueue’ ); The above function has the hook suffix for … Read more

install Segment on WordPress

add that code to a js in your theme folder (or child theme if you’re using it). for this example I named the script “analytics.js” and put it in a directory called “js” in my child theme folder. Now register and enqueue the file by placing this code in your functions.php function wpse_load_script() { // … Read more

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

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