array(
'href' => array()
),
'span' => array(),
'i' => array(
'class' => array()
)
);
$siteUrl = home_url('/');
if( has_custom_logo() ) {
$custom_logo_id = get_theme_mod( 'custom_logo' );
$siteLogo = '';
$siteLogo .= '';
$siteLogo .= edura_img_tag( array(
"class" => "img-fluid",
"url" => esc_url( wp_get_attachment_image_url( $custom_logo_id, 'full') )
) );
$siteLogo .= '';
return $siteLogo;
} elseif( !edura_opt('edura_text_title') && edura_opt('edura_site_logo', 'url' ) ){
$siteLogo = '
';
return ''.$siteLogo.'';
}elseif( edura_opt('edura_text_title') ){
return '
';
}else{
return '';
}
}
// custom meta id callback
function edura_meta( $id = '' ){
$value = get_post_meta( get_the_ID(), '_edura_'.$id, true );
return $value;
}
// Blog Date Permalink
function edura_blog_date_permalink() {
$year = get_the_time('Y');
$month_link = get_the_time('m');
$day = get_the_time('d');
$link = get_day_link( $year, $month_link, $day);
return $link;
}
//audio format iframe match
function edura_iframe_match() {
$audio_content = edura_embedded_media( array('audio', 'iframe') );
$iframe_match = preg_match("/\iframe\b/i",$audio_content, $match);
return $iframe_match;
}
//Post embedded media
function edura_embedded_media( $type = array() ){
$content = do_shortcode( apply_filters( 'the_content', get_the_content() ) );
$embed = get_media_embedded_in_content( $content, $type );
if( in_array( 'audio' , $type) ){
if( count( $embed ) > 0 ){
$output = str_replace( '?visual=true', '?visual=false', $embed[0] );
}else{
$output = '';
}
}else{
if( count( $embed ) > 0 ){
$output = $embed[0];
}else{
$output = '';
}
}
return $output;
}
// WP post link pages
function edura_link_pages(){
wp_link_pages( array(
'before' => '' . esc_html__( 'Pages:', 'edura' ) . '',
'after' => '
',
'link_before' => '',
'link_after' => '',
'pagelink' => '' . esc_html__( 'Page', 'edura' ) . ' %',
'separator' => ', ',
) );
}
// Data Background image attr
function edura_data_bg_attr( $imgUrl = '' ){
return 'data-bg-img="'.esc_url( $imgUrl ).'"';
}
// image alt tag
function edura_image_alt( $url = '' ){
if( $url != '' ){
// attachment id by url
$attachmentid = attachment_url_to_postid( esc_url( $url ) );
// attachment alt tag
$image_alt = get_post_meta( esc_html( $attachmentid ) , '_wp_attachment_image_alt', true );
if( $image_alt ){
return $image_alt ;
}else{
$filename = pathinfo( esc_url( $url ) );
$alt = str_replace( '-', ' ', $filename['filename'] );
return $alt;
}
}else{
return;
}
}
// Flat Content wysiwyg output with meta key and post id
function edura_get_textareahtml_output( $content ) {
global $wp_embed;
$content = $wp_embed->autoembed( $content );
$content = $wp_embed->run_shortcode( $content );
$content = wpautop( $content );
$content = do_shortcode( $content );
return $content;
}
/**
* Add a pingback url auto-discovery header for single posts, pages, or attachments.
*/
function edura_pingback_header() {
if ( is_singular() && pings_open() ) {
echo '';
}
}
add_action( 'wp_head', 'edura_pingback_header' );
// Excerpt More
function edura_excerpt_more( $more ) {
return '...';
}
add_filter( 'excerpt_more', 'edura_excerpt_more' );
// edura comment template callback
function edura_comment_callback( $comment, $args, $depth ) {
$add_below = 'comment';
?>
>
array(
'class' => array()
),
'i' => array(
'class' => array()
),
'span' => array(
'class' => array(),
),
'a' => array(
'href' => array(),
'title' => array(),
'class' => array(),
),
'br' => array(),
'em' => array(),
'strong' => array(),
'b' => array(),
);
echo '