Skip to content

Instantly share code, notes, and snippets.

View yousufansa's full-sized avatar

Yusuf Ansari yousufansa

View GitHub Profile
@yousufansa
yousufansa / functions.php
Created December 14, 2020 08:46
Vodi - Brid Video Player Support
.movie__player > div.brid,
.single-video__head > div.brid,
.episode__player > div.brid {
position: absolute !important;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
@yousufansa
yousufansa / functions.php
Last active December 14, 2020 16:27
WordPress 5.6 Update Editor Width Fix
if( ! function_exists( 'wp_5_6_editor_wp_block_width_fix' ) ) {
function wp_5_6_editor_wp_block_width_fix() {
if( version_compare( get_bloginfo( 'version' ), '5.6', '>=' ) ) {
echo '<style>.interface-interface-skeleton__editor { max-width: 100%; }</style>';
}
}
}
add_action( 'admin_head', 'wp_5_6_editor_wp_block_width_fix' );
@yousufansa
yousufansa / functions.php
Created December 10, 2020 17:55
Electro - WC Marketplace - Display Vendor Info On Deals Products
if ( ! function_exists( 'ec_child_display_sold_by_product_product_deal_product' ) ) {
function ec_child_display_sold_by_product_product_deal_product() {
if( class_exists( 'WCFMmp' ) ) {
global $WCFMmp;
add_action('electro_onsale_product_content', array( $WCFMmp->frontend, 'wcfmmp_sold_by_product' ), 45 );
add_action('electro_onsale_product_carousel_content', array( $WCFMmp->frontend, 'wcfmmp_sold_by_product' ), 35 );
add_action('electro_onsale_product_carousel_content_v2', array( $WCFMmp->frontend, 'wcfmmp_sold_by_product' ), 55 );
add_action('electro_onsale_product_carousel_content_v3', array( $WCFMmp->frontend, 'wcfmmp_sold_by_product' ), 125 );
}
@yousufansa
yousufansa / functions.php
Created December 10, 2020 10:27
Vodi - Disable Search Result Page Tabs
add_filter( 'vodi_video_search_result_page_header_tab', '__return_false' );
@yousufansa
yousufansa / functions.php
Created December 10, 2020 10:03
Jobhunt - Remove Resume Fields
if( ! function_exists( 'jh_child_submit_resume_field_remove' ) ) {
function jh_child_submit_resume_field_remove( $fields ) {
if( isset( $fields['resume_fields']['candidate_title'] ) ) {
unset( $fields['resume_fields']['candidate_title'] );
}
if( isset( $fields['resume_fields']['candidate_video'] ) ) {
unset( $fields['resume_fields']['candidate_video'] );
}
@yousufansa
yousufansa / functions.php
Created December 10, 2020 10:02
Jobhunt - Remove Job & Company Submit Form Fields
if ( ! function_exists( 'jh_child_customize_job_manager_job_form_company_fields' ) ) {
function jh_child_customize_job_manager_job_form_company_fields( $fields ) {
if( isset( $fields['job']['job_type'] ) ) {
unset( $fields['job']['job_type'] );
}
if( isset( $fields['job']['job_category'] ) ) {
unset( $fields['job']['job_category'] );
}
@yousufansa
yousufansa / functions.php
Created December 9, 2020 15:23
Vodi - Hot Premier Show Block Columns Issue Fix
.hot-premier-show .columns-5 .movies__inner>.movie,
.hot-premier-show .columns-7 .movies__inner>.movie {
-webkit-box-flex: 0;
flex: 0 0 50%;
max-width: 50%;
}
@media (min-width: 768px) {
.hot-premier-show .columns-5 .movies__inner>.movie,
@yousufansa
yousufansa / functions.php
Created December 8, 2020 10:15
Electro - Dokan Dashboard Font Awesome Icons Missing Issue Fix
if ( ! function_exists( 'ec_child_enqueue_dokan_fontawesome' ) ) {
function ec_child_enqueue_dokan_fontawesome() {
if ( function_exists( 'is_dokan_activated' ) && is_dokan_activated() ) {
wp_enqueue_style( 'dokan-fontawesome' );
}
}
}
add_action( 'wp_enqueue_scripts', 'ec_child_enqueue_dokan_fontawesome', 12 );
@yousufansa
yousufansa / functions.php
Last active December 9, 2020 15:11
Jobhunt - Redirect Non Logged in User From WC Account Page to Jobhunt Register/Login Page
if ( ! function_exists( 'jh_child_wc_account_redirect_non_logged_user_to_login_jobhunt_login_form' ) ) {
function jh_child_wc_account_redirect_non_logged_user_to_login_jobhunt_login_form() {
if ( ! is_user_logged_in() && ( ( is_account_page() && ! is_lost_password_page() ) || ( function_exists( 'jh_wpjm_get_page_id' ) && is_page( jh_wpjm_get_page_id( 'jobs-dashboard' ) ) ) ) ) {
$register_login_page = jobhunt_submit_job_form_login_url( get_permalink( get_option('woocommerce_myaccount_page_id') ) );
wp_redirect( $register_login_page );
exit();
}
}
}
add_action( 'template_redirect', 'jh_child_wc_account_redirect_non_logged_user_to_login_jobhunt_login_form' );
@yousufansa
yousufansa / functions.php
Created December 7, 2020 16:30
Jobhunt - Disable Handheld Offcanvas Nav Menu
if ( ! function_exists( 'jh_child_remove_handheld_offcanvas_nav' ) ) {
function jh_child_remove_handheld_offcanvas_nav() {
remove_action( 'jobhunt_header_handheld', 'jobhunt_off_canvas_nav', 10 );
}
}
add_action( 'init', 'jh_child_remove_handheld_offcanvas_nav' );