adding custom user input fields in WordPress admin dashboard gives error The link you followed has expired. Please try again

That error messages means a failed admin nonce validation (check_admin_referer, which calls wp_nonce_ays). And you don’t actually need an extra nonce here: these are extra fields to be added to existing forms that already have their own nonces, and the one you’ve added just clashes with them. (If you were adding a new form you … Read more

Getting template_include to work when allow_url_include is off?

Wouldn’t ya know – 10 minutes or less since I asked my question and I’ve discovered the answer. I was attempting to define MY_PLUGIN_TEMPLATES using using plugins_dir_url(), now it looks like this and is working: define( ‘MY_PLUGIN_TEMPLATES’, dirname( __FILE__ ) . ‘/templates’ ); Thanks to mfields for the suggestion of dirname instead of WP_PLUGIN_DIR.

Memory errors with media upload, WordPress can’t use more than 96M (while there’s 512 available!)

You’re looking at the problem the wrong way. The error you’re seeing isn’t an error coming from WordPress, it’s a PHP error. Somehow, somewhere, something is limiting the memory limit to 96M, and it ain’t WordPress that’s doing it. Here’s the thing: WordPress can’t actually limit the memory on most servers. I know that it … Read more

Get WP CLI to hide debug warnings and notices in JSON output, same setting as website

A quick manual solution is to direct all error output to a log file somewhere or even to /dev/null. With your command this would look like this: wp plugin list –fields=name,status,update,version,update_version,title –format=json 2> ./cli-command.err.log If you totally don’t care about the errors, warnings and notices, you could send it to /dev/null like this: wp plugin … Read more

Max file size not updating

1] To do this, change the upload_max_filesize and post_max_size directives in your php.ini file. To ensure that file uploads work correctly, the post_max_size directive should be a little larger than the upload_max_filesize. For example, the following settings demonstrate how to set a file upload limit to 20 megabytes: upload_max_filesize = 20M post_max_size = 21M 2] … Read more

Connection lost. Saving has been disabled… (Updating Posts/Pages)

That message is a result of your server throwing a 503 error and the WordPress Heartbeat API catching that error. See https://core.trac.wordpress.org/ticket/25660 for the background on the fix that WordPress introduced to save offline edits. Things to check on your computer are if WAMP is actually running when you’re getting this message (check the status … Read more

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