Skip to content

Instantly share code, notes, and snippets.

View bhubbard's full-sized avatar
:octocat:
Hello

Brandon Hubbard bhubbard

:octocat:
Hello
View GitHub Profile
/* Target the main dialog */
.osano-cm-info-dialog__info {
/* Your styles here */
}
/* Target the header of the dialog */
.osano-cm-info__info-dialog-header {
/* Your styles here */
}
@bhubbard
bhubbard / gist:19b6c1785647354ffefbb26ab04ebd04
Created September 5, 2023 04:14
define( 'WPE_GOVERNOR', false ); WP Engine limits long queries (longer than 1024 characters) for performance reasons. The above line in wp-config. php prevents that.
define( 'WPE_GOVERNOR', false );
<?php
/*
Plugin Name: Custom Unpublish Tool
Description: Add an Unpublish tool with a date picker in the Gutenberg editor.
*/
// Enqueue the date picker script
function custom_unpublish_enqueue_scripts() {
wp_enqueue_script('jquery-ui-datepicker');
}
@bhubbard
bhubbard / mi-email-filter-hooks.php
Created May 15, 2023 15:56 — forked from chavesm/mi-email-filter-hooks.php
PHP filter hooks to supply a custom from email address and name for MonsterInsights email summary reports.
<?php
/** MonsterInsights Email Hooks */
// Sender email address filter hook.
function my_custom_sender_email_address( $original_sender_email_address ) {
return 'YOURSENDEREMAILADDRESS';
}
add_filter( 'monsterinsights_email_from_address', 'my_custom_sender_email_address' );
// Sender name filter hook.
<?php
function monsterinsights_amz_appl_affiliate_links() {
?>
<script>
jQuery( document ).ready(function() {
jQuery('a[href*="amazon.com"],a[href*="amzn.to"],a[href*="tv.apple"]').each(function() {
jQuery(this).attr('data-vars-ga-category', 'outbound-link-affiliate' );
});
});
</script>
/**
* This would add custom dimension to the admin list inside settings.
*/
function monsterinsights_add_dimensions_to_admin_list( $dimensions ) {
// Add dimension to array with a unique key 'services'
$dimensions['services'] = array(
'title' => __( 'Services', 'monsterinsights-dimensions' ), // Label
'label' => __( 'Services', 'monsterinsights-dimensions' ), // Description
'enabled' => true,
@bhubbard
bhubbard / pmpro_monsterinsights_level_custom_dimension.php
Created May 15, 2023 15:52 — forked from kimcoleman/pmpro_monsterinsights_level_custom_dimension.php
Add a new "Membership Level" dimension to track via MonsterInsights.
<?php
/**
* Add a new "Membership Level" Custom Dimension to your Google Analytics tracking code.
*
* Requires Paid Memberships Pro, MonsterInsights Pro and the MonsterInsights - Dimensions Addon.
*/
/**
* Filter for adding the new dimension as under Insights > Settings > Dimensions
*/
@bhubbard
bhubbard / Commands
Created May 15, 2023 15:51 — forked from lukecav/Commands
Remove MonsterInsights options left after the plugin is removed from WordPress using WP-CLI
# delete all monsterinsight option values
wp option delete monsterinsights_usage_tracking_config
wp option delete monsterinsights_over_time
wp option delete monsterinsights_db_version
wp option delete monsterinsights_settings_version
wp option delete monsterinsights_current_version
wp option delete monsterinsights_settings
wp option delete monsterinsights_site_tt
wp option delete monsterinsights_site_profile
wp option delete monsterinsights_version_upgraded_from
<?php
/**
* Plugin Name: MonsterInsights User Role Dimension
* Description: Add a user role to the dimensions options in MonsterInsights.
* Version: 1.0.0
* Author: MonsterInsights Support Team
* Author URI: https://www.monsterinsights.com
*/
function monsterinsights_add_user_role_to_dimensions( $dimensions ) {