I hereby claim:
- I am jomurgel on github.
- I am jomurgel (https://keybase.io/jomurgel) on keybase.
- I have a public key ASCK00IE4mmbugFZvLeA4rFivci2nfYPJlAsGB_gKWXCgQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
npm run build 2>&1 > npm_error_log.txt |
# Compare the changes against main. | |
git diff main BRANCH_W_CHANGES_NAME > ./temp_patch | |
# Checkout to a new branch and apply the patch. | |
git checkout NEW_BRANCH_NAME && git apply ./temp_patch |
import { useState, useEffect } from 'react'; | |
/** | |
* Fire callback function after state change. | |
* | |
* @param {any} initialState intial state value. | |
* @param {function} callback callback after state change. | |
*/ | |
const useStateWithCallback = (initialState, callback) => { | |
const [state, setState] = useState(initialState); |
Recommendations of unit types per media type:
Media | Recommended | Occasional use | Infrequent use | Not recommended |
---|---|---|---|---|
Screen | em, rem, % | px | ch, ex, vw, vh, vmin, vmax | cm, mm, in, pt, pc |
em, rem, % | cm, mm, in, pt, pc | ch, ex | px, vw, vh, vmin, vmax |
<?php | |
/** | |
* Adds category names field to faqs post type. | |
*/ | |
function add_category_names_to_api() { | |
register_rest_field( | |
'post', // post type. | |
'category_names', // element. | |
[ | |
'get_callback' => __NAMESPACE__ . '\return_category_names' |
<?php | |
/** | |
* Recursively check multidimentional array for value | |
* | |
* @param string|int $needle The searched value. | |
* @param array $haystack The array. | |
* @param boolean $strict If the third parameter strict is set to TRUE then the in_array() function will also check the types of the needle in the haystack. | |
* | |
* @return boolean haystack has needle. | |
*/ |
git diff BRANCH_NAME > ../temp_patch | |
git checkout NEW_BRANCH_NAME && git apply ../temp_patch |
<?php | |
/** | |
* Filter a user's capabilities. This is generally super iffy with security concerns. | |
* | |
* @see WP_User::has_cap(). | |
* | |
* @param array $allcaps Associative array of capability names and whether the user has the cap. | |
* @param caps $caps The capabilities needed for the requested meta capability. | |
* @param array $args Parameters passed to has_cap(). | |
* @param WP_User $user User object. |
import { __ } from '@wordpress/i18n'; | |
/** | |
* List of US States. | |
* Raw Data Source: https://gist.github.com/tleen/6299431 | |
*/ | |
export default [ | |
{ | |
value: '', | |
label: __('Select a State', 'domain'), |