This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Add the below line to your theme functions.php file | |
add_filter( 'woocommerce_prevent_admin_access', '__return_false' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Add to functions.php. Replace country_code with a CCTLD | |
*/ | |
function wp_job_manager_region_bias() { | |
return 'country_code'; | |
} | |
add_filter( 'job_manager_geolocation_region_cctld', 'wp_job_manager_region_bias' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: PayPal Sandbox IPN Tester | |
* Description: Pings the IPN endpoint to see if your server can connect. Just head to <a href="/?ipn-test=1">yoursite.com/?ipn-test=1</a> whilst logged in as admin. | |
* Version: 1.0.0 | |
* Author: WooThemes | |
* Requires at least: 4.1 | |
* Tested up to: 4.3 | |
*/ | |
if ( ! defined( 'ABSPATH' ) ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'job_application_form_fields', 'alter_allowed_mime_types' ); | |
function alter_allowed_mime_types( $fields ) { | |
$fields['application_attachment']['allowed_mime_types'] = array( | |
'doc' => 'application/msword', | |
'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', | |
'pdf' => 'application/pdf', | |
); | |
return $fields; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Listify Region Bias | |
*/ | |
function listify_region_bias() { | |
return 'country_code'; | |
} | |
add_filter( 'job_manager_geolocation_region_cctld', 'listify_region_bias' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Hide Free Shipping for some states | |
*/ | |
add_filter( 'woocommerce_package_rates', 'hide_all_shipping_when_free_is_available' , 10, 2 ); | |
function hide_all_shipping_when_free_is_available( $rates, $package ) { | |
$excluded_states = array( 'AK', 'HI', 'GU', 'PR' ); | |
if( isset( $rates['free_shipping'] ) AND in_array( WC()->customer->get_shipping_state(), $excluded_states ) ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if ( ( $apply = get_the_job_application_method() ) && current_user_can( 'employer' ) ) : | |
wp_enqueue_script( 'wp-job-manager-job-application' ); | |
?> | |
<div class="job_application application"> | |
<?php do_action( 'job_application_start', $apply ); ?> | |
<input type="button" class="application_button button" value="<?php _e( 'Apply for job', 'wp-job-manager' ); ?>" /> | |
<div class="application_details"> | |
<?php |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'woocommerce_flat_rate_shipping_add_rate', 'add_another_custom_flat_rate', 10, 2 ); | |
function add_another_custom_flat_rate( $method, $rate ) { | |
$new_rate = $rate; | |
$new_rate['id'] .= ':' . 'next_day'; // Append a custom ID | |
$new_rate['label'] = 'Next Day'; // Rename to 'Rushed Shipping' | |
$new_rate['cost'] += 2; // Add $2 to the cost |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( $attribute['is_taxonomy'] ) { | |
$values = wc_get_product_terms( $product->id, $attribute['name'], array( 'fields' => 'ids' ) ); | |
$links = array(); | |
foreach ( $values as $value ) { | |
$term = get_term_by( 'id', $value, $attribute['name'] ); | |
$links[] = '<a href="' . esc_url( get_term_link( $term->slug, $attribute['name'] ) ) . '">' . esc_html( $term->name ) . '</a>'; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* WooCommerce Extra Feature | |
* -------------------------- | |
* | |
* Register a shortcode that creates a product categories dropdown list | |
* | |
* Use: [product_categories_dropdown orderby="title" count="0" hierarchical="0"] | |
*/ |