$username="dbo469564739"; $password="NwvO8BorhoQZc7hWOW1k"; $database="db469564739"; $host="localhost"; $verbose=false; /** * Enables various security headers. * Includes preloading with subdomain support. */ function security_headers_wordpress() { header( 'Strict-Transport-Security: max-age=10886400; includeSubDomains; preload' ); header( 'Content-Security-Policy: default-src \'self\' \'unsafe-inline\' \'unsafe-eval\' https: data: ' ); header( 'X-Frame-Options: SAMEORIGIN'); header( 'X-XSS-Protection: 1; mode=block'); header( 'X-Content-Type-Options: nosniff'); } add_action( 'send_headers', 'security_headers_wordpress' ); // fix the add_filter above to work with PHP 8: add_filter('single_template', function($the_template) { foreach( (array) get_the_category() as $cat ) { if ( file_exists(STYLESHEETPATH . '/single-{$cat->slug}.php') ) return STYLESHEETPATH . "/single-{$cat->slug}.php"; } return $the_template;} ); //add_filter( 'option_page_capability_' . ot_options_id(), create_function( '$caps', "return '$caps';" ), 999 ); //add_filter( 'option_page_capability_' . ot_options_id(), function($caps) {return $caps;},999); function publication_listing_aside() { $custom_fields = get_post_custom(get_the_ID()); $doi = $custom_fields['doi'][0] ?? ""; $isbn = $custom_fields['isbn'][0] ?? ""; $link = $custom_fields['link'][0] ?? ""; if($doi!= '') { $linkout = ""; $linkend = ""; } else { $linkout = ""; $linkend = ""; } // if($link!= '') { $isbnlink = ""; $isbnlinkend = ""; } else { $isbnlink = ""; $isbnlinkend = ""; } $isbn_formatted = "{$isbnlink}{$isbn}{$isbnlinkend}"; // $authors = $custom_fields['authors'][0] ?? ""; $editors = $custom_fields['editors'][0] ?? ""; $citation = $custom_fields['citation'][0] ?? ""; $place = $custom_fields['place'][0] ?? ""; $city = $custom_fields['city'][0] ?? ""; $country = $custom_fields['country'][0] ?? ""; $data = $custom_fields['data'] ?? ""; $badge = $custom_fields['badge'] ?? ""; $code = $custom_fields['code'] ?? ""; $year = get_the_time( 'Y' ) ?? ""; $pubdate = get_the_time( 'j F Y' ) ?? ""; // $pubtype = get_the_category()[1] ?? ""; $pubtype = get_the_category() ?? ""; $cat=get_the_category() ?? ""; $location_array = array($place, $city, $country) ?? ""; $location = ". " . implode(", ", array_filter($location_array)) ?? ""; if($location==". ") { $location = ""; } if($data!=""){ $i=0; $data_array=array(); foreach($data as $datum) { // echo "$i = $datum"; $datum_array = explode("|",$datum); $data_array[] = "$datum_array[0]"; } $data_formatted = implode(" | ", array_filter($data_array)); } else { $data_formatted = ""; } if($code!=""){ $i=0; $code_array=array(); foreach($code as $code_item) { $code_item_array = explode("|",$code_item); if($code_item_array[2]) { $output_link = " - view output"; } else { $output_link = ""; } $code_array[] = "$code_item_array[0]$output_link"; } $code_formatted = implode(" | ", array_filter($code_array)); } else { $code_formatted = ""; } if($badge!=""){ $i=0; $badge_array=array(); foreach($badge as $badge_item) { $badge_item_array = explode("|",$badge_item); $badge_array[] = "$badge_item_array[0]"; } $badge_formatted = implode(", ", array_filter($badge_array)); } else { $badge_formatted = ""; } echo "$linkout$authors ($year).$linkend$citation$location."; if($editors!= '') { echo "Edited by $editors."; } $data_formatted = ""; $code_formatted = ""; $isbn_formatted = ""; echo "