Resetting internal WordPress state during its cycle

The general answer is “no”. WordPress has too many globals (and new ones are being added in every new release 🙁 ) to be able to “reset” the general state in a sane way, and there is no “api” to do that. (and this without even talking about themes and plugins which are a can … Read more

wp-cli post create & media import issues

So I just ended up doing a query on the database for the link of the image: wp db query “SELECT guid FROM wp_posts WHERE ID=’ID_FROM_MEDIA_IMPORT’” –silent –skip-column-names I wrote this bash script for the whole process: post-create.sh PATH_TO_IMAGE.FILETYPE “TITLE” imageID=$(wp media import $1 –porcelain) imageLINK=$(wp db query “SELECT guid FROM wp_posts WHERE ID=’$imageID'” –silent … Read more

Specify custom php.ini to use with WP-CLI

If executing PHP scripts directly on command line, you can try the -d option. Another way is to make use of the WP_CLI constant: if ( defined(‘WP_CLI’) && WP_CLI ) { // Load custom PHP configurations here. }

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