Post URL Filter ( )
-
Hello, I am attempting to add Google Analytics tracking variables to my posts sent to Apple News using your WordPress plug-in. All of my posts are sent using the Apple News API.
I see in the code that you allow the WordPress filter, “apple_news_markdown_hyperlink”, to alter the URL in the class-markdown.php:line 172 as part of the private parse_node_hyperlink function. Is this function/filter not used if the posts is sent via the API and published automatically?
I have the following code in my functions.php file:
add_filter(‘apple_news_markdown_hyperlink’, ‘my_filter_apple_news_markdown_hyperlink’);
function my_filter_apple_news_markdown_hyperlink ( $strUrl ) {
if(!empty($strUrl)){
if(strpos($strUrl, ‘newTest=’) === false){
$strUrlCancatination = (strpos($strUrl, ‘?’) === false ? ‘?’ : ‘&’);
$strUrl = $strUrl.$strUrlCancatination.’newTest=1′;
}
}
return $strUrl;
}
The topic ‘Post URL Filter ( )’ is closed to new replies.