Skip to content

Instantly share code, notes, and snippets.

@joehoyle

joehoyle/api.php

Last active Oct 12, 2015
Embed
What would you like to do?
<?php
hm_add_rewrite_rule( array(
'request_method' => 'DELETE',
'regex' => '/api/v3/posts/([^/]+)',
'query' => 'post_id=$matches[1]',
'request_callback' => function( WP $wp ) {
wp_delete_post( $wp->query_vars['post_id'] );
exit;
}
) );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.