-
/context/
AppState.js
app-context.js
-
Wrap App _(app.js)
import AppState from "../context/AppState"; <AppState> ...
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
jQuery(function ($) { | |
// Initialize toggler state | |
window.mytheme_mobile_menu_toggle_open = false; | |
var popup_id = 7627; | |
var delay = 50; // Delay to avoid Elementor events firing before click event handlers (milliseconds) | |
// Mobile nav button toggle click event | |
$('li.mobile-menu-toggle').on('click', function (e) { | |
e.preventDefault(); | |
e.stopPropagation(); |
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
import path from 'node:path' | |
import fs from 'node:fs/promises' | |
import { globby } from 'globby' | |
const files = await globby('./dist/**/index.html') | |
await Promise.all( | |
files.map(async (htmlPath) => { | |
const pageStyles = [] | |
const stylesPaths = [] |
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
# The GoDaddy firewall also prevents the DNS records of the domain it's protecting from being edited. | |
# So WAF needs to be temporarily disabled in order to update DNS records. | |
In your GoDaddy account main dashboard page... | |
# Turn Off Godaddy WAF | |
https://sec.godaddy.com/ | |
1. Scroll to: "Website Security and Backups" (search page for "security" to jump to it | |
2. Click "Manage" next to "Website Security and Backups" | |
3. Click "Details" under "Firewall" |
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
git clone --filter=blob:none --sparse https://github.com/[username]/[whatever].git | |
cd [whatever] | |
git sparse-checkout init --cone | |
git sparse-checkout add examples/nextjs-slack-clone | |
# Source: https://hasura.io/learn/graphql/hasura-auth-slack/data-modeling/3-apply-migrations/ |
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
// Register acf fields to Wordpress API (functions.php) | |
// https://support.advancedcustomfields.com/forums/topic/json-rest-api-and-acf/ | |
function acf_to_rest_api($response, $post, $request) { | |
if (!function_exists('get_fields')) return $response; | |
if (isset($post)) { | |
$acf = get_fields($post->id); | |
$response->data['acf'] = $acf; | |
} |
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 only applies outside of /wp-admin/ i,e, on frontend while viewing public pages, etc. */ | |
body.admin-bar { | |
#wpadminbar { | |
overflow: hidden; | |
} | |
} | |
/* WP Bakery padding-top */ | |
body.logged-in { | |
.vc_row.wpb_row.vc_row-fluid.vc_custom_123456789 { |
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 | |
/* | |
Usage: | |
domain.com/plugins > domain.com/wp-admin/plugins.php (WP Admin > Plugins) | |
domain.com/pg > domain.com/wp-admin/edit.php?post_type=page (WP Admin > Pages) | |
etc... | |
*/ | |
add_action('wp', 'redirect_shortcuts'); | |
function redirect_shortcuts(){ | |
if (is_user_logged_in()) { |
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 | |
// Frontend memory limit | |
define('WP_MEMORY_LIMIT', '64M'); // Default for WooCommerce: https://github.com/WordPress/WordPress/blob/master/wp-includes/default-constants.php#L50 | |
// /wp-admin/ memory limit | |
define('WP_MAX_MEMORY_LIMIT', '256M'); // Default: https://github.com/WordPress/WordPress/blob/master/wp-includes/default-constants.php#L62 | |
// WordPress memory limits deep dive: https://www.saotn.org/increase-wordpress-memory-limit-wp-config-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
### Queries for replacing strings in MySQL database records | |
- https://www.webhostface.com/kb/knowledgebase/mysql-search-replace/ | |
UPDATE `wp_options` SET option_value = REPLACE(option_value, 'newdev/', '') WHERE `option_value` LIKE '%newdev/%' LIMIT 1; | |
- Regular expression | |
SELECT * FROM tablename WHERE meta_key REGEXP '^wp_([0-9]+)_' limit 10; | |
### MySQL dump specific rows, etc | |
-- Run in bash terminal, not in mysql> cli |
NewerOlder