Skip to content

Instantly share code, notes, and snippets.

View alaasalama's full-sized avatar

Alaa AlDin Salama alaasalama

View GitHub Profile
@alaasalama
alaasalama / example.php
Last active October 9, 2019 09:44 — forked from skyshab/example.php
Customize the events month view title
<?php
add_filter('tribe_get_events_title', 'my_custom_events_title');
function my_custom_events_title( $title ) {
$events_label_plural = tribe_get_event_label_plural();
if ( tribe_is_month() ) {
$title = sprintf(
esc_html_x( '%1$s %2$s %3$s', 'month view', 'the-events-calendar' ),
$events_label_plural,
'for',
date_i18n( tribe_get_date_option( 'monthAndYearFormat', 'F Y' ), strtotime( tribe_get_month_view_date() ) )
@alaasalama
alaasalama / remove-categories-not-replated.php
Last active April 24, 2019 10:21 — forked from jesseeproductions/remove-categories-not-replated.php
removes "'concert', 'convention'" categories from month view only
/*
* The Events Calendar Remove Events from Month and List Views
* add coding to theme's functions.php
* @version 3.12
* modify here with event category slugs: array( 'concert', 'convention' )
*/
add_action( 'pre_get_posts', 'tribe_exclude_events_category_month_list' );
function tribe_exclude_events_category_month_list( $query ) {
if ( isset( $query->query_vars['eventDisplay'] ) && ! is_singular( 'tribe_events' ) ) {
@alaasalama
alaasalama / functions.php
Created March 13, 2019 19:21
Alter the shortcode logic to be AND instead of OR
/* Tribe, change tax query relation to AND instead of OR */
function tribe_list_widget_tax_query_relation ( $args ) {
    // bail if no relation is no tax query
    if ( !isset( $args['tax_query'] ) ) return $args;
    $args['tax_query']['relation'] = 'AND';
    return $args;
}
@alaasalama
alaasalama / functions.php
Created March 4, 2019 22:34
hide free from RSVP cost
function hide_free_from_rsvp() {
?>
<script type="text/javascript">
// your javscript code goes here
jQuery( document ).ready(function() {
jQuery('.tribe-events-event-cost, .tribe-events-cost').each(function() {
jQuery(".tribe-events-event-cost").text().replace("Gratis – ", "")
var text = jQuery(this).text();
text = text.replace("Gratis – ", "");
jQuery(this).text(text);
@alaasalama
alaasalama / single-event.php
Created February 28, 2019 18:40
Remove (free) string from the event cost outcome function
<?php echo str_replace('Gratis – ', '', tribe_get_cost( null, true )) ; ?>
@alaasalama
alaasalama / functions.php
Created February 20, 2019 23:26
show event's recurrence description
function show_recurrence_description() {
if (is_event()) {
?>
<script type="text/javascript">
// your javscript code goes here
jQuery( document ).ready(function() {
jQuery('.tribe-events-event-body').clone().insertAfter('.recurringinfo')
});
</script>
<?php
@alaasalama
alaasalama / functions.php
Last active February 7, 2019 14:02 — forked from cliffordp/functions.php
Forked to apply this modification: https://gist.github.com/cliffordp/52d0bfb6d1537a19d158deb351dd9fa7#gistcomment-2731157 Events Calendar PRO: Change default coordinates and zoom level for Map View's start location (for when there are no event results found, to avoid African coast).
<?php
/**
* Events Calendar PRO: Change default coordinates and zoom level for Map View's
* start location (for when there are no event results found, to avoid African coast).
*
* Change the coordinates to your liking. See the link below for a helpful tool.
* Updated 2018-08-06 because PRO v4.4.30 removed one of the parameters.
*
* @link https://gist.github.com/cliffordp/52d0bfb6d1537a19d158deb351dd9fa7
@alaasalama
alaasalama / ping_script
Last active August 21, 2016 02:36
Check's if the post got replied by one of the support team members or not in a bbPress support forum.
// ==UserScript==
// @name parallel-support-check
// @namespace http://alaasalama.com/
// @version 1.0
// @description check if this support thread got a reply or not
// @author Alaa.Salama
// @match https://themify.me/forum/*
// @grant none
// @require https://code.jquery.com/jquery-2.2.4.min.js
// ==/UserScript==
@alaasalama
alaasalama / Hi_script
Last active August 21, 2016 02:37
Auto insert the customer name in a bbPress reply
// ==UserScript==
// @name Hi-Automatic!
// @namespace http://alaasalama.com/
// @version 1.0
// @description Adding Hi+Name automatic for Themify support forums
// @author Alaa.Salama
// @include https://themify.me/forum/*
// @grant none
// @require https://code.jquery.com/jquery-2.2.4.min.js
// ==/UserScript==
a.button.product_type_simple.add_to_cart_button.ajax_add_to_cart {
color: #fff;
font-size: .85em;
text-decoration: none;
text-indent: -900em;
text-align: center;
width: 35px;
height: 35px;
display: block;
z-index: 9500;