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_shortcode( 'list_group_users', 'list_group_users' ); | |
function list_group_users( $atts, $content = '' ) { | |
$output = ''; | |
if ( isset( $atts['group'] ) ) { | |
if ( $group = Groups_Group::read_by_name( trim( $atts['group'] ) ) ) { | |
$group = new Groups_Group( $group->group_id ); | |
$groups_users = $group->users; | |
usort( $groups_users, 'sort_list_group_users' ); | |
if ( !empty( $groups_users ) ) { |
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
<style type="text/css"> | |
div.field.affiliate-attribute.coupons { | |
display:inline; | |
} | |
div.field.affiliate-attribute.coupons label { | |
display:none; | |
} | |
div.field.affiliate-attribute.coupons input { | |
width:60%; | |
border:none; |
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 | |
_log ('firing craig_Login_Hook()'); | |
// require_once(ABSPATH . 'wp-includes/pluggable.php' ); | |
global $currentauth0_user; | |
$user_id = get_current_user_id(); | |
if ($user_id > 0) { | |
get_currentauth0userinfo(); | |
/* grab the Auth0 groups for the current 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 | |
/** | |
* The following will produce this result: | |
* | |
* Warning: uksort(): Array was modified by the user comparison function in /Users/kento/Sites/uksort.php on line 12 | |
* set = array ( 'apple' => 'green', 'color' => 'yellow', 'wine' => 'white', 'yoghurt' => 'frozen', ) | |
* | |
* See also https://bugs.php.net/bug.php?id=50688 | |
**/ |
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
/** | |
* Yves' implementation to add a capability to a group when a purchase has been completed. | |
* | |
* http://www.itthinx.com/plugins/groups-paypal/comment-page-1/#comment-647332 | |
*/ | |
add_action('frm_payment_paypal_ipn', 'ls4s_sprint_purchase_completed'); | |
function ls4s_sprint_purchase_completed($args) | |
{ | |
global $frmdb, $wpdb; |
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 storefront_product_search() { | |
if ( function_exists('storefront_is_woocommerce_activated' ) ) { | |
if ( storefront_is_woocommerce_activated() ) { ?> | |
<div class="site-search"> | |
<?php | |
if ( function_exists( 'woocommerce_product_search' ) ) { | |
echo woocommerce_product_search(); | |
} else { | |
the_widget( 'WC_Widget_Product_Search', 'title=' ); |
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 | |
// from https://www.itthinx.com/topic/affiliate-registration-issue-2/ | |
// the snippet for the form action which currently works looks like this: | |
function referring_affiliate_form_action ( $atts ) { | |
$output_form_action = ''; | |
if ( !is_admin() ) { | |
if ( !class_exists( "Affiliates_Service" ) ) { |
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
// An example wp_mail() override that you can place in your site's wp-config.php. | |
// Read the corresponding post https://www.itthinx.com/2021/09/06/wordpress-mail-debugging/ | |
define( 'WP_DEBUG', true ); | |
define( 'WP_DEBUG_LOG', true ); | |
define( 'WP_DEBUG_DISPLAY', false ); | |
function wp_mail( $to, $subject, $message, $headers = '', $attachments = array() ) { | |
$output = sprintf( | |
"\n\n" . |
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 | |
// | |
// An example filter implementation provided in response to this question on the Decent Comments plugin for WordPress | |
// | |
// https://wordpress.org/plugins/decent-comments/ | |
// | |
// https://www.itthinx.com/plugins/decent-comments/comment-page-3/#comment-1127674 | |
// | |
function my_decent_comments_comment_output( $output, $comment_ID, $options ) { | |
$comment = get_comment( $comment_ID ); |
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 | |
/** | |
* Plugin Name: Foo | |
* Description: I am a minimalist plugin which logs 'I am Foo!' when the plugins_loaded action fires. | |
*/ | |
if ( !defined( 'ABSPATH' ) ) { | |
exit; | |
} |