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 | |
var adCampaign = inputData.adCampaign; // get the variable from the adCampaign | |
var adKeyword = inputData.adKeyword; // get the variable from the adKeyword | |
var taskID = inputData.taskID; // get the variable from the taskID | |
var finalAdKeyword = ""; | |
if ( (adKeyword == 'None') || (adKeyword == 'No Terms') || (adKeyword == '[channeldrilldown3]')) { | |
var finalAdKeyword = ""; | |
} |
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 | |
// https://developers.asana.com/reference/createstatusforobject | |
// get parentID (the ID of the unique project) | |
var parentID = inputData.parentID; | |
let body = { | |
"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
<?php | |
// https://www.youtube.com/watch?v=y1hHhUT_mfM | |
// example usage: [fs_dynamic_number_counter number_field="counter_1" title="Counter 1" percent="" id="" class=""] | |
// set the number_field value to be whatever the custom field name is that has your counter number | |
// set the title value to be whatever you want the counter's title to be | |
// set the percent value to "off" if you don't want the percent sign, otherwise leave it blank/empty for it to show | |
// set the id or class values if you want either of those on your module | |
// e.g., if you add a class, you could use it to add $ or + before or after the number value via CSS (by adding these to your stylesheet) | |
// e.g., .counter-dollar-before .percent-value::before { content:'$'; } | |
// e.g., .counter-plus-after .percent-value::after { content:'+'; } |
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 | |
// Give the Editor role full access to Gravity Forms | |
function fs_add_grav_forms(){ | |
$role = get_role('editor'); | |
$role->add_cap('gform_full_access'); | |
} | |
add_action('admin_init','fs_add_grav_forms'); |
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 | |
// triggers on all Divi pages before the main content | |
add_action( 'et_before_main_content', 'fs_banner' ); | |
function fs_banner(){ | |
global $post_type; | |
// tribe_is_community_edit_event_page() Returns true only if the Community Events submission page is currently being viewed (Edit Event, Submit Event/Add New Group) | |
// tribe_is_community_my_events_page() Returns true only if the Community Events “My Events” page is currently being viewed (My Groups) | |
// need: Edit Venue/Location, Edit an Organizer | |
// see list in /the-events-calendar-community-events/src/functions/template-tags.php |
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 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 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 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 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 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(); |