Skip to content

Instantly share code, notes, and snippets.

View BrianHenryIE's full-sized avatar
🇮🇪

Brian Henry BrianHenryIE

🇮🇪
View GitHub Profile
@BrianHenryIE
BrianHenryIE / bh_set_esig_super_admin.php
Created September 5, 2019 19:55
WP-E-Signature (Approve Me) admin permissions.
<?php
/**
* Sets/overwrites the super-admin user-id in the e-signature cache.
*
* Allows editing documents and saving documents as PDF,
* but not previewing documents in draft or viewing signed documents in the browser.
*/
function bh_set_esig_super_admin() {
/**
@BrianHenryIE
BrianHenryIE / remove-update-post-buttons.php
Created August 13, 2019 22:24
Remove update post buttons in WordPress editor for custom post type
<?php
/**
* If we're currently on the edit post page (post.php?action=edit) for the custom post type,
* add JavaScript to the HTML output to remove the update buttons.
*
* Runs on current_screen hook to ensure get_current_screen() is available.
*/
add_action( 'current_screen', function() {
@BrianHenryIE
BrianHenryIE / fb-login-adblock.js
Created July 30, 2018 19:30
WP Facebook Login for WordPress: Hide the loading icon and show a message to users if the Facebook login button is not loading
// For: WP Facebook Login for WordPress
// https://wordpress.org/plugins/wp-facebook-login/
// Save in child theme folder
// If adblock is enabled, the Facebook login button will never appear, so show a message
document.addEventListener("DOMContentLoaded", function(event) {
// When to check
var afterMilliseconds = 10000;
diff --git a/includes/callback.php b/includes/callback.php
index 81ca282..39b15db 100644
--- a/includes/callback.php
+++ b/includes/callback.php
@@ -74,13 +74,22 @@ if ( isset( $_GET['code'] ) && ! empty( $_GET['code'] ) ) {
$user_info = json_decode( $response['body'] );
$user_id = username_exists( $user_info->user_login );
if ( ! $user_id && email_exists( $user_info->user_email ) == false ) {
-
+
diff --git a/includes/callback.php b/includes/callback.php
index 81ca282..abe992f 100644
--- a/includes/callback.php
+++ b/includes/callback.php
@@ -74,13 +74,20 @@ if ( isset( $_GET['code'] ) && ! empty( $_GET['code'] ) ) {
$user_info = json_decode( $response['body'] );
$user_id = username_exists( $user_info->user_login );
if ( ! $user_id && email_exists( $user_info->user_email ) == false ) {
-
+
diff --git a/includes/class-wp-user-avatar-functions.php b/includes/class-wp-user-avatar-functions.php
index 2a89f4d..fd694e1 100644
--- a/includes/class-wp-user-avatar-functions.php
+++ b/includes/class-wp-user-avatar-functions.php
@@ -409,7 +409,8 @@ class WP_User_Avatar_Functions {
if(!$wpua_functions->wpua_has_gravatar($id_or_email) && $avatar_default == 'wp_user_avatar') {
// Show custom Default Avatar
if(!empty($wpua_avatar_default) && $wpua_functions->wpua_attachment_is_image($wpua_avatar_default)) {
- $wpua_avatar_default_image = $wpua_functions->wpua_get_attachment_image_src($wpua_avatar_default, array($size,$size));
+ $size_numeric_w_x_h = array( get_option( $size . '_size_w' ), get_option( $size . '_size_h' ) );
diff --git a/utils/class.WpdiscuzEmailHelper.php b/utils/class.WpdiscuzEmailHelper.php
index c11833c..5cc8da1 100644
--- a/utils/class.WpdiscuzEmailHelper.php
+++ b/utils/class.WpdiscuzEmailHelper.php
@@ -7,6 +7,10 @@ if (!defined('ABSPATH')) {
class WpdiscuzEmailHelper {
private $optionsSerialized;
+
+ /**
@BrianHenryIE
BrianHenryIE / bh_expected_delivery_time.php
Last active February 18, 2018 12:35
Adds Expected Delivery Time meta box in WooCommerce Product page Shipping options
<?php
// Save in your child theme and add in your functions.php:
// require_once('bh_expected_delivery_time.php');
add_action( 'woocommerce_product_options_shipping', 'bh_expected_delivery_time_field' );
function bh_expected_delivery_time_field() {
// Print a custom text field
woocommerce_wp_text_input( array(
diff --git a/sb-woocommerce-email-verification.php b/sb-woocommerce-email-verification.php
index c4e504c..7fca8ac 100755
--- a/sb-woocommerce-email-verification.php
+++ b/sb-woocommerce-email-verification.php
@@ -3,7 +3,7 @@
Plugin Name: SB WooCommerce Email Verification
Description: Force customers to verify account before login. Reduce spam users.
Plugin URI: http://codecanyon.net/user/sbthemes/portfolio?ref=sbthemes
- Version: 1.4.1
+ Version: 1.5