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 | |
$url = "http://www.codehooligans.com"; | |
$orignal_parse = parse_url($url, PHP_URL_HOST); | |
$get = stream_context_create(array("ssl" => array("capture_peer_cert" => TRUE))); | |
$read = stream_socket_client("ssl://".$orignal_parse.":443", $errno, $errstr, 30, STREAM_CLIENT_CONNECT, $get); | |
$cert = stream_context_get_params($read); | |
$certinfo = openssl_x509_parse($cert['options']['ssl']['peer_certificate']); | |
echo "certinfo<pre>". print_r($certinfo, true) ."</pre>"; |
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 | |
/* | |
* Template Name: Facility Map | |
* Description: Faicility Map Design | |
*/ | |
get_header(); | |
?> | |
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script> |
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
// We are using the WooCommerce Checkout Field Editor plugin in addition to WooCommerce. The Checkout Field Editor | |
// does a nice job at providing a UI for manage additional fields. But doesn't provide any method to do validations. | |
// So this code helps with that on a very specific implemention where we have a Gender select and a DoB date selector. | |
// On the Gender we want to ensure the selected value is 'Male' or 'Female' only. We don't want the | |
default option 'Choose Option' to be valid. On the DoB we want to enforce the user is 18 or older. | |
add_action( 'woocommerce_after_checkout_validation', 'woo_checkout_additional_field_validation' ); | |
function woo_checkout_additional_field_validation() { | |
if (!defined('WOOCOMMERCE_CHECKOUT')) { | |
return; |
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
add_action( 'pre_get_posts', 'attraction_pre_get_post', 1 ); | |
function attraction_pre_get_post( $query ) { | |
if ( $query->is_main_query() ) { | |
if ( ( $query->is_archive ) && ( $query->is_tax ) ) { | |
if ( ( !isset( $query->post_type ) ) || ( empty( $query->post_type ) ) ) { | |
$queried_object = get_queried_object(); | |
if ( !isset($queried_object->taxonomy ) ) | |
return; |
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
// In the file LoginRadius.php in the function login_radius_update_profile_data | |
// The following logic starts at line 712 | |
$contacts = $loginRadiusObject->loginradius_get_contacts( self::$loginRadiusAccessToken ); | |
if ( is_array( $contacts ) && count( $contacts ) > 0 ) { | |
$wpdb->delete( $wpdb->base_prefix . 'loginradius_contacts', array( 'user_id' => $userId ) ); | |
foreach ( $contacts as $contact ) { | |
// The issue is the compare of the $contacts object. In the IF above the $contacts is | |
// checked to see if it is an array. The problem is $contacts is actuall an object. |
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 | |
function my_functions_init() { | |
wp_enqueue_script('jquery'); | |
} | |
add_action( 'init', 'my_functions_init' ); | |
?> |
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
<script src="http://localhost/wp-content/themes/mytheme/js/jquery/jquery.js" type="text/javascript"></script> |
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 update_active_plugins($value = '') { | |
/* | |
The $value array passed in contains the list of plugins with time | |
marks when the last time the groups was checked for version match | |
The $value->reponse node contains an array of the items that are | |
out of date. This response node is use by the 'Plugins' menu | |
for example to indicate there are updates. Also on the actual | |
plugins listing to provide the yellow box below a given plugin | |
to indicate action is needed by the user. | |
*/ |
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 | |
add_action( 'init', 'product_init' ); | |
function product_init() | |
{ | |
// From Part I | |
register_taxonomy( 'product_packages', 'products', | |
array( 'hierarchical' => true, | |
'label' => __('Product Packages'), | |
'query_var' => false | |
) |
NewerOlder