I hereby claim:
- I am KimBranzell on github.
- I am brnzl (https://keybase.io/brnzl) on keybase.
- I have a public key whose fingerprint is 5BCA 6FB2 A0E2 0938 07DD 114E 1374 3D36 0F45 BD22
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
@mixin best-contrast($text-color, $bg-color, $level) { | |
$lum1: luminance($text-color); | |
$lum2: luminance($bg-color); | |
$contrast: $lum1 / $lum2; | |
@if $contrast < 1 { | |
$contrast: 1 / $contrast; | |
} | |
@if $level == AA { | |
@if $contrast < 4.5 { | |
// Text color does not meet AA contrast ratio, adjust color |
{"lastUpload":"2021-09-07T07:45:55.177Z","extensionVersion":"v3.4.3"} |
<?php | |
function getLuminance($val) { | |
$hex = $val; | |
// Get int RGB values from the hex. | |
list($r, $g, $b) = sscanf($hex, "#%02x%02x%02x"); | |
// Calculate according to the formula | |
$red = 0.2126 * ($r/255); | |
$green = 0.7152 * ($g/255); |
@mixin for-phone-only { | |
@media (max-width: 599px) { @content; } | |
} | |
@mixin for-tablet-portrait-up { | |
@media (min-width: 600px) { @content; } | |
} | |
@mixin for-tablet-portait-only { | |
@media (min-width: 600px) and (max-width: 899px) { @content; } | |
} | |
@mixin for-tablet-landscape-up { |
function update_post_slug( $data, $postarr ) { | |
if ( ! in_array( $data['post_status'], array( 'draft', 'pending', 'auto-draft' ) ) ) { | |
$data['post_name'] = wp_unique_post_slug( sanitize_title( $data['post_title'] ), $postarr['ID'], $data['post_status'], $data['post_type'], $data['post_parent'] ); | |
} | |
return $data; | |
} | |
add_filter( 'wp_insert_post_data', 'update_post_slug', 99, 2 ); |
<?php | |
add_action( 'save_post','changeLastModified' ); | |
function changeLastModified( $post ){ | |
if ( 'YOUR_CUSTOM_POST_TYPES_NAME' == get_post_type( $post ) ) { | |
if( ! ( wp_is_post_revision( $post ) ) ) { | |
$sync_time = array(); | |
$sync_time['ID'] = wp_get_post_parent_id( $post ); | |
$sync_time['post_modified'] = get_post_field( 'post_modified', $post, 'raw' ); | |
remove_action( 'save_post', 'changeLastModified' ); | |
wp_update_post( $sync_time, true ); |
<?php | |
$args = array( | |
'meta_key' =>'your_checkboxkey', | |
'meta_value'=>'1' | |
); | |
$the_query = new WP_Query( $args ); | |
?> | |
<!-- Loop continues here --> |