question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

EditPost clears thumbnail

See original GitHub issue

This removed the featured images on all my posts:

allposts=client.call(posts.GetPosts({'number':1000}))

for post in allposts:
    post.content=re.sub(r"https?://debris.glaciology.net/","/",post.content);
    client.call(posts.EditPost(post.id,post))

Issue Analytics

  • State:open
  • Created 8 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
n3stormcommented, Apr 11, 2018

Save attachment id while iterating posts and reassign it.

0reactions
Aref-Riantcommented, Apr 22, 2018

Hey, thanks bro worked for me:

def post_test1():
    posts = client.call(GetPosts())
    for p in posts:
        if p.title.lower() == 'ballot':
            post = WordPressPost()
            thumb = p.thumbnail['attachment_id']
            print(thumb)
            post.title = 'Ballot'
            post.thumbnail = thumb
            post.content = p.content
            post.post_status = p.post_status
            result = client.call(EditPost(p.id, post))
            return result
            break
Read more comments on GitHub >

github_iconTop Results From Across the Web

Change post thumbnail on using front end post edit form [closed]
I'm trying to get the post thumbnail to change if a user selects a new file on a front end post edit screen....
Read more >
How do you get thumbnails to show up in the admin edit post?
Do you see the post thumbnail box on pages? ... The feature is actually called featured image in the edit post screen, even...
Read more >
Thumbnail in post remain 80 px - Support | Kriesi.at - Premium ...
In “edit post” they show the way I want (150px) – when published they are only 80px ... You can clear it out...
Read more >
delete_post_thumbnail() | Function
Removes the thumbnail (featured image) from the given post.
Read more >
Topic: Thumbnail links inactive in Tanzaku theme | WordPress.com ...
Hi there dear people – I am using the Tanzaku theme which has a 'linkforce' feature that links post thumbnail images to the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found