New answers tagged


Take a look at a plugin called Better REST API Featured Image. It adds the featured image URL to the original API response.


Pretty much wp-load.php is the only way to go. I don't think there is really another way to load the WordPress functions safely... You can account for path variations by recursively including it from any file where you need it though... eg. function file_find_require($file,$folder=null) { if ($folder === null) {$folder = dirname(__FILE__);} $path ...


If we look at the WP_REST_Controller::get_collection_params() method, we can see the minimum is 1 and the maximum is 100: 'per_page' => array( 'description' => __( 'Maximum number of items to be returned in result set.' ), 'type' => 'integer', 'default' => 10, 'minimum' => 1, '...


Instead of wp_insert_posts, create your own "call" using $wpdb which you can then set your own database e.g. $table_name = $wpdb->prefix . 'tablename'; $wpdb->insert( $table_name, array( // data to add ) ); You can read more on custom tables at


Gonna have a go... say you have a theme option themeoption[id]... instead of setting transport refresh, set it to postMessage instead, and then add this code to create a callback that first gets the page URL via AJAX then sends that back to the previewUrl as you mentioned before refreshing... add_action('customize_preview_init,'preview_override_loader'); ...


If you're using SSL (HTTPS URL) you don't need to use oauth1.0 with oauth signature and everything. All you need to do is pass in the consumer_key and consumer_secret in the url https://localhost/wpShop/wc-api/v2/products?consumer_key=ck_1111111111122123&consumer_secret=cs_232332322233232 That's it! However, if your URL is NOT SSL, then you have to go ...


With WP-CLI installed from you can retrieve the total post count by using: wp-cli post list --format=count Full documentation for the POST LIST command

Top 50 recent answers are included