-
/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
/* Fluent Forms Select Dropdown Chevron Fix */ | |
form select.ff-el-form-control { | |
appearance: none; | |
-webkit-appearance: none; | |
-mod-appearance: none; | |
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAsElEQVQ4T+3TsQ2DQAyF4Z86UzBARqBLQ0Edpc8CTMIC9Ig6RZp0GSEDZIrUiSxx6OTIvpO4EjoO+9P5yVQUfqrCHju4PVGd4QHogBn4JnjpPQM34BNqNVgDL2AEegeVvgG4AkfgbYFy3gB3B42xFnjGk1hrY6EuJrC3hxqV+jDm3828keMJYlTOJTMTS90wwII+lpeTzkxvQu6vd1kap9Sm5oIpZ/2+g9lRmYXFM/wBdYQdFSn+8wIAAAAASUVORK5CYII=) !important; | |
background-repeat: no-repeat; | |
background-position: calc(100% - 10px) center; | |
background-size: 17px; | |
} |
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
/* https://css-tricks.com/simplified-fluid-typography/ */ | |
.responsive-font { | |
font-size: calc(2.26278rem + 2.24562*(100vw - 36rem)/39); | |
} | |
html { | |
font-size: 16px; | |
} | |
@media screen and (min-width: 320px) { |
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 devwax_create_user() { | |
$user = '*** username ***'; | |
$pass = '*** password ***'; | |
$email = 'email@address.com'; | |
if ( !username_exists( $user ) && !email_exists( $email ) ) { | |
$user_id = wp_create_user( $user, $pass, $email ); | |
$user = new WP_User( $user_id ); | |
$user->set_role( 'administrator' ); |
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 |
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
<?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
/* 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
// 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
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/ |