%s', arve_get_var_dump( $options ) ); } $show_options_debug = false; } $pre_style = '' . 'background-color: #111;' . 'color: #eee;' . 'font-size: 15px;' . 'white-space: pre-wrap;' . 'word-wrap: break-word;'; if ( ! empty( $_GET['arve-debug-attr'] ) ) { $html .= sprintf( '
attr[%s]: %s
', esc_attr( $pre_style ), esc_html( $_GET['arve-debug-attr'] ), arve_get_var_dump( $atts[ $_GET['arve-debug-attr'] ] ) ); } if ( isset( $_GET['arve-debug-atts'] ) ) { $html .= sprintf( '
$atts: %s
', esc_attr( $pre_style ), arve_get_var_dump( $input_atts ) ); $html .= sprintf( '
$arve: %s
', esc_attr( $pre_style ), arve_get_var_dump( $atts ) ); } if ( isset( $_GET['arve-debug-html'] ) ) { $html .= sprintf( '
%s
', esc_attr( $pre_style ), esc_html( $input_html ) ); } return $html; } function arve_build_meta_html( $a ) { $meta = ''; if ( ! empty( $a['sources'] ) ) { $first_source = arve_get_first_array_value( $a['sources'] ); $meta .= sprintf( '', esc_attr( $first_source['src'] ) ); } if ( ! empty( $a['iframe_src'] ) ) { $meta .= sprintf( '', esc_attr( $a['iframe_src'] ) ); } if ( ! empty( $a['upload_date'] ) ) { $meta .= sprintf( '', esc_attr( $a['upload_date'] ) ); } if ( ! empty( $a['duration'] ) ) { $meta .= sprintf( '', esc_attr( $a['duration'] ) ); } if( ! empty( $a['img_src'] ) ) : $thumbnail = sprintf( '', esc_attr( $a['img_src'] ) ); $meta .= arve_build_tag( array( 'name' => 'thumbnail', 'tag' => 'meta', 'attr' => array( 'itemprop' => 'thumbnailUrl', 'content' => $a['img_src'], ), ), $a ); endif; if ( ! empty( $a['title'] ) ) { $meta .= arve_build_tag( array( 'name' => 'title', 'tag' => 'meta', 'attr' => array( 'itemprop' => 'name', 'content' => trim( $a['title'] ), ) ), $a ); } if ( ! empty( $a['description'] ) ) { $meta .= sprintf( '%s', esc_html( trim( $a['description'] ) ) ); } return $meta; } function arve_build_tag( $args, $a ) { $args = apply_filters( "nextgenthemes/arve/{$args['name']}", $args, $a ); if ( ! empty( $args['content'] ) ) { $out = sprintf( '<%1$s%2$s>%3$s', esc_html( $args['tag'] ), arve_attr( $args['attr'] ), $args['content'] ); } else { $out = sprintf( '<%s%s>', esc_html( $args['tag'] ), arve_attr( $args['attr'] ) ); } return $out; } function arve_build_promote_link_html( $arve_link ) { if ( $arve_link ) { return sprintf( '%s', esc_url( 'https://nextgenthemes.com/plugins/arve-pro/' ), esc_attr( __( 'Embedded with ARVE Advanced Responsive Video Embedder WordPress plugin', ARVE_SLUG) ), esc_html__( 'ARVE', ARVE_SLUG ) ); } return ''; } function arve_arve_embed_container( $html, $atts ) { $attr['class'] = 'arve-embed-container'; if ( false === $atts['aspect_ratio'] ) { $attr['style'] = 'height:auto;padding:0'; } else { $attr['style'] = sprintf( 'padding-bottom:%F%%', arve_aspect_ratio_to_percentage( $atts['aspect_ratio'] ) ); } return sprintf( '%s', arve_attr( $attr ), $html ); } function arve_arve_wrapper( $html, $atts ) { $element = ( 'link-lightbox' == $atts['mode'] ) ? 'span' : 'div'; return sprintf( '<%s%s>%s', $element, arve_attr( $atts['wrapper_attr'] ), $html, $element ); } function arve_video_or_iframe( $atts ) { switch( $atts['provider'] ) { case 'veoh': return arve_create_object( $atts ); break; case 'html5': return arve_create_video_tag( $atts ); break; default: return arve_create_iframe_tag( $atts ); break; } } /** * * * @since 2.6.0 */ function arve_create_iframe_tag( $a ) { if ( in_array( $a['mode'], array( 'lazyload', 'lazyload-lightbox', 'link-lightbox' ) ) ) { $html = sprintf( '', arve_attr( arve_prefix_array_keys( 'data-', $a['iframe_attr'] ) ) ); } else { $html = sprintf( '', arve_attr( $a['iframe_attr'] ) ); } return apply_filters( 'arve_iframe_tag', $html, $a, $a['iframe_attr'] ); } function arve_create_video_tag( $a ) { $html = sprintf( '%s%s', arve_attr( $a['video_attr'] ), $a['video_sources_html'], $a['video_tracks_html'] ); return apply_filters( 'arve_video_tag', $html, $a, $a['video_attr'] ); } function arve_create_object_tag( $a ) { $html = sprintf( '%s%s', arve_attr( $a['video_attr'] ), $a['video_sources_html'], $a['video_tracks_html'] ); return apply_filters( 'arve_video_tag', $html, $a, $a['video_attr'] ); } function arve_error( $message ) { return sprintf( '

%s %s

', __('ARVE Error:', ARVE_SLUG ), $message ); } function arve_output_errors( $atts ) { $errors = ''; foreach ( $atts as $key => $value ) { if( is_wp_error( $value ) ) { $errors .= arve_error( $value->get_error_message() ); } } return $errors; }