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 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 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
// 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 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 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 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
// 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 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://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 |
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 fs_sc_location_seo_iconbox( $atts ){ | |
// begin output buffering | |
ob_start(); | |
global $post; // if outside the loop | |
$slug_to_check = 'seo'; | |
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://wordpress.org/support/topic/bulk-edit-record-matching-by-slug/#post-14026355 | |
// Create custom PHP function that we can use in the "Post ID" field under Record Matching | |
// We pass the post slug to our function, then we use this function tot look up the post by its slug, to return the Post ID | |
function fs_get_post_by_slug( $slug, $post_type = 'post' ) { | |
if ( $post = get_page_by_path( $slug, OBJECT, $post_type ) ) { | |
return $post->ID; | |
} |
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 | |
// get current time | |
$time = current_time('mysql'); | |
// set the post ID to have a post date of NOW | |
wp_update_post( | |
array ( | |
'ID' => 3274, // ID of the post to update | |
'post_date' => $time, | |
'post_date_gmt' => get_gmt_from_date( $time ) | |
) |
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 | |
// enable if AIOSEO is active | |
if ( function_exists( 'aioseo' ) ) { | |
// fires after WordPress has finished loading but before any headers are sent. | |
add_action( 'init', function() { | |
// get current User | |
$user = wp_get_current_user(); | |
// get their email address | |
$email = $user->user_email; | |
// check the email's domain |
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 cspml_custom_item_description($default_content, $post_id){ | |
// get the terms of the post | |
$terms = get_the_terms( $post_id, 'product_types' ); | |
// this is a version that will output it as a basic comma-separated list | |
$terms_string = join(', ', wp_list_pluck($terms, 'name')); | |
// set the list as empty initially | |
$terms_output = ''; |