]*>/i', '', $string);
$string=preg_replace('/<\/'.$tag.'>/i', '', $string);
return $string;
}
if ( ! function_exists( 'artist_painter_excerpt_more' ) ) :
/**
* Replaces "[...]" (appended to automatically generated excerpts) with ... *
*/
function artist_painter_excerpt_more($more) {
return is_admin() ? $more : ' … ';
}
endif;
add_filter( 'excerpt_more', 'artist_painter_excerpt_more' );
if( ! function_exists( 'artist_painter_footer_credit' ) ):
/**
* Footer Credits
*/
function artist_painter_footer_credit() {
$artist_painter_copyright_text = get_theme_mod('artist_painter_footer_copyright_text');
$artist_painter_text = '
';
if ($artist_painter_copyright_text) {
$artist_painter_text .= wp_kses_post($artist_painter_copyright_text);
} else {
$artist_painter_text .= esc_html__('© ', 'artist-painter') . date_i18n(esc_html__('Y', 'artist-painter'));
$artist_painter_text .= ' ' . esc_html(get_bloginfo('name')) . '' . esc_html__('. All Rights Reserved.', 'artist-painter');
}
$artist_painter_text .= '';
$artist_painter_text .= '
'.ARTIST_PAINTER_THEME_NAME . ' '. esc_html__( 'By ', 'artist-painter' ) . '' . esc_html__( 'Themeignite', 'artist-painter' ) . '.';
$artist_painter_text .= sprintf( esc_html__( ' Powered By %s', 'artist-painter' ), 'WordPress.' );
if ( function_exists( 'the_privacy_policy_link' ) ) {
$artist_painter_text .= get_the_privacy_policy_link();
}
$artist_painter_text .= ' ';
$artist_painter_text .= '';
echo apply_filters('artist_painter_footer_text', $artist_painter_text);
}
add_action('artist_painter_footer', 'artist_painter_footer_credit');
endif;
/**
* Is Woocommerce activated
*/
if ( ! function_exists( 'artist_painter_woocommerce_activated' ) ) {
function artist_painter_woocommerce_activated() {
if ( class_exists( 'woocommerce' ) ) { return true; } else { return false; }
}
}
if( ! function_exists( 'artist_painter_change_comment_form_default_fields' ) ) :
/**
* Change Comment form default fields i.e. author, email & url.
* https://blog.josemcastaneda.com/2016/08/08/copy-paste-hurting-theme/
*/
function artist_painter_change_comment_form_default_fields( $fields ){
// get the current commenter if available
$artist_painter_commenter = wp_get_current_commenter();
// core functionality
$req = get_option( 'require_name_email' );
$artist_painter_aria_req = ( $req ? " aria-required='true'" : '' );
$artist_painter_required = ( $req ? " required" : '' );
$artist_painter_author = ( $req ? __( 'Name*', 'artist-painter' ) : __( 'Name', 'artist-painter' ) );
$artist_painter_email = ( $req ? __( 'Email*', 'artist-painter' ) : __( 'Email', 'artist-painter' ) );
// Change just the author field
$fields['author'] = '';
$fields['email'] = '';
$fields['url'] = '';
return $fields;
}
endif;
add_filter( 'comment_form_default_fields', 'artist_painter_change_comment_form_default_fields' );
if( ! function_exists( 'artist_painter_change_comment_form_defaults' ) ) :
/**
* Change Comment Form defaults
* https://blog.josemcastaneda.com/2016/08/08/copy-paste-hurting-theme/
*/
function artist_painter_change_comment_form_defaults( $defaults ){
$defaults['comment_field'] = '';
return $defaults;
}
endif;
add_filter( 'comment_form_defaults', 'artist_painter_change_comment_form_defaults' );
if( ! function_exists( 'artist_painter_escape_text_tags' ) ) :
/**
* Remove new line tags from string
*
* @param $text
* @return string
*/
function artist_painter_escape_text_tags( $text ) {
return (string) str_replace( array( "\r", "\n" ), '', strip_tags( $text ) );
}
endif;
if( ! function_exists( 'wp_body_open' ) ) :
/**
* Fire the wp_body_open action.
* Added for backwards compatibility to support pre 5.2.0 WordPress versions.
*/
function wp_body_open() {
/**
* Triggered after the opening tag.
*/
do_action( 'wp_body_open' );
}
endif;
if ( ! function_exists( 'artist_painter_get_fallback_svg' ) ) :
/**
* Get Fallback SVG
*/
function artist_painter_get_fallback_svg( $artist_painter_post_thumbnail ) {
if( ! $artist_painter_post_thumbnail ){
return;
}
$artist_painter_image_size = artist_painter_get_image_sizes( $artist_painter_post_thumbnail );
if( $artist_painter_image_size ){ ?>