Skip to content

Instantly share code, notes, and snippets.

View markandcurry's full-sized avatar

Mark Warren markandcurry

View GitHub Profile
@markandcurry
markandcurry / no_urls_allowed.php
Created August 30, 2016 20:27 — forked from galbaras/no_urls_allowed.php
Function to invalidate Contact Form 7 input, unless the fields is of type "url" or has "url" in its name, i.e. it is meant for URLs
function no_urls_allowed( $result, $tag ) {
$tag = new WPCF7_Shortcode( $tag );
$type = $tag->type;
$name = $tag->name;
$value = isset( $_POST[$name] )
? trim( wp_unslash( strtr( (string) $_POST[$name], "\n", " " ) ) )
: '';
@markandcurry
markandcurry / Extend Recent Posts
Last active September 21, 2017 15:46 — forked from paulruescher/Extend Recent Posts
Used this to change the output of WordPress' Recent Posts Widget
/**
* Extend Recent Posts Widget
*
* Adds different formatting to the default WordPress Recent Posts Widget
*/
Class My_Recent_Posts_Widget extends WP_Widget_Recent_Posts {
function widget($args, $instance) {
<?php
/*
Plugin Name: My Custom Plugin