Skip to content

Instantly share code, notes, and snippets.

View barrykooij's full-sized avatar
:shipit:
I may be slow to respond.

Barry Kooij barrykooij

:shipit:
I may be slow to respond.
View GitHub Profile
### Keybase proof
I hereby claim:
* I am barrykooij on github.
* I am barrykooij (https://keybase.io/barrykooij) on keybase.
* I have a public key ASCQImBJHG-GQAehhEjkurFUFlgqLOdRgiRFyR09yUKYhQo
To claim this, I am signing this object:
function register_thumbnail_function() {
require_once( 'path_to_you_custom_thumbnail_file.php' );
}
add_action( 'plugins_loaded', 'register_thumbnail_function', 9 );
/**
* Adding custom filter to WP Car Manager
*/
add_action( 'wpcm_listings_vehicle_filters', 'wpcm_custom_template_vehicle_listings_filters_color', 14 );
function wpcm_custom_template_vehicle_listings_filters_color() {
wp_car_manager()->service( 'template_manager' )->get_template_part( 'listings/filters/color' );
}
cd /var/www/yourwebsite.com
wp rp4wp remove_related post
wp rp4wp link post 3
add_action( 'wpcm_st_after_icons', function( $url, $title, $vehicle ) {
// your share icon here. Note that $url is urlencoded
}, 10, 3 );
function my_custom_symbol( $currency_symbol, $currency ) {
if( $currency == 'LKR') {
$currency_symbol = 'The special LKR symbol';
}
return $currency_symbol;
}
add_filter( 'wpcm_currency_symbol', 'my_custom_symbol' );
add_action( 'init', function() {
add_image_size( 'wpcm_my_custom_listing_image_size', 200, 200, true ); // replace 100, 100 with size you like
} );
add_filter( 'wpcm_listings_vehicle_thumbnail_size', function( $image_size ) {
return 'wpcm_my_custom_listing_image_size';
} );
function dlm_ninja_forms_redirect_to_download() {
if ( isset( $_POST['_download_id'] ) && is_numeric( $_POST['_download_id'] ) ) {
global $ninja_forms_processing;
$ninja_forms_processing->update_form_setting( 'landing_page', site_url( '/download/' . $_POST['_download_id'] . '/' ) );
}
}
add_action( 'ninja_forms_post_process', 'dlm_ninja_forms_redirect_to_download', 1, 2 );
/**
* All downloads require visitors to be logged in
*
* @param $can_download
* @param $download
*
* @return bool
*/
function dlm_all_downloads_members_only( $can_download, $download ) {