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: Test Ajax | |
| Plugin URI: https://fullworks.net | |
| Description: A demo of ajax calls to the Widget for Eventbrite plugin shortcode | |
| Version: 1.0 | |
| Author: Alan Fuller | |
| Author URI: https://fullworks.net | |
| License: GPL3 |
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
| jQuery(document).ready(function ($) { | |
| // as nothing will be on the page we initialise with a call | |
| ajax_call(); | |
| // on click of the search button we make the call with the filter value | |
| $('#ajaxwfeasearch').click(function () { | |
| ajax_call(); | |
| }); | |
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( | |
| 'wfea_availability_display', // filter hook name | |
| function ( $msg, $total_sold, $event_capacity ) { // annonyous function that takes 3 parameters - paramters are defined by the hook | |
| if ( $total_sold >= $event_capacity ) { | |
| $msg = __( 'Sold Out', 'widget-for-eventbrite-api' ); | |
| } else if ( ( $event_capacity - $total_sold ) > 10 ) { // set this number to what you like if you don't want a count | |
| $msg = 'Places Available'; | |
| } else { | |
| $msg = sprintf( '%1$s Places Left', ( $event_capacity - $total_sold ) ); | |
| } |
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
| #!/bin/bash -xv | |
| echo "Deploy to WordPress SVN" | |
| pattern="*.zip" | |
| files=( $pattern ) | |
| [ "${files[0]}" == "*.zip" ] && { echo "Error: No zip file found"; exit 1; } | |
| echo "Plugin zip file found ${files[0]}" | |
| search="-free" | |
| rootdir=${files[0]%$search*} | |
| echo $rootdir | |
| dir='workdir' |
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: Clean media files in trash | |
| * | |
| * Plugin URI: https://fullworks.net/products/the-webinar-toolkit/ | |
| * Description: add define('EMPTY_MEDIA_TRASH_DAYS', 7); to wp-config.php | |
| * Version: 1.0 | |
| * Author: Fullworks | |
| * Author URI: https://fullworks.net/ | |
| * Licence: GPL 2 or later |
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
| const find = require('local-devices'); | |
| const fetch = require('node-fetch'); | |
| let heatpumpIPs = []; | |
| const getHeatpumps = () => find().then( async devices => { | |
| for ( let i = 0; i < devices.length; i++) { | |
| try { | |
| let response = await fetch('http://' + devices[i].ip + '/common/basic_info') | |
| let isHeatpump = await response.ok |
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
| <audio id="myRing"> | |
| <source src="/path/to/ringring.mp3"> | |
| </audio> | |
| <a onclick="document.getElementById('myRing').play()"><img src="https://myphone.png"></a> |
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
| /* before doing this check if $_GET['event_id'] is set e.g. | |
| if ( ! isset($_GET['event_id']) { | |
| // return or do error stuff | |
| } | |
| */ | |
| $event_id=sanitize_text_field($_GET['event_id']); | |
| $event_id=wp_unslash($event_Id); | |
| $date = get_post_meta($event_id, '_mdjm_event_date', true ); |
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: Custom code | |
| Plugin URI: https://fullworks.net/ | |
| Description: Custom code | |
| Version: 1.0 | |
| Author: Alan | |
| Author URI: https://fullworks.net/ | |
| License: GPL2 | |
| */ |
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: Test Shortcode | |
| Plugin URI: https://fullworks.net | |
| Description: Test Shortcode Gutenberg content | |
| Version: 1.0 | |
| Author: alan | |
| Author URI: https://fullworks.net | |
| License: GPL2 |