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 | |
/** | |
* This function has zero error handling and is currently a proof of concept. | |
* Don't use this in a live project unless you plan on creating issues for yourself. | |
*/ | |
function scholar_vitae_get_orc_id_values( $id ){ | |
$response = wp_remote_get( 'https://pub.orcid.org/v2.1/'. $id .'/record' ); | |
$response = preg_replace( "/(<\/?)(\w+):([^>]*>)/", "$1$2$3", wp_remote_retrieve_body( $response ) ); |
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 | |
/** | |
* Filters given content to add target="_blank" to external links. | |
* | |
* @see https://developer.wordpress.org/reference/files/wp-includes/html-api/class-wp-html-tag-processor.php/ | |
* @see https://adamadam.blog/2023/02/16/how-to-modify-html-in-a-php-wordpress-plugin-using-the-new-tag-processor-api/ | |
* @param string $content Content of the post. | |
* @return string | |
*/ |