From d522b0681ae65f83996931712f62cb97a89cafad Mon Sep 17 00:00:00 2001 From: Nilambar Sharma Date: Wed, 3 Apr 2024 17:41:10 +0545 Subject: [PATCH 1/3] Update docs and examples --- src/Cache_Command.php | 16 ++++++++++++++++ src/Embeds_Namespace.php | 29 +++++++++++++++++++++++++++++ src/Handler_Command.php | 13 +++++++++++++ src/Provider_Command.php | 17 +++++++++++++++++ 4 files changed, 75 insertions(+) diff --git a/src/Cache_Command.php b/src/Cache_Command.php index 6771bc8..da067a7 100644 --- a/src/Cache_Command.php +++ b/src/Cache_Command.php @@ -10,6 +10,22 @@ /** * Finds, triggers, and deletes oEmbed caches. + * + * ## EXAMPLES + * + * # Find cache post ID for a given URL. + * $ wp embed cache find https://www.youtube.com/watch?v=dQw4w9WgXcQ --width=500 + * 123 + * + * # Clear cache for a post. + * $ wp embed cache clear 123 + * Success: Cleared oEmbed cache. + * + * # Triggers cache for a post. + * $ wp embed cache trigger 456 + * Success: Caching triggered! + * + * @package wp-cli */ class Cache_Command extends WP_CLI_Command { diff --git a/src/Embeds_Namespace.php b/src/Embeds_Namespace.php index cf4621d..39bfa42 100644 --- a/src/Embeds_Namespace.php +++ b/src/Embeds_Namespace.php @@ -7,6 +7,35 @@ /** * Inspects oEmbed providers, clears embed cache, and more. * + * ## EXAMPLES + * + * # Get embed HTML for a given URL. + * $ wp embed fetch https://www.youtube.com/watch?v=dQw4w9WgXcQ + *