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
{ | |
"title": "JSON schema for WordPress blocks", | |
"$schema": "http://json-schema.org/draft-04/schema#", | |
"definitions": { | |
"//": { | |
"reference": "https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/", | |
"attributesReference": "https://developer.wordpress.org/block-editor/reference-guides/block-api/block-attributes/", | |
"contextReference": "https://developer.wordpress.org/block-editor/reference-guides/block-api/block-context/", | |
"supportsReference": "https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/", | |
"registerReference": "https://developer.wordpress.org/block-editor/reference-guides/block-api/block-registration/#example-optional" |
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 givewp_hide_gift_aid_warnings($notice_args) { | |
if( $notice_args['id'] == 'gift-aid-currency-notice' || $notice_args['id'] == 'gift-aid-country-notice' ) { | |
$notice_args['show'] = false; | |
} | |
return $notice_args; | |
} | |
add_filter( 'give_register_notice_args', 'givewp_hide_gift_aid_warnings' ); |
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
//disable TOC button | |
window.HelpViewer.showTOCButton(false); | |
//enable TOC button | |
//If you call this on window load it will flash active for a brief second and then disable again. | |
//Call if after a delay of 250ms and is works fine | |
//Not sure what the second variable does yet, but passing false works fine | |
window.HelpViewer.showTOCButton( true, false, function() { | |
//do something to toggle TOC in your webpage | |
}); |
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
/** | |
@brief Returns true if images have same meta. Width, Height, bit depth. | |
@discussion Assumes images are non null. | |
*/ | |
func doImagesHaveSameMeta(#image1:CGImage, #image2:CGImage) -> Bool { | |
if CGImageGetWidth(image1) != CGImageGetWidth(image2) { | |
return false | |
} | |
if CGImageGetHeight(image1) != CGImageGetHeight(image2) { |