Skip to content

Commit

Permalink
Issue #158 - add support to embed from local WordPress installs. Fixes
Browse files Browse the repository at this point in the history
…#162 - Correct type for until attribute of oik/countdown
  • Loading branch information
bobbingwide committed Sep 3, 2020
1 parent ebcee76 commit 797b73e
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion oik.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ function oik_plugin_file_loaded() {

add_filter( "attachment_fields_to_edit", "oik_attachment_fields_to_edit", null, 2 );
add_filter( "attachment_fields_to_save", "oik_attachment_fields_to_save", null, 2 );
add_filter( 'oembed_remote_get_args', 'oik_oembed_remote_get_args', 10, 2 );
//remove_filter( 'oembed_dataparse', 'wp_filter_oembed_result', 10 );
}

/**
Expand Down Expand Up @@ -271,6 +273,23 @@ function oik_attachment_fields_to_save( $post, $attachment) {
return $post;
}

/**
* Filters `oembed_remote_get_args to set sslverify=true for local requests.
*
* Uses a method in the oik_remote class from the class-oik-remote shared library.
*
* @param array $args Array of arguments for the remote request
* @param string $url the target URL
* @return array
*/
function oik_oembed_remote_get_args( $args, $url ) {
if ( !class_exists( 'oik_remote') ) {
oik_require_lib( 'class-oik-remote');
}
$args = oik_remote::bw_adjust_args( $args, $url );
return $args;
}

/**
* Implements "admin_bar_menu" action for oik
*
Expand Down Expand Up @@ -601,7 +620,7 @@ function oik_register_dynamic_blocks() {
, 'script' => null
, 'attributes' =>
[ 'since' => [ 'type'=>'string' ]
,'until' => [ 'type' => 'string ']
,'until' => [ 'type' => 'string']
, 'url' => [ 'type' => 'string']
, 'description' => [ 'type' => 'string']
, 'expirytext' => [ 'type' => 'string']
Expand Down

0 comments on commit 797b73e

Please sign in to comment.