This file contains hidden or 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 filter_give_enabled_payment_gateways($gateways, $formId){ | |
if (!current_user_can('manage_options')) { | |
return array_filter($gateways, function($gateway){ | |
return $gateway !== 'gatewayId'; | |
}, ARRAY_FILTER_USE_KEY); | |
} | |
return $gateways; |
This file contains hidden or 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
{ | |
"babel-eslint": "^9.0.0", | |
"eslint": "^6.1.0", | |
"eslint-config-airbnb": "^18.0.0", | |
"eslint-config-prettier": "^4.1.0", | |
"eslint-plugin-html": "^5.0.3", | |
"eslint-plugin-import": "^2.18.0", | |
"eslint-plugin-jsx-a11y": "^6.2.3", | |
"eslint-plugin-prettier": "^3.0.1", | |
"eslint-plugin-react": "^7.14.2", |
This file contains hidden or 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
{ | |
"[javascript]": { | |
"editor.defaultFormatter": "esbenp.prettier-vscode" | |
}, | |
"[php]": { | |
"editor.defaultFormatter": "bmewburn.vscode-intelephense-client" | |
}, | |
"breadcrumbs.enabled": false, | |
"diffEditor.renderSideBySide": false, | |
"editor.autoIndent": "full", |
This file contains hidden or 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
const UPDATE_STATE = 'update_state'; | |
export default function reducer(state, action) { | |
switch (action.type) { | |
case UPDATE_STATE: | |
return { | |
...state, | |
...action.newData, | |
}; |
This file contains hidden or 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 React, {createContext, useContext, useReducer} from 'react'; | |
import PropTypes from 'prop-types'; | |
// Creates the initial React Context to be consumed by our custom provider and custom hook below | |
const StateContext = createContext(null); | |
const StateContextDispatch = createContext(null); | |
/** | |
* Creates a custom Provider Component where children can update state through a reducer | |
* |
This file contains hidden or 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
{ | |
"editor.fontFamily": "Fira Code, Menlo, Monaco, 'Courier New', monospace", | |
"editor.fontSize": 12, | |
"editor.lineHeight": 26, | |
"editor.quickSuggestionsDelay": 30, | |
"editor.letterSpacing": 0.5, | |
"html.format.enable": true, | |
"html.format.preserveNewLines": true, | |
"files.trimTrailingWhitespace": true, | |
"editor.cursorWidth": 5, |
This file contains hidden or 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
{ | |
"Scaffolds a Storybook Story in MDX": { | |
"prefix": "storymdx", | |
"body": [ | |
"import {Meta, Story, Preview} from '@storybook/addon-docs/blocks';", | |
"import {action} from '@storybook/addon-actions';", | |
"", | |
"import ${TM_FILENAME_BASE/(.*)\\..+$/$1/} from './index';", | |
"", | |
"<Meta title=\"Components|${TM_FILENAME_BASE/(.*)\\..+$/$1/}\" component={${TM_FILENAME_BASE/(.*)\\..+$/$1/}} />", |
This file contains hidden or 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
var fieldNames = document.querySelectorAll('.li-field-name'); | |
var fieldNameList = []; | |
fieldNames.forEach(function(name){ | |
fieldNameList.push("$"+name.textContent.replace(/\s+/g, '')+" "+"="+" "+"get_field("+"'"+name.textContent.replace(/\s+/g, '')+"'"+");"); | |
}); | |
console.log(fieldNameList.join('\r\n')); |
This file contains hidden or 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(document).bind('gform_post_render', function(){ | |
let InvalidFields = document.querySelectorAll('.gform_wrapper *[aria-invalid="true"]'); | |
let InvalidFieldsArray = Array.from(InvalidFields, (field) => { | |
let validationMessages = field.parentElement.parentElement.querySelectorAll('.validation_message'); | |
let fieldID = field.id; | |
let fieldIDArray = []; | |
var count = 0; | |
let ValidationMessagesArray = Array.from(validationMessages, (message) => { | |
if (validationMessages.length > 1){ |
This file contains hidden or 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
for p in "debug-bar" "debug-bar-console" "autodescription" "AJAX Thumbnail Rebuild" "Duplicate Post" "https://github.com/roots/soil/archive/master.zip" "carbon-fields"; do wp plugin install "$p" --activate; done |
NewerOlder