Avo
Forum Replies Created
Viewing 7 replies - 1 through 7 (of 7 total)
-
Thanks for the fix. Just tested on multiple sites and it’s now working.
cheers, Steve
I created a basic delete post script, and it works in v 3.4.0 but fails with 401 error in v 3.5.1
import requests
from requests.auth import HTTPBasicAuth
# Setup the credentials and post information
username = "xxxxxx"
app_password = "xxxxxxxxx" # The application password generated in your profile
post_id = 905 # Replace with the post ID you want to delete
base_url = "https://xxxxxxxxxx.com" # Replace with your site's base URL
# Construct the API URL
api_url = f"{base_url}/wp-json/wp/v2/posts/{post_id}"
# Send the DELETE request
response = requests.delete(api_url, auth=HTTPBasicAuth(username, app_password))
# Check the response
if response.status_code == 200:
print(f"Post with ID {post_id} has been successfully deleted.")
else:
print(f"Failed to delete post with ID {post_id}. Status code: {response.status_code}, Response: {response.text}")Forum: Plugins
In reply to: [WordPress REST API Authentication] Test Config not working – no responsere-started the server, problem solved.
Forum: Fixing WordPress
In reply to: Bulk Change Posts from Published to Draft Across Multiple SitesThanks, so I’d need to make modifications in the class-wp-rest-posts-controller.php then?
I did add to line 1018 of that file
$prepared_post->post_status = ( $status == 'publish' ) ? 'draft' : $status;
but doesn’t seem to workForum: Fixing WordPress
In reply to: 3.0 Plugin Upgrade Bug? Could Not Create DirectoryYes, I had same issue. I deleted the ‘upgrades’ folder, recreated and gave it recursive ‘777’ permissions and that solved the issue, for me at least.
Forum: Fixing WordPress
In reply to: Images next to Adsense in header not showing except on front page.Thanks heaps for that info. Solved my problem perfectly.
Good karma to you ??
Viewing 7 replies - 1 through 7 (of 7 total)