How to have the right design for a custom post type without accessing themes

Assuming that your custom post type is “songs”, I guess what you need is something like this: First, allow the theme to provide a design / template file for your custom post type, if WordPress can’t find one, fall back to your design, which you provided in your plugin folder. <?php // Template Logic: function … Read more

How can I process xml file on upload?

I solved my problem with lots and lots of testing things out. Apparently my FormData Object was not correct. Doing these changes to my code worked: $(‘#xml’).on(‘submit’, function(e) { e.preventDefault(); var form_data = new FormData(this); form_data.append(‘action’, ‘calculate_xml’); $.ajax({ url : ajaxurl, type: “POST”, data : form_data, processData: false, cache: false, contentType: false, success:function(response){ $(‘#response’).html(response); }, … Read more

What is the way to ship read-me strings like plugin-strings for internationalization?

You can ship translations of some of the metadata used in your main plugin file’s header comment fields. Namely: Name, Description, PluginURI, Author, and AuthorURI. Just add the source strings into your PO/POT files exactly as they appear in your plugin headers. When a MO file is available containing these strings, WordPress will display the … Read more