Skip to content

Instantly share code, notes, and snippets.

View klhall1987's full-sized avatar

Kenny Hall klhall1987

View GitHub Profile
<?php if ( ! defined( 'ABSPATH' ) ) exit;
/*
Plugin Name: Stop Password Authentication Email
Description: Stops the password authentication email from being sent out when a new user registers.
Version: 1.0
Author: Kenny Hall
Author URI: http://kennyinthewild.com
*/
@klhall1987
klhall1987 / register-custom-taxonomy.php
Last active February 10, 2016 14:53
An example of how to create a custom taxonomy.
<?php
class Register_Custom_Taxonomy
{
public function __construct()
{
add_action('init', array( $this, 'Register_Operating_System_Taxonomy' ), 0);
add_action('init', array( $this, 'Register_MakeModel_Taxonomy' ), 0);
}
@klhall1987
klhall1987 / register-post-type-example.php
Last active February 10, 2016 15:19
An example of how to register a custom post type.
<?php
/*
* Plugin Name: Phones Custom Post Type
* Plugin URI: https://github.com/klhall1987/custom-post-type-example
* Description: An example of how to build a custom post type and attach custom taxonomies in WordPress.
* Version: 1.0
* Author: Kenny Hall
* Author URI: http://kennyinthewild.com
*/
*******JavaScipt(Not sure what all I have done to this script)*******
jQuery(document).ready(function ($){
$("#cfn-body p").css("margin", "0");
var height = $("#cfn-body").outerHeight(true);
alert($("#cfn-body").height());
$(".site-footer").css("padding-bottom", height + "px");
});
// Register Custom Taxonomy
function custom_taxonomy() {
$labels = array(
'name' => _x( 'Taxonomies', 'Taxonomy General Name', 'text_domain' ),
'singular_name' => _x( 'Taxonomy', 'Taxonomy Singular Name', 'text_domain' ),
'menu_name' => __( 'Taxonomy', 'text_domain' ),
'all_items' => __( 'All Items', 'text_domain' ),
'parent_item' => __( 'Parent Item', 'text_domain' ),
'parent_item_colon' => __( 'Parent Item:', 'text_domain' ),
<?php
class user
{
/**
* @var
*/
private $userPhone;
/**
<?php
class phone
{
/**
* @var string
*/
private $brand = '';
/**
@klhall1987
klhall1987 / Aweber Filterable Strings Plugin
Last active December 11, 2015 16:02
Add a filter to make stings translatable.
<?php if ( ! defined( 'ABSPATH' ) ) exit;
/*
Plugin Name: Ninja Forms Aweber Filterable Strings
Description: Add a filter to make stings translatable.
Version: 1.0
Author: Kenny Hall
Author URI: http://kennyinthewild.com
*/
add_filter( 'ninja_forms_submission_pdf_fetch_sequential_number', 'seq_filter', 10, 2);
function seq_filter( $bool )
{
$bool = true;
return $bool;
}
@klhall1987
klhall1987 / FilterIntegersAndStrings.php
Last active November 11, 2015 19:40
Filter integers and integer strings
<?php
$numbers = array(
12,
1551,
'21',
'5115',
'I am a string',
);