From 4838bcf6ad04b04b6773ec381e5d7cc2ebe58bdd Mon Sep 17 00:00:00 2001 From: Jake Spurlock Date: Mon, 5 Dec 2016 14:33:51 -0500 Subject: [PATCH 1/2] Use the `wp_parse_args()` helper to merge the args. --- documentcloud.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentcloud.php b/documentcloud.php index acee6f7..123d4e4 100644 --- a/documentcloud.php +++ b/documentcloud.php @@ -181,7 +181,7 @@ function prepare_oembed_fetch( $provider, $url, $args ) { // Merge actual args with default attributes so that defaults are always // sent to oEmbed endpoint $default_atts = $this->get_default_atts(); - $atts = array_merge( $default_atts, $args ); + $atts = wp_parse_args( $default_atts, $args ); // Some resources (like notes) have multiple possible // user-facing URLs. We recompose them into a single form. From 54967edbe0f46406033c4fdc69865eab07dda43d Mon Sep 17 00:00:00 2001 From: Jake Spurlock Date: Mon, 5 Dec 2016 15:09:52 -0500 Subject: [PATCH 2/2] Swap the args. --- documentcloud.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentcloud.php b/documentcloud.php index 123d4e4..08a18f8 100644 --- a/documentcloud.php +++ b/documentcloud.php @@ -181,7 +181,7 @@ function prepare_oembed_fetch( $provider, $url, $args ) { // Merge actual args with default attributes so that defaults are always // sent to oEmbed endpoint $default_atts = $this->get_default_atts(); - $atts = wp_parse_args( $default_atts, $args ); + $atts = wp_parse_args( $args, $default_atts ); // Some resources (like notes) have multiple possible // user-facing URLs. We recompose them into a single form.