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
// | |
// Wordpress - Support for iframes being called for a specific page. Add this to functions.php | |
// In this case, the URL $allowed_url will be allowed to pull the contents of the 'my-embed' page | |
// | |
add_action( 'send_headers', 'add_header_xframe', 99 ); | |
function add_header_xframe() { | |
if ( is_page('my-embed') ) { | |
$allowed_url = 'http://test.local'; | |
header( 'Content-Security-Policy: frame-ancestors '.$allowed_url ); | |
} |
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
// | |
// Hook the Ninja forms before submitting | |
// | |
add_filter( 'ninja_forms_submit_data', 'my_ninja_forms_submit_data' ); | |
// | |
// This function hooks the Ninja submission step | |
// Thanks to https://stackoverflow.com/questions/61440656/ninja-forms-server-side-validation-not-working | |
// |
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
// | |
// Shop Order Form - Allow shop products to be added to the GF on the fly. | |
// | |
// Products are defined in an ACF CPT. These products may be purchased via a Gravity Form. | |
// The base form should have all fields required, except without products. | |
// The product fields will be added immediately above the Shipping field. | |
// | |
add_filter( 'gform_pre_render_7', 'populate_shop_products' ); | |
add_filter( 'gform_pre_validation_7', 'populate_shop_products' ); |
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
add_action( 'init', 'ingeni_add_posts_menuorder' ); | |
function ingeni_add_posts_menuorder() { | |
add_post_type_support( 'post, page', 'page-attributes' ); | |
add_post_type_support( 'page', 'excerpt' ); | |
} |
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
// Take the URL of a local file in the WP Uploads folder and check that it does actually exist | |
function uploaded_file_exists( $url ) { | |
$local_exists = false; | |
if ( $url ) { | |
$uploads = wp_upload_dir(); | |
$local_path = str_replace( $uploads['baseurl'], $uploads['basedir'], $url ); | |
$local_exists = file_exists($local_path); | |
} |
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
// | |
// Custom WP menu container - thanks to https://gist.github.com/nikolov-tmw/8698598 | |
// | |
// Add a custom container to your | |
// | |
add_action( 'admin_head-nav-menus.php', 'custom_register_menu_metabox' ); | |
function custom_register_menu_metabox() { | |
$custom_param = array( 0 => 'mega_col' ); |
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
// | |
// Add a Custom Yoast Variable | |
// | |
add_action('wpseo_register_extra_replacements', 'add_yoast_supercharge_variables'); | |
function add_yoast_supercharge_variables() { | |
if (function_exists ('wpseo_register_var_replacement')){ | |
wpseo_register_var_replacement('%%BRAND%%', 'supercharge_yoast_brand', 'advanced', 'Supercharge Brand' ); | |
} | |
} |
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
add_action ( 'wp_head', 'rp_add_custom_js' ); | |
function rp_add_custom_js() { | |
$ga_code = 'G-xxxxxxxx'; | |
$script = "<!-- Google tag (gtag.js) --> | |
<script async src='https://www.googletagmanager.com/gtag/js?id=".$ga_code."'></script> | |
<script> | |
window.dataLayer = window.dataLayer || []; | |
function gtag(){dataLayer.push(arguments);} | |
gtag('js', new Date()); |
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
URL: | |
https://answers.microsoft.com/en-us/officeinsider/forum/all/macos-another-account-from-your-organisation-is/53e99843-9069-4d54-a269-71d7112458a0?page=5 | |
Answer: | |
Not sure if this has been listed here yet: https://learn.microsoft.com/en-us/office/troubleshoot/activation/another-account-already-signed-in | |
I had tried the Keychain steps as well as using office-reset tool. Completely uninstalling and restarting the machine etc. None of that worked. |
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
/* | |
Uses https://fullcalendar.io/ | |
calendar_events is a multidim array of event info. Eg: | |
[{ | |
title: 'My Event 1', | |
url: 'https://myevent_1.booking.page', | |
start: '2023-05-28T21:30:00' | |
}, |
NewerOlder