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
import 'photoswipe/style.css' | |
import { type PreparedPhotoSwipeOptions } from 'photoswipe' | |
import PhotoSwipeLightbox from 'photoswipe/lightbox' | |
import { useEffect } from 'react' | |
export function usePhotoswipe( | |
gallerySelector: string, | |
options: Partial<Omit<PreparedPhotoSwipeOptions, 'gallery' | 'pswpModule'>> = {} | |
) { |
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
add_filter( 'wp_handle_upload_prefilter', function ( $file ) { | |
$uploads = wp_upload_dir(); | |
$use_yearmonth = get_option( 'uploads_use_yearmonth_folders' ); | |
if ( boolval( $use_yearmonth ) ) { | |
// if upload to year month based folders is enabled check current target | |
$year = date( 'Y' ); | |
$month = date( 'm' ); | |
$target = $uploads['path'] . DIRECTORY_SEPARATOR . $year . DIRECTORY_SEPARATOR . $month . DIRECTORY_SEPARATOR . $file['name']; | |
} else { | |
// uploads dir |
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
/* | |
Mark WPML translations that need an update | |
as completed (needs_update=0) | |
Change PREFIX to wp table prefix | |
Adjust WHERE conditions where neccessary | |
*/ | |
UPDATE | |
PREFIX_icl_translations AS translations | |
LEFT JOIN |
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
function validateDigistoreSha() { | |
const THANKYOU_PAGE_KEY = "XXXXXXXXXXXXXX"; | |
const data = new URLSearchParams(window.location.search); | |
function hexString(buffer) { | |
const byteArray = new Uint8Array(buffer); | |
const hexCodes = [...byteArray].map(value => { | |
const hexCode = value.toString(16); |