<?php
function theme_enqueue_styles() {
    wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );

}
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );

function my_child_theme_setup() {
  load_child_theme_textdomain( 'twentyseventeen', get_stylesheet_directory() . '/languages' );
  $content = __('Read More', 'Weiter');

} 
add_action( 'after_setup_theme', 'my_child_theme_setup' );

/**
 * WooCommerce Rechnung Zahlungsmethode, E-Mail, Telefon ausgeblendet
 */
function wc_removed_payment_method( $fields ) {
    unset( $fields['payment_method'] );
    return $fields;
}
add_filter( 'wcdn_order_info_fields', 'wc_removed_payment_method' );

function wc_removed_billing_email( $fields ) {
    unset( $fields['billing_email'] );
    return $fields;
}
add_filter( 'wcdn_order_info_fields', 'wc_removed_billing_email' );

function wc_removed_billing_phone( $fields ) {
    unset( $fields['billing_phone'] );
    return $fields;
}
add_filter( 'wcdn_order_info_fields', 'wc_removed_billing_phone' );

/**
 * Rechnungsdatum auf der Rechnung
 */
function print_order_add_invoice_date( $fields, $order ) {
	$new_fields = array();

	$order_invoice_date = wcdn_get_order_invoice_date( $order->id );
	if( $order_invoice_date ) {
		$new_fields['order_invoice_date'] = array(
			'label' => __( 'Rechnungsdatum' ),
			'value' => $order_invoice_date
		);
	}

	return array_merge( $fields, $new_fields );
}
add_filter( 'wcdn_order_info_fields', 'print_order_add_invoice_date', 10, 2 );

/*
 * WooCommerce Ähnliche Produkte-Funktion ausgeblendet
 */
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20 );

/*
 * Add style to embed links
 */
add_action( 'embed_head', 'embed_top_style' );	
function embed_top_style(){ ?>
	<style>
		.wp-embed , .wp-embed-heading , .wp-embed-heading a {
			color: #66cc33;
		}
		.wp-embed {
			background-color: #190000;
		}
		.wp-embed-heading { 
			background-color: #190000 ;
			text-align:center;
		}
		.wp-embed-featured-image img {
			display:none;
		}
                .wp-embed .wp-embed-more {
			color: #66cc33;
		}
		.wp-embed a {
			color: #66cc33;
			text-decoration: none;
		}
		.wp-embed-site-icon {
    			background-color: #66cc33;
			border-radius: 6px;
		}
		.dashicons-admin-comments , .wp-embed-comments a, .wp-embed-share-tab-button {
			display:none;
		}

	</style>	
<?php }
