Skip to content

Instantly share code, notes, and snippets.

@JasvinderSingh1
Last active November 21, 2018 11:08
Show Gist options
  • Save JasvinderSingh1/0b29d5532d7dc65db31744ee451cc45f to your computer and use it in GitHub Desktop.
Save JasvinderSingh1/0b29d5532d7dc65db31744ee451cc45f to your computer and use it in GitHub Desktop.
/**
* To make archive listing yearly instead of monthly
*/
function my_limit_archives( $args ) {
$args['type'] = 'yearly';
return $args;
}
add_filter( 'widget_archives_args', 'my_limit_archives' );
add_filter( 'widget_archives_dropdown_args', 'my_limit_archives' );
/**
* To remove uncategorised category from product category sidebar widget
*/
add_filter( 'woocommerce_product_categories_widget_args', 'woo_product_cat_widget_args' );
function woo_product_cat_widget_args( $cat_args ) {
$cat_args['exclude'] = get_option( 'default_product_cat' );
return $cat_args;
}
/*
* Redirect user to home url after password reset
*/
function itsg_after_password_reset_redirect() {
wp_redirect( home_url() );
exit; // always exit after wp_redirect
}
add_action('after_password_reset', 'itsg_after_password_reset_redirect');
/*
* enque script and style in amdin
*/
add_action( 'admin_enqueue_scripts', array('church_survey_admin_enqueue_scripts' ) );
add_action( 'wp_enqueue_scripts', array( 'add_theme_scripts' ) );
function church_survey_admin_enqueue_scripts(){
wp_enqueue_script( 'church_survey_backend_handle', CHURCHSURVEY_URI.'assets/js/church-survey-backend.js', array('jquery'), CUSPRICECAL_VERSION, 'all');
wp_enqueue_style( 'custom_wp_admin_css', plugins_url('assets/admin/css/style.css', __FILE__) );
wp_enqueue_script( 'highchart1', 'https://code.highcharts.com/highcharts.js', array ( 'jquery' ), 1.1, true);
wp_enqueue_script( 'highchart5', 'https://code.highcharts.com/modules/annotations.js', array ( 'jquery' ), 1.1, true);
wp_enqueue_script( 'highchart4', 'https://code.highcharts.com/highcharts-more.js', array ( 'jquery' ), 1.1, true);
wp_enqueue_script( 'highchart2', 'https://code.highcharts.com/modules/exporting.js', array ( 'jquery' ), 1.1, true);
wp_enqueue_script( 'highchart3', 'https://code.highcharts.com/modules/export-data.js', array ( 'jquery' ), 1.1, true);
wp_enqueue_script( 'highcharts_custom', CHURCHSURVEY_URI.'assets/js/highcharts-custom.js', array('jquery'), 1.1, 'all');
}
function add_theme_scripts() {
wp_enqueue_script( 'survey_end_date', CHURCHSURVEY_URI.'assets/js/request-survey-auto-end-date.js', array('jquery'), 1.1, 'all');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment