XML asset fails to load using https

In case this helps anyone in the future: The problem was not a WordPress issue, it was a server configuration issue. Useful explanation on checking which stream wrappers are enabled on your server (used this to make sure https was enabled on my server) Enable Stream Wrappers Someone with the same issue found that their … Read more

Publish an XML feed from a CPT with ACF fields?

Here’s a fairly complete example of one way to do this. Let’s register a Job post type that will be used with our feed. /** * Register Job post type * https://developer.wordpress.org/reference/functions/register_post_type/ */ function wpse_register_job_post() { $book_args = [ ‘label’ => __( ‘Jobs’, ‘textdomain’ ), ‘public’ => true, ‘publicly_queryable’ => true, ‘show_ui’ => true, ‘show_in_menu’ … Read more

How to limit the content coming from wordpress shortcodes?

It’s better to 1st save the returned XML to a file and then loop back to unset. <?php $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => “http://www.cpac.ca/tip-podcast/jwplayer.xml”, CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => “”, CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => “GET”, CURLOPT_HTTPHEADER => array( “cache-control: no-cache”, “postman-token: 28025ee8-1e82-ce60-f6ae-f401118baa1c” ), )); $response = … Read more

Search XML file from within WordPress?

Here’s a PHP library which uses SOAP calls to access JIRA: https://github.com/jrbeeman/php-jira However, if you can get the XML file into a place PHP can access it then you can use general PHP calls to parse and read the XML file, e.g. SimpleXML http://php.net/manual/en/book.simplexml.php From there you can put your code in a theme template … Read more

Why does SVG upload in Media Library fail if the file does not have an XML tag at the beginning?

It seems that in the recent releases of WordPress, changes were made to the mime type handling to make sure that files have the extension they say they do: https://make.wordpress.org/core/2018/12/13/backwards-compatibility-breaks-in-5-0-1/ This poses an issue for SVG files without the tag in them. SVG is actually an XML, and WordPress is now requiring to have a … Read more