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 | |
// https://www.youtube.com/watch?v=VEzAWMCwprQ | |
add_action( 'pmxi_saved_post', 'post_saved', 10, 1 ); | |
function post_saved( $id ) { | |
global $wpdb; | |
$pass = get_user_meta( $id, 'xfer_user_pass', true ); | |
$table = $wpdb->prefix . 'users'; | |
$wpdb->query( $wpdb->prepare( | |
" | |
UPDATE `" . $table . "` |
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
// run the event code if Gravity Form 6 was successfully submitted | |
jQuery(document).ready(function($){ | |
// Google Ads conversion tracking when Contact Form is successfully submitted | |
jQuery(document).on('gform_confirmation_loaded', function(event, formId){ | |
if(formId == 6) { | |
// Event snippet to log Google Ads conversion of Contact Form | |
gtag('event', 'conversion', {'send_to': 'AW-123456790/abcdefghijk'}); | |
} | |
}); | |
}) |
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 | |
// only run if TML plugin is active | |
add_action( 'init', 'fs_remove_tml_profile_fields'); | |
function fs_remove_tml_profile_fields() { | |
include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); | |
if ( is_plugin_active( 'theme-my-login/theme-my-login.php' ) ) { | |
// remove the password hint helper text from the register and password reset forms | |
tml_remove_form_field( 'register', 'indicator_hint' ); | |
tml_remove_form_field( 'resetpass', 'indicator_hint' ); | |
} |
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 // goes in functions.php | |
/* Enqueue necessary CSS and JS files for Child Theme */ | |
function fs_theme_enqueue_stuff() { | |
// Divi assigns its style.css with this handle | |
$parent_handle = 'divi-style'; | |
// Get the current child theme data | |
$current_theme = wp_get_theme(); | |
// get the parent version number of the current child theme | |
$parent_version = $current_theme->parent()->get('Version'); | |
// get the version number of the current child theme |
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 | |
// Remove the Plugin Notes Plus column for all users other than the ones we approve below | |
// based on their user email domain, or their user ID | |
// manipulate the Plugins admin page columns | |
// https://www.role-editor.com/remove-column-from-wordpress-users-list/ | |
add_filter('manage_plugins_columns','fs_remove_plugin_notes_columns_for_most_users'); | |
function fs_remove_plugin_notes_columns_for_most_users($column_headers) { | |
// get current user data | |
$current_user = wp_get_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
// this is wrapped in an `async` function | |
// you can use await throughout the function | |
// just in case, initially we set the output of this object to be false | |
output = {clientIdResult: false}; | |
// get the variable from the inputData we added to this Action | |
var clientid = inputData.clientId; | |
// check if the variable had data |
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
// get GA Client ID when using analytics.js | |
// set the tracker data via the ready callback | |
// https://developers.google.com/analytics/devguides/collection/analyticsjs/cookies-user-id#getting_the_client_id_from_the_cookie | |
// more info: https://developers.google.com/analytics/devguides/collection/analyticsjs/accessing-trackers#getting_data_stored_on_a_tracker | |
// fields we can get with a tracker: https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference | |
// helpers: https://www.simoahava.com/analytics/universal-analytics-plugins-explained/ | |
// helpers: https://hevodata.com/learn/google-analytics-and-salesforce/ | |
// check to see if the ID exists first | |
var gform_6_exists = document.getElementById('gform_6'); |
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
// this is wrapped in an `async` function | |
// you can use await throughout the function | |
// get personName | |
var personName = inputData.personName; | |
// get dateStart | |
var dateStart = inputData.dateStart; | |
// get dateEnd | |
var dateEnd = inputData.dateEnd; | |
// get dateDuration |
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 | |
// https://wordpress.stackexchange.com/questions/21076/remove-taxonomy-base-or-term-from-url | |
// Requires going to Settings > Permalink Settings, and resaving any time you make a change to this Snippet. | |
// Within the CPT UI settings for the Taxonomy, be sure Rewrite is set to True, but that there is no Custom Rewrite Slug used. | |
// These functions help forcibly remove the taxonomy's slug from the term's URL. | |
// You will need to keep an eye out for slug clashes (particularly with Pages or Posts), since this doesn't prevent those. | |
/** | |
* Help WordPress to force rewrites so it can know what the URL is that we want for each term |