function header_v1(){
$custom_logo_id = get_theme_mod( 'custom_logo' );
if(!empty($custom_logo_id)) {
$image = wp_get_attachment_image_src( $custom_logo_id , 'full' );
$url = $image[0];
}
?>
}
add_shortcode("header_v1", "header_v1");
?>
function marker_content(){
if ( ! wp_verify_nonce( $_POST['nonce'], 'ajax-nonce' ) ) {
die ( 'Onjuiste rechten');
}
foreach($_POST as $key => $val) {
$$key = $val;
}
$parts = explode(' ', $content);
$yt = "";
$n = 0;
foreach($parts as $p) {
if(str_contains($p, 'youtu')) {
$n++;
if($n == 1) {
$autoplay = 1;
} else {
$autoplay = 0;
}
$id = end(explode('/', $p));
if(str_contains($id, '?')) {
$id = explode('?', $id)[0];
}
if(str_contains($id, '&')) {
$id = explode('&', $id)[0];
}
ob_start();
echo '
';
//print_r(file_get_contents("https://www.youtube.com/watch?v=$id"));
//echo explode('bottom-actions', explode('description-inner', file_get_contents("https://www.youtube.com/watch?v=$id"))[1])[0];
?>
$yt .= ob_get_clean();
}
}
echo $content;
if(!empty($yt)) {
echo $yt;
}
die();
}
add_action( 'wp_ajax_nopriv_marker_content', 'marker_content' );
add_action( 'wp_ajax_marker_content', 'marker_content');
function get_cats(){
return [
"green" => "Green",
"blue" => "Blue",
"yellow" => "yellow",
"green" => "yellow",
"gray" => "gray",
"orange" => "orange",
"pink" => "pink",
"violet" => "violet",
];
}
function newmarker_form(){
if ( ! wp_verify_nonce( $_POST['nonce'], 'ajax-nonce' ) ) {
die ( 'Onjuiste rechten');
}
foreach($_POST as $key => $val) {
$$key = $val;
}
$cats = get_cats();
?>
die();
}
add_action( 'wp_ajax_nopriv_newmarker_form', 'newmarker_form' );
add_action( 'wp_ajax_newmarker_form', 'newmarker_form');
function add_new_marker(){
if ( ! wp_verify_nonce( $_POST['nonce'], 'ajax-nonce' ) ) {
die ( 'Onjuiste rechten');
}
foreach($_POST as $key => $val) {
$$key = $val;
}
parse_str($_POST['formcontents'], $arr);
foreach($arr as $key => $val) {
$$key = $val;
}
$file = plugin_dir_url(__FILE__) . 'js/files/new_file.json';
$new_str = file_get_contents($file);
$new_arr = json_decode($new_str, true);
$to_add = [
"original_color" => $original_color,
"original_content"=> $original_content,
"original_address"=> $address??"",
"lat" => $lat,
"lon" => $lon,
];
$new_arr[] = $to_add;
$newfile = dirname( __FILE__ ). '/js/files/new_file.json';
file_put_contents($newfile, json_encode($new_arr));
sleep(1);
blend_files();
die();
}
add_action( 'wp_ajax_nopriv_add_new_marker', 'add_new_marker' );
add_action( 'wp_ajax_add_new_marker', 'add_new_marker');
function blend_files(){
$org = file_get_contents(plugin_dir_url(__FILE__) . 'js/files/v1.json');
$new = file_get_contents(plugin_dir_url(__FILE__) . 'js/files/new_file.json');
$org_arr = json_decode($org, true);
$new_arr = json_decode($new, true);
print_r($org_arr);
echo "New";
print_r($new_arr);
$combined = array_merge($org_arr, $new_arr);
$newfile = dirname( __FILE__ ). '/js/files/combined.json';
file_put_contents($newfile, json_encode($combined));
echo "Combined";
}
add_action('blend_files', 'blend_files');
?>
https://dialektkartor.se/wp-sitemap-posts-post-1.xmlhttps://dialektkartor.se/wp-sitemap-posts-page-1.xmlhttps://dialektkartor.se/wp-sitemap-taxonomies-category-1.xml