How Can I Create a List of Values to Be Iterated Through via WordPress Customization API?

Assuming you have an array $locations available, you can use this code to generate a dropdown in the customizer. It’s not that different from a single value. $section_name=”wpse213980_section_name”; // adapt to your naming system $section_title=”wpse213980_section_title”; // adapt to your naming system $setting_name=”wpse213980_setting_name”; // adapt to your naming system $setting_field_type=”select”; $setting_field_options = $locations; $sanitize_callback = ‘sanitize_text_field’; … Read more

Extending WordPress REST API

There are no answers here yet, but atleast we ended up using a combination of WP REST API and WP OAuth Server. The WP REST API was really easy to work with, as it provided a common framework to respond to HTTP requests. I found it similar to ASP.NET Web API, as that’s the framework … Read more

Using API to generate short link

You never need do_shortcode(), better said, almost never, there are a few cases where do_shortcode() could be appropiate. Note how you could do just: echo shorten_url( ‘http://mylink.com ‘ ); instead of: echo do_shortcode(‘[shorten]http://mylink.com[/shorten]’); Think about shortcodes as PHP functions placeholders; they are intended to be use where you can not execute PHP directly, like the … Read more

Every possible way to get data (posts) from WordPress

Since you aren’t able to use the out-of-the-box functionality (i.e. not publishing the posts!) you will inevitably have to cover yourself in a few different ways. You seem to have most of them covered – but a couple more ideas: The single post page itself. Assuming you are OK with the post never being visible … Read more