This file contains hidden or 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 taskName from the custom fields above | |
var taskID = inputData.taskID; | |
// add the task to multiple projects | |
// notes: https://forum.asana.com/t/add-a-task-to-multiple-projects-via-api/160035/7 | |
let body = { | |
"data": { | |
"actions": [ | |
{ | |
"method": "POST", | |
"relative_path": "/tasks/" + taskID + "/addProject", |
This file contains hidden or 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 freshy_redirect_role($user_login, $user) { | |
//var_dump($user); | |
if( in_array( 'subscriber',$user->roles ) ){ | |
//The next two lines are to check if the user has an active subscription | |
//in the Woocommerce Subscription plugin... if so redirect to custom path instead of WooCommerce default My Account page | |
if( function_exists( 'wcs_user_has_subscription' ) ) { | |
// Indicate whether a given user has a subscription to a given product with an optional status filter | |
// FYI: If the status filter is left empty, the function will see if the user has a subscription of any status | |
// check the user's ID, for any product ID, that has an active status ... if met returns true |
This file contains hidden or 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 | |
/* take some of the fields from the Team Member and use it to make a shortcode that outputs JSON-LD structured data for Person schema */ | |
add_shortcode( 'fs-team-schema', 'fs_team_show_json_schema_shortcode' ); | |
function fs_team_show_json_schema_shortcode() { | |
// if within an admin page and its not doing Ajax request | |
if ( is_admin() AND ! wp_doing_ajax() ) { | |
// then don't return anything since we aren't using it here | |
return FALSE; |
This file contains hidden or 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 type="application/ld+json"> | |
{ | |
"@context": "https://schema.org/", | |
"@type": "Person", | |
"@id": "https://freshysites.com/team/jon-fuller/#person", | |
"name": "Jon Fuller", | |
"jobTitle": "Lead Web Developer", | |
"Description": "Striving to solve issues and implement complex functionality — with creative user-friendly techniques and thorough constructive solutions.", | |
"worksFor": | |
{ |
This file contains hidden or 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 data for all users other than the ones we approve below | |
// based on their user email domain, or their user ID | |
// using their own filter, we hide its output | |
add_filter( 'plugin-notes-plus_hide_notes', 'fs_remove_plugin_notes_data_for_most_users' ); | |
function fs_remove_plugin_notes_data_for_most_users( $hide_notes ) { | |
// get current user data | |
$current_user = wp_get_current_user(); |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 |