Skip to content

Instantly share code, notes, and snippets.

View VR51's full-sized avatar

Lee VR51

View GitHub Profile
@VR51
VR51 / WP Job Board Daily Job Refresh
Created February 6, 2015 01:22
Refreshes the date of WP Job Board job posts. Any job post older than 2 months will be automatically republished with the date current at the time the script runs.
<?php
/**
* Refresh WP Job Board job publish dates daily
* VR51.com & JournalXtra.com
* Add to your child theme's functions.php
**/
if (class_exists('Wpjb_Model_Job')) {
/* Add daily cron job to run the vr_daily_job_refresh hook */
@VR51
VR51 / functions.php
Last active June 18, 2020 19:00
WordPress Privacy Page Shortcode
<?php
function privacy_page_sc_vr51( $atts ) {
# Creates a Privacy Page link shortcode.
# Use as [privacy title="Privacy Page Title"] or [privacy]
# Default page title is Privacy Page.
# Page link points to the Privacy Page set in Dashboard > Privacy.
# The privacy page will only display if the page is public (status = publish).
# Place this snippet into the site theme's functions.php file, a custom functions plugin or some other
# suitable place.
@VR51
VR51 / Schedule-WP-User-Imports.php
Last active August 9, 2021 11:48
Import scheduler for the plugin WP User Imports
<?php
/*
# v1.0.1
# 2021-08-06
#
# Extends WP plugin 'Import Users from CSV' to enable scheduled WordPress user imports
#
# This scheduler has been rolled into my fork of the Import Users from CSV plugin
# See https://github.com/VR51/import-users-from-csv
#
@VR51
VR51 / functions.php
Created October 29, 2021 03:31
Schedule the regular import of files into a WordPress site's wp-content/uploads/ directory
<?php
/**
* Import Files from External Domains v1.0.0
*
* This script is written for WordPress sites.
* This script can be adapted for use with non WordPress sites.
* The code in this script should be copied and pasted into a theme's funcitons.php file or into a functionality plugin
* though it can be used in other ways too.
* This script does not add files to the WordPress Media Library.
@VR51
VR51 / db-error.php
Last active October 11, 2023 10:13
WordPress Custom Database Error Message and Report
<?php
header('HTTP/1.1 503 Service Temporarily Unavailable');
header('Status: 503 Service Temporarily Unavailable');
header('Retry-After: 60'); // 1 hour = 3600 seconds
/**
* WordPress Custom Database Error Report
*
* Drop this file into wp-content.
* When a database error occurs a stacktrace will be sent to the email address congifured below here.
@VR51
VR51 / php-error.php
Last active October 11, 2023 10:14
WordPress Custom PHP Error Report
<?php
header('HTTP/1.1 503 Service Temporarily Unavailable');
header('Status: 503 Service Temporarily Unavailable');
header('Retry-After: 60'); // 1 hour = 3600 seconds
/**
* WordPress Custom PHP Error Report
*
* Drop this file into wp-content.
* When a PHP error occurs a stacktrace will be sent to the email address congifured below here.
@VR51
VR51 / Contract Killer 3.md
Created August 8, 2023 11:41
The latest version of my ‘killer contract’ for web designers and developers

When times get tough and people get nasty, you’ll need more than a killer smile. You’ll need a killer contract.

Used by 1000s of designers and developers Clarify what’s expected on both sides Helps build great relationships between you and your clients Plain and simple, no legal jargon Customisable to suit your business Used on countless web projects since 2008

…………………………

@VR51
VR51 / Contract Killer 3.md
Created August 8, 2023 11:45 — forked from mangiBr/Contract Killer 3.md
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Original post

@VR51
VR51 / wordpress-passwort-reset-unmultisite.php
Last active July 10, 2024 22:52 — forked from eteubert/wordpress-passwort-reset-unmultisite.php
Multisite: Passwort Reset on Local Blog
<?php
/**
* Plugin Name: Multisite: Do Password Reset on Local Blog instead of Root Blog
* Plugin URI (orig): https://gist.github.com/eteubert/293e07a49f56f300ddbb
* Plugin URI (this forke): https://gist.github.com/VR51/33d32082a009de0a2c990e994aea8936/
* Description: By default, WordPress Multisite uses the main blog for passwort resets. This plugin enables users to stay in their blog during the whole reset process.
* Instructions: Drop into /wp-content/mu-plugins/ or remove this header and add to functions.php. Use mu-plugins if you want to affect all sites.
* Version: 1.0.1
* Author: Eric Teubert + vr51 + others
* Author URI: http://ericteubert.de