Get list of outdated plugins in the rest api?

Get list of outdated plugins in the rest api? It looks like you would need to create your own custom REST API endpoints using get_plugin_updates() and get_theme_updates() to list available updates. Note that these display cached data and don’t trigger a request to wp.org api.

How to get a page’s featured image through REST API?

Maybe because the custom REST field (fimg_url) was only being added to posts of the post type and yet your request was for Pages, i.e. posts of the page type.. so try changing the register_rest_field( array(‘post’) to register_rest_field( array(‘post’, ‘page’). See https://developer.wordpress.org/reference/functions/register_rest_field/#parameters. But actually, you can use the _embed parameter to have the full media … Read more

Using backbone, can I prevent the nonce from being set?

Yes, the nonce is by default always being sent via the X-WP-Nonce header – see the source here and here on GitHub. wp.api.WPApiBaseModel.prototype.sync and wp.api.WPApiBaseCollection.prototype.sync can technically be extended or modified, but I would instead disable the nonce header like so, i.e. using <Collection or Model object>.endpointModel: Collection example: const Posts = new wp.api.collections.Posts(); // … Read more

Get the email of the author of the currently being edited post in Gutenberg frontend

Here’s how can you get the ID and email address of the author of the currently being edited post: // Get the post author’s ID. let postAuthorId = wp.data.select( ‘core/editor’ ).getCurrentPostAttribute( ‘author’ ); /* or you can also use this: let postAuthorId = wp.data.select( ‘core/editor’ ).getEditedPostAttribute( ‘author’ ); */ // Get the post author’s email. … Read more

REST API Schema: how to allows for both empty string or email string

even if I put in the schema ‘type’ => array(‘string’,’null’) I can’t POST a request with this field left empty, because WP always respond with rest_invalid_param and rest_invalid_email Actually, adding the ‘null’ there does not mean that any empty-ish values like ” and 0 will be allowed. It just means that an actual null value … Read more

Registered a REST Route but I’m Getting a 400 Bad Request

Make sure you’re reaching the correct endpoint by using rest_url(). When using the REST API and nonces, make sure that the nonce action is set to ‘wp_rest’. add_action(‘enqueue_block_editor_assets’, function () { $data = wp_json_encode(array( ‘restUrl’ => esc_js(rest_url(‘guide-posts/v1’)), ‘nonce’ => esc_js(wp_create_nonce(‘wp_rest’)) )); wp_add_inline_script(‘guide-posts’, “var guidePostsAjax = $data”); }); The permission_callback property is mandatory when registering a … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)