Skip to content

Instantly share code, notes, and snippets.

@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
*/
@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 / 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 / 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 / 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 / bp-xprofile-countries-list.php
Created July 13, 2018 11:45 — forked from slaFFik/bp-xprofile-countries-list.php
BuddyPress xProfile - Add Countries
<?php
/**
* If you are using BP 2.1+, this will insert a Country selectbox.
* Add the function to bp-custom.php and then visit .../wp-admin/users.php?page=bp-profile-setup
*/
function bp_add_custom_country_list() {
if ( !xprofile_get_field_id_from_name('Country') && 'bp-profile-setup' == $_GET['page'] ) {
@mrmoyeez
mrmoyeez / functions.php
Created September 8, 2018 13:37 — forked from daithi-coombes/functions.php
To enable 'price from' and 'price to' search for wordpress [WP Property Plugin](https://usabilitydynamics.com/products/wp-property/forum/topic/price-range-search/)
/**
* Rename these to the form input names you are going to use.
* When you create a new attribute in Properties->Settings->Developer
* the form input name will appear greyed out under the attribute name
*/
define('SPRP_SEARCH_FROM_KEY', 'price_from_per_month');
define('SPRP_SEARCH_TO_KEY', 'price_to_per_month');
function parse_search(){
@mrmoyeez
mrmoyeez / faceapp.js
Created October 13, 2018 06:42 — forked from CyberFerret/faceapp.js
Face recognition demo - App js file
$(document).ready(function() {
if (window.JpegCamera) {
var camera; // placeholder
// Add the photo taken to the current Rekognition collection for later comparison
var add_to_collection = function() {
var photo_id = $("#photo_id").val();
if (!photo_id.length) {
@mrmoyeez
mrmoyeez / client-logo-slider.markdown
Created December 6, 2018 06:16
Client Logo Slider
@mrmoyeez
mrmoyeez / demo-css-image-hover-effects.markdown
Created May 7, 2019 10:58
demo:CSS image hover effects