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
function pc_theme_setup() { | |
add_image_size( 'pc_sidebar_image', 300, 100, true ); // width: 300, height: 100 - feel free to change these values | |
} | |
add_action( 'after_setup_theme', 'pc_theme_setup' ); | |
function pc_thumbnail_size( $size ) { | |
return 'pc_sidebar_image'; | |
} |
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
function rp4wp_force_same_category( $sql, $post_id, $post_type ) { | |
global $wpdb; | |
if ( 'post' !== $post_type ) { | |
return $sql; | |
} | |
$sql_replace = " | |
INNER JOIN " . $wpdb->term_relationships . " ON (R.`post_id` = " . $wpdb->term_relationships . ".object_id) | |
INNER JOIN " . $wpdb->term_taxonomy . " ON (" . $wpdb->term_relationships . ".term_taxonomy_id = " . $wpdb->term_taxonomy . ".term_taxonomy_id) |
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
/** | |
* All downloads require visitors to be logged in | |
* | |
* @param $can_download | |
* @param $download | |
* | |
* @return bool | |
*/ | |
function vbmcauwemt_check_access( $can_download, $download ) { |
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( 'rp4wp_disable_css', '__return_true' ); |
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( 'wc_anti_fraud_rules', 'wc_remove_antifraud_rules'); | |
/** | |
* Remove unwanted anti-fraud rules | |
* | |
* @return array | |
*/ | |
function wc_remove_antifraud_rules( $rules ) { | |
foreach ( $rules as $key => $rule ) { |
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
// Mark virtual orders as complete instead of processing | |
function rp4wp_virtual_order_payment_complete_order_status( $order_status, $order_id ) { | |
$order = new WC_Order( $order_id ); | |
if ( 'processing' == $order_status && ( 'on-hold' == $order->status || 'pending' == $order->status || 'failed' == $order->status ) ) { | |
$virtual_order = false; | |
if ( count( $order->get_items() ) > 0 ) { |
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
function bk_rp4wp_change_weight( $weight, $post, $meta_field ) { | |
if ( 'my_post_type' === $post->post_type && 'my_post_meta_field' === $meta_field ) { | |
$weight = 100; | |
} | |
return $weight; | |
} | |
add_filter( 'rp4wp_related_meta_fields_weight', 'bk_rp4wp_change_weight', 10, 3 ); |
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
function custom_rp4wp_add_meta_fields( $meta_fields, $post_id, $post ) { | |
// replace my_post_type with your post type | |
if ( 'my_post_type' === $post->post_type ) { | |
// replace my_post_meta_field with your meta key. You can add as many as you like | |
$meta_fields[] = 'my_post_meta_field'; | |
} | |
return $meta_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
function wpjm_rp4wp_add_meta_fields( $meta_fields, $post_id, $post ) { | |
if ( 'post' == $post->post_type ) { | |
$meta_fields = array( 'wpjm_company' ); | |
} | |
return $meta_fields; | |
} | |
add_filter( 'rp4wp_related_meta_fields', 'wpjm_rp4wp_add_meta_fields', 10, 3 ); |