Skip to content

Instantly share code, notes, and snippets.

View bskousen's full-sized avatar

Brendan Skousen bskousen

View GitHub Profile
@bskousen
bskousen / gist:cec1975cf59712f4b9b04f97d130c990
Created May 4, 2020 21:53
tribe_events_event_schedule_details_inner (before concatenation) or tribe_events_event_schedule_details (after concatenation)
/**
* Provides an opportunity to modify the *inner* schedule details HTML (ie before it is
* wrapped).
*
* @param string $inner_html the output HTML
* @param int $event_id post ID of the event we are interested in
*/
$inner = apply_filters( 'tribe_events_event_schedule_details_inner', $cache_details[ $cache_details_key ], $event->ID );
// Wrap the schedule text
$schedule = $before . $inner . $after;
@bskousen
bskousen / gist:2d969561d9b9e44a1d4b7d42a16fd35e
Created May 2, 2020 06:43
Open Additional Fields URL in New tab
add_filter( 'tribe_get_event_website_link_target', 'tribe_open_new_tab' );
function tribe_open_new_tab() {
return '_blank';
}
@bskousen
bskousen / gist:9c37cf64b71a45fadf21e58461829c57
Created April 29, 2020 23:54
Add javascript to Month, Day, List, Week, Photo, and Map views after template
function tribe_hook_javascript() {
if (tribe_is_month() || (tribe_is_day) || (tribe_is_week) || (tribe_is_map) || (tribe_is_photo) || (tribe_is_list_view)) {
?>
<script type="text/javascript">
document.write("JavaScript is a simple language for javatpoint learners");
</script>
<?php
}
}
add_action('tribe_events_after_template', 'tribe_hook_javascript');
@bskousen
bskousen / gist:a2efbdf15f071cb8dae0b750e2bff2bc
Created April 29, 2020 23:45
Add Javascript after Month template in V1 The Events Calendar
function tribe_hook_javascript() {
if (tribe_is_month()) {
?>
<script type="text/javascript">
document.write("JavaScript is a simple language for javatpoint learners");
</script>
<?php
}
}
add_action('tribe_events_after_template', 'tribe_hook_javascript');
@bskousen
bskousen / gist:97eccd7377b121b2c6a791f693409726
Created April 29, 2020 23:22
Add Javascript to Footer in Tribe Events Month View
function tribe_hook_javascript() {
if (tribe_is_month()) {
?>
<script type="text/javascript">
// add your code here
</script>
<?php
}
}
add_action('wp_footer', 'tribe_hook_javascript');
@bskousen
bskousen / gist:b97184a1e80d9b908920e33d4efc350b
Last active April 24, 2020 13:17
Lightsail LEMP Wordpress Launch script with RDS and Redis Elasticache
# Update First
apt-get update -y
# Get PHP stuff
add-apt-repository ppa:ondrej/php -y
apt-get -y install php7.3
# Remove added Apache
apt-get purge apache2 -y
@bskousen
bskousen / hide-list-fix.php
Created December 19, 2019 16:59
Hide List Fix
<?php
/**
* Plugin Name: The Events Calendar REST API Hide from Listing fix
* Description: This plugin is a temporary fix for The Events Calendar REST API issue that prevents events updated via
* the REST API from correctly showing in the calendar.
*/
/**
* Filters the post array arguments generated during a TEC REST request to update an event to remove empty
* `hide_from_listings` values.
*
@bskousen
bskousen / tec-rest-api-hide.php
Created December 17, 2019 18:18
The Events Calendar REST API Hide from Listing fix
<?php
/**
* Plugin Name: The Events Calendar REST API Hide from Listing fix
* Description: This plugin is a temporary fix for The Events Calendar REST API issue that prevents events updated via
* the REST API from correctly showing in the calendar.
*/
/**
* Filters the post array arguments generated during a TEC REST request to update an event to remove empty
* `hide_from_listings` values.
*
bitnami@ip-172-31-26-152:~/htdocs$ npm start
> maticjs-web@1.0.0 start /opt/bitnami/apache2/htdocs
> webpack-dev-server --hot
module.js:550
throw err;
^
Error: Cannot find module 'webpack-cli/bin/config-yargs'