New answers tagged

1

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


0

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 ...


3

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, '...


-2

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 http://codex.wordpress.org/Creating_Tables_with_Plugins


0

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'); ...


0

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 ...


0

With WP-CLI installed from https://wp-cli.org/ 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