Skip to content

Instantly share code, notes, and snippets.

View nadeem-khan's full-sized avatar

Nadeem Khan nadeem-khan

View GitHub Profile
<?php
add_filter( 'account_page_form_fields', function ( $fields ) {
if ( ! wp_verify_nonce( $_POST['account_update_nonce'], 'verify_account_form' ) ) {
return $fields;
}
/**
* Changed this array to the field keys (wpum_ is the prefix)
*/

How to disable page caching with create-react-app

If you currently not using a service worker resulting in old production caches being used and users not getting new versions of the app.

src/index.js

Use:

import { unregister as unregisterServiceWorker } from './registerServiceWorker'
@alexphelps
alexphelps / wc-products-filter-custom-tax.php
Last active March 17, 2024 11:55
WooCommerce Products Filter Custom Taxonomy
/**
* Filter team products from main shop only on frontend on shop, category, and tag archives
*/
function exclude_team_products( $query ) {
$archive_query = $query->is_post_type_archive('product') && $query->is_main_query();
$cat_tag_query = $query->is_tax( array('product_cat', 'product_tag') ) && $query->is_main_query();
if ( !is_admin() && $archive_query || !is_admin() && $cat_tag_query ) {
$taxquery = array(
array(
'taxonomy' => 'product_team',
@emilysnothere
emilysnothere / add_action.php
Last active January 31, 2023 07:39
Adding fields to the WordPress post submit box
add_action('post_submitbox_misc_actions', createCustomField);
add_action('save_post', saveCustomField);
flex-flow:column-reverse wrap-reverse;
justify-content:center;
align-content:space-between;
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active July 6, 2024 20:09
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\