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 | |
/* | |
Plugin name: reset wfea | |
*/ | |
delete_option( 'widget-for-eventbrite-api-settings' ); |
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 | |
/* | |
use like [myshortcode type=feedback] | |
*/ | |
add_shortcode( 'myshortcode', function ( $atts ) { | |
$atts = shortcode_atts( array( 'type' => '' ) ); | |
return apply_filter( 'myshortcode_' . $atts['type'], '' ); | |
} ); |
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 | |
/** | |
* Plugin Name: Custom Code Snippets - Display Eventbrite | |
* Version: 1.0 | |
*/ | |
add_filter( 'wfea_cal_extra_options', | |
function ( $options ) { | |
$options['fullcalendar']['showNonCurrentDates'] = false; | |
return $options; |
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 | |
/* | |
* Plugin Name: Restrict a site | |
*/ | |
// If this file is called directly, abort. | |
if ( ! defined( 'WPINC' ) ) { | |
die; | |
} | |
// Hook 'redirect_if_not_logged_in' function into 'template_redirect' action |
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 | |
/* | |
* Plugin Name: Quick Event Manager Custom Snippet - Disable Comments on Events | |
*/ | |
add_filter('comments_open', function ($open, $post_id) { | |
$post = get_post($post_id); | |
if ($post->post_type == 'event') { | |
return false; | |
} | |
return $open; |
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
add_filter('qem_event_register', function($args) { | |
if(isset($args['supports']) && is_array($args['supports'])) { | |
$args['supports'] = array_diff($args['supports'], ['comments']); | |
} | |
return $args; | |
}); |
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 | |
/* Plugin Name: Snippets for accordions layout - custom */ | |
add_filter('wfea_layout_part_accordion_tab', function($text) { | |
return $text . ' | Click for timetables and bookings '; | |
}, 10,1); | |
add_filter('wfea_layout_part_organizer_name', function($text) { | |
return ''; | |
}, 10,1); |
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 | |
if ( 'PHP.wasm' === $_SERVER['SERVER_SOFTWARE'] && 'playground.wordpress.net' === $_SERVER['HTTP_HOST'] ) { | |
// inside playground.wordpress.net | |
} |
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
public function is_cache_plugin_installed() { | |
return | |
function_exists( 'w3tc_flush_post' ) || | |
function_exists( 'wp_cache_post_change' ) || | |
function_exists( 'rocket_clean_post' ) || | |
has_action( 'cachify_remove_post_cache' ) || | |
has_action( 'litespeed_purge_post' ) || | |
function_exists( 'wpfc_clear_post_cache_by_id' ) || | |
class_exists( 'WPO_Page_Cache' ) || | |
has_action( 'cache_enabler_clear_page_cache_by_post' ) || |
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
<?xml version="1.0"?> | |
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Example Project" | |
xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd"> | |
<description>WP Security</description> | |
<rule ref="WordPress.Security.EscapeOutput"> | |
</rule> | |
<rule ref="WordPress.Security.SafeRedirect"> | |
</rule> |
NewerOlder