Skip to content

Instantly share code, notes, and snippets.

@farookibrahim
farookibrahim / functions.php
Created September 21, 2020 12:15
MAS Videos - Episode Archive Display TV Show Name
add_filter( 'masvideos_template_loop_episode_display_tv_show_name_before_title', '__return_true', 20 );
@farookibrahim
farookibrahim / functions.php
Created August 14, 2020 14:36
Vodi - Single Episode v4 remove before head content
if ( ! function_exists( 'vodi_child_toggle_single_episode_hooks' ) ) {
function vodi_child_toggle_single_episode_hooks() {
$style = vodi_get_single_episode_style();
if( $style === 'v4' ) {
remove_action( 'masvideos_before_single_episode_summary', 'masvideos_template_single_episode_before_head', 9 );
}
}
}
add_action( 'masvideos_before_single_episode', 'vodi_child_toggle_single_episode_hooks', 11 );
@farookibrahim
farookibrahim / functions.php
Created August 11, 2020 14:57
Electro - Force Redux Framework to 3.x
function ec_child_tgmpa_plugins_force_redux_3( $plugins ) {
foreach ( $plugins as $key => $plugin ) {
if( isset( $plugin['slug'] ) && $plugin['slug'] == 'redux-framework' ) {
$plugins[$key]['source'] = 'https://transvelo.github.io/included-plugins/redux-framework.3.6.18.zip';
}
}
return $plugins;
}
add_filter( 'ec_tgmpa_plugins', 'ec_child_tgmpa_plugins_force_redux_3', 20 );
@farookibrahim
farookibrahim / functions.php
Created July 28, 2020 15:36
Vodi - TV Show single "You may also like" section update columns in carousel
if( ! function_exists( 'vi_child_single_related_tv_shows_carousel_carousel_args' ) ) {
function vi_child_single_related_tv_shows_carousel_carousel_args( $args ) {
$args['slidesToShow'] = 7;
$args['slidesToScroll'] = 7;
return $args;
}
}
add_filter( 'vodi_template_single_related_tv_shows_carousel_carousel_args', 'vi_child_single_related_tv_shows_carousel_carousel_args' );
@farookibrahim
farookibrahim / functions.php
Created July 28, 2020 15:28
Vodi - TV Show single "You may also like" section move below Tabs
if( ! function_exists( 'vi_child_single_tv_show_move_related_tv_shows_carousel' ) ) {
function vi_child_single_tv_show_move_related_tv_shows_carousel() {
remove_action( 'masvideos_after_single_tv_show_summary', 'vodi_template_single_related_tv_shows_carousel', 20 );
add_action( 'masvideos_after_single_tv_show_summary', 'vodi_template_single_related_tv_shows_carousel', 40 );
}
}
add_action( 'init', 'vi_child_single_tv_show_move_related_tv_shows_carousel', 20 );
@farookibrahim
farookibrahim / functions.php
Created July 28, 2020 15:23
Vodi - TV Show single description move to above Review
if( ! function_exists( 'vi_child_customize_single_tv_show_tabs' ) ) {
function vi_child_customize_single_tv_show_tabs( $tabs ) {
unset( $tabs['description'] );
return $tabs;
}
}
add_filter( 'masvideos_template_single_tv_show_tabs', 'vi_child_customize_single_tv_show_tabs' );
if( ! function_exists( 'vi_child_single_tv_show_move_description' ) ) {
@farookibrahim
farookibrahim / functions.php
Created July 28, 2020 05:14
Cartzilla - WC My Account Page Custom Menu Items
if ( ! function_exists( 'cz_child_custom_my_account_tab' ) ) {
function cz_child_custom_my_account_tab( $items ) {
$items['custom-tab'] = 'Custom Tab Title';
return $items;
}
}
add_filter( 'woocommerce_account_menu_items', 'cz_child_custom_my_account_tab', 99 );
@farookibrahim
farookibrahim / functions.php
Created July 22, 2020 14:28
Vodi - Single Movie v3 move Sources below title from tabs
if( ! function_exists( 'vi_child_movie_v3_add_sources_below_title' ) ) {
function vi_child_movie_v3_add_sources_below_title() {
$style = vodi_get_single_movie_style();
if ( $style == 'v3' ) {
global $movie;
if ( $movie && ( $movie->has_sources() ) ) {
echo '<div class="movie-sources-wrap">';
echo '<h4>' . esc_html__( 'Sources', 'masvideos' ) . '</h4>';
@farookibrahim
farookibrahim / functions.php
Created July 21, 2020 12:38
Vodi - Customize Video Upload Fields
if( ! function_exists( 'vi_child_customize_upload_video_fields' ) ) {
function vi_child_customize_upload_video_fields( $fields ) {
$status_options = array(
'publish' => __( 'Publish', 'masvideos' ),
'pending' => __( 'Pending', 'masvideos' ),
'draft' => __( 'Draft', 'masvideos' ),
'private' => __( 'Private', 'masvideos' ),
);
if( ! apply_filters( 'masvideos_allow_users_to_publish_video', false ) ) {
@farookibrahim
farookibrahim / functions.php
Created July 20, 2020 12:26
Electro - Display "Made In:" meta below single product title
if ( ! function_exists( 'el_child_custom_made_in_info' ) ) {
function el_child_custom_made_in_info() {
$made_in_country = get_post_meta( get_the_ID(), 'made_in_country', true );
if( ! empty( $made_in_country ) ) {
?><div class="electro-made-in-country">
<?php echo esc_html__( 'Made in:', 'electro' );?> <span><?php echo esc_html( $made_in_country ); ?></span>
</div><?php
}
}
}