最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

rest api - WP CLI in WP 5.3 with PHP 7.4

programmeradmin4浏览0评论

Working with the WP REST API WP-CLI in WP 5.4, by selecting PHP 7.3 the call to wp post works as usually:

wp post list

But changing to PHP 7.4 (current) throws me the following errors:

Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/example/public_html/wp-includes/script-loader.php on line 707
Deprecated: implode(): Passing glue string after array is deprecated. Swap the parameters in phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/DocParser.php on line 75
Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/example/public_html/wp-includes/load.php on line 656
Notice: Trying to access array offset on value of type bool in /home/example/public_html/wp-includes/theme.php on line 2245
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/mustache/mustache/src/Mustache/Parser.php on line 278

Selecting PHP 7.3 again solves the problem.

Following this WP note as cited, WP 5.3 would supposedly cover these problems, but WP 5.4 still throws notices.

Using the curly brace syntax will now trigger a deprecated notice in PHP 7.4 with the plan to remove the feature entirely in PHP 8.0 (or another future release).

Is this a bug? Should I always use the last PHP version? Or as it seems, keep some steps before the last update?

发布评论

评论列表(0)

  1. 暂无评论