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 get_gengou( $time, $format = '%s%s' ) { | |
list( $y, $m, $d ) = explode( ' ', date( 'Y m d', is_numeric( $time ) ? $time : strtotime( $time ) ) ); | |
$gengou = ''; | |
if ( $y < 1868 ) { | |
return $gengou; | |
} | |
if ( $y >= 1868 && $y < 1912 ) { |
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 | |
add_filter( 'get_post_metadata', 'get_preview_post_meta_data', 10, 4 ); | |
add_action( 'wp_insert_post', 'save_preview_post' ); | |
add_action( 'save_preview_postmeta', 'acf_save_preview_postmeta' ); | |
function get_preview_post_meta_data( $meta_value, $post_id, $meta_key, $single ) { | |
global $post; | |
if ( ! empty( $_GET['preview'] ) && $post->ID == $post_id ) { | |
$preview = wp_get_post_autosave( $post_id ); |
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
const strToRgb = function(str) { | |
const hslToRgb = function(hue, saturation, lightness) { | |
const chroma = (1 - Math.abs((2 * lightness) - 1)) * saturation; | |
let huePrime = hue / 60; | |
const secondComponent = chroma * (1 - Math.abs((huePrime % 2) - 1)); | |
huePrime = Math.floor(huePrime); | |
let red; | |
let green; |
OlderNewer