This file contains 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
<?php | |
add_filter( 'tribe_events_editor_default_template', function( $template ) { | |
// collect an array of template values, like "tribe/event-price" and tribe/event-venue" | |
$template_search = array_column( $template, 0 ); | |
// Get the index of the "tribe/event-price" | |
$price = array_search( "tribe/event-price", $template_search ); | |
// @link: https://www.php.net/manual/en/function.array-splice.php | |
array_splice( |
This file contains 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
// ==UserScript== | |
// @name TECCOM: Edit Knowledgebase | |
// @namespace https://theeventscalendar.com/ | |
// @version 0.0.1 | |
// @description Add edit links for knowledgebase articles | |
// @author lelandf | |
// @match https://theeventscalendar.com/knowledgebase/guide/* | |
// @match https://theeventscalendar.com/knowledgebase/k/* | |
// @downloadURL https://gist.github.com/lelandf/83f77a2877d81b6e859d03044677e2b6 | |
// @updateURL https://gist.github.com/lelandf/83f77a2877d81b6e859d03044677e2b6 |
This file contains 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
<?php | |
// Both of these examples are specific to Swiss Franc, hence the "chf" in the filter name | |
// Replace with different currency accordingly | |
// This is if currency position is set to "before" | |
add_filter( 'rcp_chf_currency_filter_before', function( $formatted, $currency, $price ) { | |
$formatted = $currency . ' ' . rcp_format_amount( $price ); | |
return $formatted; | |
}, 10, 3 ); |
This file contains 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
<?php | |
// Requires both RCP & Drip Content active | |
add_action( 'wp_footer', function() { | |
$membership_id = 1; | |
$post_id = 31; | |
$membership = rcp_get_membership( $membership_id ); | |
$can_access = \RCP\Addon\DripContent\Visibility\membership_can_access( true, $membership_id, $post_id, $membership ); | |
This file contains 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
<?php | |
add_action( 'admin_print_footer_scripts-update-core.php', function() { | |
?> | |
<script> | |
( () => { | |
// saving this plugin row class because we'll be using it in multiple places | |
const ROW_CLASS = 'plugin-title'; | |
// collecting names of all plugins with updates available | |
const plugins = document.querySelectorAll( `.${ ROW_CLASS } strong` ); |
This file contains 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
<?php | |
// Change 'Sample Lesson' to exactly how the text appears on your site. | |
// This could change depending on your use of Custom Labels and translations | |
// Change 'Free Module' to whatever you want to replace it with | |
add_filter( 'learndash_course_step_attributes', function( $attributes ) { | |
if ( | |
isset( $attributes[0]['label'] ) && | |
'Sample Lesson' === $attributes[0]['label'] | |
) { |
This file contains 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
<?php | |
add_action( 'wp_footer', function() { ?> | |
<script> | |
jQuery( document ).on( 'afterOnSubmit.tribeEvents', () => { | |
// Select list link | |
const listLink = document.querySelector( '.tribe-events-c-view-selector__list-item--list a' ); | |
// No list link? Stop! | |
if ( ! listLink ) { |
This file contains 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
<?php | |
add_action( 'wp_footer', function() { | |
// Evaluate conditional here | |
// Maybe an is_page conditional? https://developer.wordpress.org/reference/functions/is_page/ | |
if ( true === true ) : | |
?> | |
<script> | |
(function () { | |
// CUSTOMIZE DOMAIN NAME HERE |
This file contains 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
<?php | |
/** | |
* View: List Event | |
* | |
* Override this template in your own theme by creating a file at: | |
* [your-theme]/tribe/events/v2/list/event.php | |
* | |
* See more documentation about our views templating system. | |
* | |
* @link http://evnt.is/1aiy |
This file contains 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
{ | |
"replies": [ | |
{ | |
"title": "Premium product", | |
"content": "Test" | |
}, | |
{ | |
"title": "Conflict test", | |
"content": "Hey" | |
}, |
NewerOlder