Skip to content

Instantly share code, notes, and snippets.

View ramshengale's full-sized avatar

Ram Shengale ramshengale

View GitHub Profile
@ramshengale
ramshengale / search-and-filter-events-calendar-venue-filter.php
Last active August 27, 2021 12:53
Show Venue as filter in Search and Filter Pro plugin for The Events Calendar plugin's event post type
<?php
/*
* Add a post meta field in S&F plugin and select _EventVenueID and then put this in functions.php
*/
add_filter('sf_input_object_pre', function ($input_object, $sfid) {
if ($input_object['name'] == '_sfm__EventVenueID' && $sfid == 1048) {
if (! isset($input_object['options'])) {
return $input_object;
<?php
/**
* Social share function. Use with
* add_action to inject on frontend
*/
function fs_social_share_icons()
{
$post_id = get_the_ID();
$shareURL = rawurlencode(get_permalink($post_id));
$shareTitle = str_replace(' ', '%20', get_the_title($post_id));