This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
<? | |
// Hooks only for version 5 only, may be for previous version also works | |
if (!defined('WPCF7_VERSION') OR intval(WPCF7_VERSION) !== 5) | |
{ | |
return; | |
} | |
add_filter( 'wpcf7_validate_text', 'wpcf7_text_allowed_chars_validation_filter', 11, 2 ); | |
add_filter( 'wpcf7_validate_text*', 'wpcf7_text_allowed_chars_validation_filter', 11, 2 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* PDO DATABASE CLASS | |
* Connects Database Using PDO | |
* Creates Prepeared Statements | |
* Binds params to values | |
* Returns rows and results | |
*/ | |
class Database { | |
private $host = DB_HOST; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * | |
* Open your site’s wp-config file and add | |
* define( 'WC_REMOVE_ALL_DATA', true); | |
* on its own line above the | |
* That’s all, stop editing! Happy blogging. line. | |
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ | |
define( 'WC_REMOVE_ALL_DATA', true); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getLogoutUrl($redirectUrl = ''){ | |
if(!$redirectUrl) $redirectUrl = site_url(); | |
$return = str_replace("&", '&', wp_logout_url($redirectUrl)); | |
return $return; | |
} | |
/** | |
* Bypass logout confirmation on nonce verification failure | |
*/ | |
function logout_without_confirmation($action, $result){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<style> | |
body{ | |
background-color: #dfdfdf; | |
} | |
.box { | |
display: block; | |
width: 800px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class WP_Scholar_Defer_Scripts { | |
public static function initialize() { | |
add_filter( 'script_loader_tag', array( __CLASS__, 'defer_scripts' ), 10, 2 ); | |
add_filter( 'script_loader_tag', array( __CLASS__, 'async_scripts' ), 10, 2 ); | |
} | |
public static function defer_scripts( $tag, $handle ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$cmb->add_field( array( | |
'name' => __( 'Postive numbers', 'theme-domain' ), | |
'desc' => __( 'Numbers only', 'msft-newscenter' ), | |
'id' => $prefix . 'number', | |
'type' => 'text', | |
'attributes' => array( | |
'type' => 'number', | |
'pattern' => '\d*', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The following code and the code generated art works are the intellectrual properities of Hailei Wang. | |
# © 2009 - 2014, Hailei Wang. All rights reserved. | |
from nodebox import geo | |
colors = ximport("colors") | |
# Define Brush | |
def composeimage( x, y, colr, radius, points, diminish ) : | |
nofill() | |
stroke() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* How to integrate WordPress Core updates with your custom Plugin or Theme | |
* | |
* Filter the `update_plugins` transient to report your plugin as out of date. | |
* Themes have a similar transient you can filter. | |
*/ | |
add_filter( 'site_transient_update_plugins', 'wprp_extend_filter_update_plugins' ); | |
add_filter( 'transient_update_plugins', 'wprp_extend_filter_update_plugins' ); | |
function wprp_extend_filter_update_plugins( $update_plugins ) { |