This file contains hidden or 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
| /** | |
| * Plugin Name: Display Eventbrite Events - Custom Filters | |
| * Plugin URI: https://fullworksplugins.com/products/widget-for-eventbrite/ | |
| * Description: Custom Filters for Display Eventbrite - changes class of free events | |
| * Version: 1.0 | |
| * Author: Fullworks | |
| * Author URI: https://fullworksplugins.com/ | |
| * License: GPL-2.0 | |
| **/ | |
| add_filter( |
This file contains hidden or 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: My Custom Code Snippets | |
| * Description: Custom Filters | |
| * Version: 1.0 | |
| */ | |
| // just a check to make sure no hacker tries this file | |
| if ( ! defined( 'ABSPATH' ) ) { | |
| die(); | |
| } |
This file contains hidden or 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
| /* | |
| ================== | |
| Ajax Search | |
| ====================== | |
| */ | |
| function ajax_fetch() { | |
| /* | |
| * gatekeep only for page 16 | |
| */ |
This file contains hidden or 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( | |
| 'the_title', | |
| function ( $title) { | |
| $post = get_post(); | |
| if ( ! property_exists( $post, 'eb_url' ) ) { | |
| return $title; | |
| } | |
| return '<strong>' . esc_attr( $post->organizer->name ) . ': </strong>' . $title; | |
| }, |
This file contains hidden or 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
| /** | |
| * Example of how to get payment records from QPP in a simple shortcode [qpp_demo_payments form='name']. | |
| * Note this will not work after version 6 where CPTs will be used | |
| */ | |
| add_shortcode( 'qpp_demo_payments', function ( $atts ) { | |
| $atts = shortcode_atts( | |
| array( | |
| 'form' => '', | |
| ), $atts ); | |
| $payments = get_option( 'qpp_messages' . $atts['form'] ); |
This file contains hidden or 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( 'authenticate', function ( $user, $username, $password ) { | |
| if ( ! $user->has_cap( 'manage_options' ) ) { | |
| return $user; | |
| } | |
| $get_ip = function () { | |
| $ipaddress = '0.0.0.0'; | |
| if ( getenv( 'HTTP_CF_CONNECTING_IP' ) ) { | |
| $ipaddress = getenv( 'HTTP_CLIENT_IP' ); | |
| } elseif ( getenv( 'HTTP_CLIENT_IP' ) ) { | |
| $ipaddress = getenv( 'HTTP_CLIENT_IP' ); |
This file contains hidden or 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 any mail errors and error messages to DEBUG log | |
| */ | |
| add_action( 'wp_mail_failed', function ( $wp_error ) { | |
| /** @var $wp_error \WP_Error */ | |
| if ( defined( 'WP_DEBUG' ) && true == WP_DEBUG && is_wp_error( $wp_error ) ) { | |
| error_log( 'Email - wp_mail error msg : ' . $wp_error->get_error_message() ); | |
| $a=$wp_error->get_error_codes(); | |
| foreach ( $wp_error->get_error_codes() as $error_code ) { |
This file contains hidden or 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 | |
| /** | |
| * @var mixed $data Custom data for the template. | |
| */ | |
| if ( $data->utilities->get_element( 'booknow', $data->args ) ) { | |
| // dont show button fpor private events | |
| if( get_post()->public === false ) { | |
| return; | |
| } | |
| switch ( $data->template ) { |
This file contains hidden or 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 ( ! is_admin() ) { // only do on frontend | |
| add_filter( | |
| 'posts_results', | |
| function ( $posts ) { | |
| shuffle( $posts ); // use php random shuffle | |
| return $posts; | |
| }, | |
| 10, |