Clear WordPress internal object caches.
Usage
WP_CLI\Utils\wp_clear_object_cache()
Notes
In long-running scripts, the internal caches on $wp_object_cache
and $wpdb
can grow to consume gigabytes of memory. Periodically calling this utility
can help with memory management.
Internal APIAPI An API or Application Programming Interface is a software intermediary that allows programs to interact with each other and share data in limited, clearly defined ways. documentation is generated from the WP-CLIWP-CLI WP-CLI is the Command Line Interface for WordPress, used to do administrative and development tasks in a programmatic way. The project page is http://wp-cli.org/ https://make.wordpress.org/cli/ codebase on every release. To suggest improvements, please submit a pull request.
Related
- WP_CLI\Utils\get_home_dir() – Get the home directory.
- WP_CLI\Utils\trailingslashit() – Appends a trailing slash.
- WP_CLI\Utils\get_temp_dir() – Get the system’s temp directory. Warns user if it isn’t writable.
- WP_CLI\Utils\get_php_binary() – Get the path to the PHPPHP PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML. https://www.php.net/manual/en/preface.php. binary used when executing WP-CLI.
- WP_CLI::get_php_binary() – Get the path to the PHP binary used when executing WP-CLI.