Skip to content

Instantly share code, notes, and snippets.

Gareth Harris plugin-republic

Block or report user

Report or block plugin-republic

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View pewc_filter_initial_accordion_states.php
<?php
/**
* Set all groups to closed (or open) in an accordion
*/
function prefix_filter_initial_accordion_states( $state, $post_id ) {
return 'closed'; // Comment this out and uncomment the line below to set all groups to open
// return 'open';
}
add_filter( 'pewc_filter_initial_accordion_states', 'prefix_filter_initial_accordion_states', 10, 2 );
View pewc_product_extra_fields.php
<?php
/**
* Display add-on fields on products that do not have a price
*/
add_action( 'woocommerce_single_product_summary', 'pewc_product_extra_fields' );
View ie11_tab_hack.css
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
.pewc-tab {
display: none;
}
.pewc-groups-tabs .pewc-group-wrap {
display: block !important;
}
.pewc-radio-image-wrapper label input,
.pewc-checkbox-image-wrapper label input {
visibility: visible;
View add_weight_product_addon.php
/**
* Add title to radio and select options
*/
function prefix_add_option_param_titles( $group_id, $item_key, $item ) {
?>
<style type="text/css">
.pewc-option-option,
.pewc-option-price,
.pewc-option-extra {
width: 30%;
View pewc_filter_settings.php
<?php
/**
* Add new options to the global Product Add-Ons Ultimate settings
*/
function prefix_filter_settings( $settings ) {
$settings['prefix_section_title'] = array(
'name' => __( 'New Title', 'pewc' ),
'type' => 'title',
'desc' => '',
'id' => 'prefix_section_title'
View wcfad_search_products_method.php
<?php
/**
* Include variations in products rule
*/
function prefix_search_products_method( $method, $args ) {
return 'woocommerce_json_search_products_and_variations';
}
add_filter( 'wcfad_search_products_method', 'prefix_search_products_method', 10, 2 );
View pewc_number_field_step_decimals.php
<?php
/**
* Filter the step parameter in Number fields to return decimals
*/
function prefix_number_field_step( $step, $item ) {
return 0.01;
}
add_filter( 'pewc_number_field_step', 'prefix_number_field_step', 10, 2 );
View pewc_filter_view_product_text
<?php
/**
* Filter 'View Product' text
*/
function prefix_filter_view_product_text( $text, $product ) {
return 'Select Options';
}
add_filter( 'pewc_filter_view_product_text', 'prefix_filter_view_product_text', 10, 2 );
View pewc_enable_ajax_load_addons.php
<?php
/**
* Use AJAX to load add-ons on product edit screens
*/
add_filter( 'pewc_enable_ajax_load_addons', '__return_true' );
View pewc_enable_groups_as_post_types.php
<?php
/**
* Edit global groups as post types
*/
add_filter( 'pewc_enable_groups_as_post_types', '__return_true' );
You can’t perform that action at this time.