Localizing text from XML files

You should use a localized XML format like XLIFF or TMX , there is a tool to convert XLIFF to .po. If you cannot change the source XML you have a few options but it really depends how your outputting this XML info: Parse the XML ( for label) and create a .po with gettext … Read more

How do you get all the urls of images attached to a post?

You need to loop through the attachments within your post loop, replace the section of code you posted with this (put this together from some other code I found related to a similar problem, but couldn’t test it): </BasicDetails> <?php $args = array( ‘post_parent’ => $post->ID, ‘post_type’ => ‘attachment’, ‘numberposts’ => -1, // show all … Read more

How to read the xml file in wordpress?

WordPress bundles and wraps SimplePie class for feed download, caching and processing. Retrieving namespaced data with it would be something like this: $feed = fetch_feed( ‘http://www.wdcdn.net/rss/presentation/library/client/iowa/id/128b053b916ea1f7f20233e8a26bc45d’ ); $items = $feed->get_items(); foreach ( $items as $item ) { $credit = $item->get_item_tags( ‘http://search.yahoo.com/mrss/’, ‘credit’ ); var_dump( $credit ); } See fetch_feed() in Codex.

How to re-Import the WordPress XML file after editing?

What do you need to edit and why can’t you edit in the WP editor? Can you use Search RegEx? It’s a plugin to search and replace with grep and regular expressions through content. If you need to develop a regex search string to find certain content, check https://stackoverflow.com/questions/tagged/regex

With WordPress Importer, why can’t I import post meta containing a multi-dimensional array, in which value(s) of that array contain line breaks?

I would wage that your issue is with \r\n (CRLF). If the newlines are created in Windows, they’ll go into the database as \r\n and when serialized get counted as 2 characters. Then when importing, they’ll only be counted as 1 character and they’ll corrupt the string. I tested this hypothesis and sure enough I … Read more

Hook for URL Request

Actually, my recommendation would be to do things a bit differently. You can add a custom rewrite endpoint to WordPress to handle these files specifically. For example, the URL http://site.com/download-xml/the_filename would automatically download the specified file as an attachment. First, you need to add a custom rewrite endpoint to set this up: function add_endpoint() { … Read more

Plugin or advice on how to parse XML in real-time?

You could the following to achieve this in the “WordPress way”: Add code via plugin or child theme In the code add a wp cron task The task should get the file with wp_remote_get Parse the xml file with SimpleXMLElement Update the content to meta fields of the post with update_post_meta You could display the … Read more

Is it possible to export WordPress from command line?

Check out http://wp-cli.org/. It’s fantastic and I’ve used the export capability multiple times. More information on wp-cli. WP-CLI is a set of command-line tools for managing WordPress installations. You can update plugins, set up multisite installs and much more, without using a web browser. You will most likely have to install wp-cli. You can find … Read more

When importing – failed to import: Invalid post type feedback

The issue is you’re trying to import posts with a post type of feedback, but there is no such post type registered on your install of WordPress. Quick-and-easy fix is to register one: add_action( ‘init’, function () { register_post_type( ‘feedback’, [ ‘public’ => true, ‘labels’ => [ ‘singular_name’ => ‘Feedback’, ‘name’ => ‘Feedback’, ] ]); … Read more