Skip to content

Instantly share code, notes, and snippets.

@mrmoyeez
mrmoyeez / cf7_external_db.php
Created June 1, 2018 11:30 — forked from mheywood90/cf7_external_db.php
Contact Form 7 to External DB
<?php
/*
Plugin Name: Contact Form 7 to External DB
Plugin URI: http://thedrawingroomcreative.com
Description: This plugin uses the wpcf7_before_send_mail hook to post a specific form to an external database. Upon use the details for your external database will need to be entered. Private use only.
Author: The Drawing Room
Version: 0.1
Author URI: http://thedrawingroomcreative.com
*/
@mrmoyeez
mrmoyeez / ReadMe.md
Created March 10, 2018 18:34 — forked from PhiLhoSoft/ReadMe.md
Add validation to WP-Members (WordPress plugin) registration form

Add validation to WP-Members (WordPress plugin) registration form

I maintain a small French WordPress site: http://entraides-citoyennes.org/ It was made by design students which made a great work with looks, but a so-so technical work... So I had to fix the issues.

They used a iFeature 5 theme by CyberChimps, they made a .css file in a child theme. I had to make CSS fixes to get labels of the registration form (made with the WP-Members plugins) to be aligned with the input fields...

WP-Members is a nice plugin, rather flexible as it allows to add custom fields to registration.

@mrmoyeez
mrmoyeez / uk_postcode_validator.php
Created March 7, 2018 08:15 — forked from sepehr/uk_postcode_validator.php
PHP: UK Postcode Validation
/**
* Custom validation callback to validate UK postcodes.
*
* It also tries to format provided postcode in correct format.
*
* Note: It's only usable for "postcode" fields.
*/
public function check_postcode_uk($original_postcode)
{
// Set callback's custom error message (CI specific)
@mrmoyeez
mrmoyeez / postcode-regex.js
Created February 27, 2018 18:14 — forked from simonwhitaker/postcode-regex.js
An example of using a simplified UK postcode regex in Javascript
var tweet = "Currently chilling out at W1B 2EL, then on to WC2E 8HA or maybe even L1 8JF! :-)";
// Here's a simple regex that tries to recognise postcode-like strings.
// See http://en.wikipedia.org/wiki/Postcodes_in_the_United_Kingdom#Validation
// for the rules on how UK postcodes are formatted.
var postcode_regex = /[A-Z]{1,2}[0-9][0-9A-Z]?\s?[0-9][A-Z]{2}/g;
var postcodes = tweet.match(postcode_regex);
console.log(postcodes);
@mrmoyeez
mrmoyeez / remove-woo-slug.php
Created November 14, 2017 15:54 — forked from timersys/remove-woo-slug.php
Remove product-category slug from Woocommerce
<?php
/*
Plugin Name: Remove product-category slug
Plugin URI: https://timersys.com/
Description: Check if url slug matches a woocommerce product category and use it instead
Version: 0.1
Author: Timersys
License: GPLv2 or later
*/