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 | |
/** | |
* Returns the attachment id for the most relevant image of the post | |
* @author Eric Wennerberg | |
* @package Flavour | |
*/ | |
function get_relevant_image() { | |
if(has_post_thumbnail()) { | |
return get_the_featured_image_id(); | |
} else { |
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
interface Cache<T> { | |
get: (id: string) => T | null; | |
set: (id: string, item: T) => void; | |
invalidate: (id: string) => void; | |
}; | |
interface CacheEntry<T> { | |
// Unix timestamp Math.floor(new Date() / 1000) | |
cachedAt: number; | |
item: T; |
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 _ = () => ( | |
<Table | |
columns={[ | |
{ label: "Id", value: "id", size: 2, sortable: false}, | |
{ label: "Name", value: "name", size: 2, sortable: false}, | |
]} | |
renderRow={(data, gridProps) => ( | |
<Grid {...gridProps[i]}>{data.id}</Grid> | |
<Grid {...gridProps[i]}>{data.name}</Grid> | |
)} |