File: //proc/self/root/home/madepabj/gharana.pk/price/wp-content/themes/rehub-blankchild/functions.php
<?php
add_action( 'wp_enqueue_scripts', 'enqueue_parent_theme_style' );
function enqueue_parent_theme_style() {
wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' );
if (is_rtl()) {
wp_enqueue_style( 'parent-rtl', get_template_directory_uri().'/rtl.css', array(), RH_MAIN_THEME_VERSION);
}
}
function featuredtoRSS($content) {
global $post;
if ( has_post_thumbnail( $post->ID ) ){
$content = '<div>' . get_the_post_thumbnail( $post->ID, 'medium', array( 'style' => 'margin-bottom: 15px;' ) ) . '</div>' . $content;
}
return $content;
}
add_filter('the_excerpt_rss', 'featuredtoRSS');
add_filter('the_content_feed', 'featuredtoRSS');
/**
* Reorder product data tabs
*/
add_filter( 'woocommerce_product_tabs', 'woo_reorder_tabs', 98 );
function woo_reorder_tabs( $tabs ) {
$tabs['additional_information']['priority'] = 5;
$tabs['woo-photo-booking']['priority'] = 10;
$tabs['woo-custom-videos']['priority'] = 15;
$tabs['description']['priority'] = 20;
$tabs['reviews']['priority'] = 25;
return $tabs;
}
/**
* Rename product data tabs
*/
add_filter( 'woocommerce_product_tabs', 'woo_rename_tabs', 98 );
function woo_rename_tabs( $tabs ) {
$tabs['additional_information']['title'] = __( 'Specification' ); // Rename the additional information tab
return $tabs;
}
// Start FrontEnd
// add_filter( 'woocommerce_product_tabs', 'echoatheme_custom_tab' );
// function echoatheme_custom_tab( $tabs ) {
// global $product;
// $meta_value = get_post_meta( get_the_ID(), '_product_extra_features', true );
// // Check if the custom field has a value.
// if ( ! empty( $meta_value ) ) {
// $tabs['echoatheme_custom_tab'] = array(
// 'title' => 'FAQ',
// 'callback' => 'echoatheme_custom_tab_content',
// 'priority' => 50,
// );
// }
// return $tabs;
// }
// function echoatheme_custom_tab_content() {
// // The new tab content
// $prod_id = get_the_ID();
// echo'<div class="rh-woo-section-title"><h2 class="rh-heading-icon">FAQs:</h2></div><p>'.get_post_meta($prod_id,'_product_extra_features',true).'</p>';
// }
// // Backend
// // Display Fields
// add_action('woocommerce_product_options_general_product_data', 'woocommerce_product_custom_fields');
// // Save Fields
// add_action('woocommerce_process_product_meta', 'woocommerce_product_custom_fields_save');
// function woocommerce_product_custom_fields()
// {
// global $woocommerce, $post , $product_object;
// echo '<div class="product_custom_field">
// <p>' . __( "FAQ: " ) . '</p>
// <div style="padding:9px;">';
// $content = $product_object->get_meta( '_product_extra_features' );
// wp_editor( $content, '_product_extra_features', ['textarea_rows' => 6] );
// echo '</div></div>';
// }
// function woocommerce_product_custom_fields_save($post_id)
// {
// // Custom Product Textarea Field
// $woocommerce_product_extra_features = $_POST['_product_extra_features'];
// // if ($woocommerce_product_extra_features)
// update_post_meta($post_id, '_product_extra_features', $woocommerce_product_extra_features);
// }
?>