Skip to content

Instantly share code, notes, and snippets.

View alanef's full-sized avatar

Alan Fuller alanef

View GitHub Profile
<?php
/*
Plugin Name: Blog Info Shortcode
Plugin URI: https://fullworks.net/
Description: Blog Info Shortcode
Version: 1.0
Author: Alan
Author URI: https://fullworks.net/
License: GPL2
*
<?php
/*
Plugin Name: Show User Roles
Plugin URI: https://fullworks.net/
Description: Show User Roles
Version: 2.1
Author: Alan
Author URI: https://fullworks.net/
License: GPL2
*
/**
* usage [thecontent 'id-1234]
* works fine in elementor
* but not gutenberg
**/
add_shortcode( 'thecontent', function ( $atts ) {
$a = shortcode_atts(
array(
'id' => '1',
@alanef
alanef / index.php
Last active September 12, 2019 19:31
Sets Admin Colour in Staging and Dev sites
<?php
/**
* Plugin Name: Set Admin Colour on Staging and Dev
* Plugin URI: http://fullworks.net/
* Description: Set Admin Colour on staging and dev sites: locahost staginxyx.mydomain mydomain.local mydomain.dev
* Version: 1.0
* Author: Fullworks
* Author URI: http://fullworks.net/
* License: GPL-3.0+
* License URI: http://www.gnu.org/licenses/gpl-3.0.txt
<?php
/*
Plugin Name: Date Picker Issue
Plugin URI: https://
Description: Shortcode [datetest] this plugin demonstrates that the id selector does not work when The7 theme is active with WP Bakery and on the WooCommerce shop page
Version: 0.1
Author: Alan
*/
add_action('wp_enqueue_scripts', function() {
@alanef
alanef / disable-wpbakery.php
Created November 7, 2019 10:29
Disable WP BAkery on WooCommerce Shop page
<?php
/**
* Must use plugin that deactivates WP Bakery on the shop page only
*/
// Don't allow direct execution
if ( ! defined( 'WPINC' ) ) {
die;
}
$request_uri = parse_url( $_SERVER['REQUEST_URI'], PHP_URL_PATH );
add_filter( 'option_active_plugins', function ( $plugins ) use ( $request_uri ) {
<?php
/*
Plugin Name: Age Shortcode
Plugin URI: https://fullworks.net
Description: Shortcode [age dob="28 feb 1971"] display age based on dob
Version: 0.1
Author: Alan
*/
#!/bin/bash
BUCKET=$1
if [ -z "$BUCKET" ]
then
echo "-bucket must be specified"
exit 1;
fi
d=`date +%Y-%m-%d`
wproot="${HOME}/public_html" # change this to your actual wordpress directory
echo "`date`" - WordPress Backup started
#!/bin/bash
BUCKET=$1
if [ -z "$BUCKET" ]
then
echo "-bucket must be specified"
exit 1;
fi
d=`date +%Y-%m-%d`
wproot="${HOME}/public_html" # change this to your actual wordpress directory
echo "`date`" - WordPress Backup started
<script>
(function ($) {
'use strict';
$(document).ready(function ($) {
$("#input_1_7").blur(function () {
$(this).val('£' + $(this).val().replace(/[^0-9]+/g, ''));
});
});
})(jQuery);