The tag has no usage guidance.

learn more… | top users | synonyms

0
votes
3answers
31 views

wp_update_post deletes post meta in CPT

I have a custom post type called 'directory' and it includes a few meta/custom fields. The script below is meant to just change the post status only when run. This isn't on the admin panel where you ...
0
votes
1answer
25 views

wp_update_post onclick button using ajax

I'm trying to update my specific page using button in custom page on admin menu. I've tried using ajax to execute function in updatepost.php but the content of page no change. can any one help me? ...
2
votes
1answer
834 views

Issue with wp_insert_post and post_content field error Could not update post in the database

I'm having issues creating an import / caching script to be used within a WordPress site. This feed comes from a single text file that is then parsed and returned as an array. When running through ...
0
votes
1answer
529 views

wp_update_post based function works on existing posts, but not new posts

I have a function that will update the title of the post based on an 'advanced custom field'. It works on existing posts, but not when I create a new post. When I try and save the post and check the ...
0
votes
1answer
554 views

wp_update_post creating revisions instead of updating the post

I have been trying to update a post in the posts table but for some reason, it is creating a multiple number of revisions but not updating the main post. I have been trying hard for the last one day ...
0
votes
0answers
11 views

Hook into Post Exirator's expiration code

I need to run some code when a post from a custom post type is set to draft, which occurs automatically with the Post Expirator plugin. My code is set to run on the publish_to_draft action, however I ...
0
votes
1answer
592 views

SQL / wp_update_post: change post custom field to CPT post taxonomy

the setup is as follow: I have posts with a custom field: actor = 'tom hanks' for advanced management I created a custom post type (actors) and added "tom hanks" as a post within that actors taxonomy. ...
4
votes
2answers
2k views

Connection lost. Saving has been disabled… (Updating Posts/Pages)

I've been developing for Wordpress for a few years now without any trouble on an old XP/WAMP development server (v1.7.4) but recently have been getting the error "Connection lost. Saving has been ...
0
votes
1answer
34 views

Odd behaviour for the update button when displaying a WP_List_Table

I am currently trying to add a WP_List_Table to a metabox in the edit page of a custom type. The code is currently class Post_Table extends WP_List_Table { public function __construct() ...
0
votes
1answer
31 views

How to show Published date and/or Modified date

My code is based on the underscores reference theme. I have a posted_on function as follows: function example_posted_on() { $time_string = '<time class="entry-date published updated" ...
1
vote
3answers
3k views

Post/Page Publish/Update button not clickable once I make an edit

I open a page and make an edit and the update button becomes grayed out. I have to copy all page content, refresh the page and paste it back in the page, only then does the update button become ...
1
vote
1answer
67 views

How to generate slugs?

I have the following situation. I accidentally updated post_name column in wp_posts tables for all rows. Now I need to update those back somehow. I have researched that WP uses this function to ...
0
votes
1answer
60 views

Updating posts exceeds maximum execution time

Prehistory from How to generate slugs?: I have the following situation. I accidentally updated post_name column in wp_posts tables for all rows. Now I need to update those back somehow. I ...
0
votes
0answers
34 views

Can I override the permalink/slug on creation

I have a plugin that imports data from an external API, creates a 'Product' Custom Post type ( or updates an existing one ) and then adds all the meta data. Every time we update the product from the ...
0
votes
0answers
37 views

Schedule to change all currently draft posts to publish

I am looking for a simple way to switch all draft posts to publish utilizing wp_schedule_event. Any ideas? Not a noob to WP, but I am a noob to working with wp_schedule_event. I would like for this ...
0
votes
0answers
24 views

It is possible a Real-Time action in wordpress that reload its page on post update?

Is there a way in wordpress that whenever a post or any other content is updated then automatically all user browsers that are navigating the site get a real-time refresh page.
0
votes
0answers
174 views

Set Attachment Image File URL as GUID

I have a form that uploads images and i want to update the GUID to be the attachment file url after WP generates the metadata. I tried to use wp_update_post, but seems that is not updating the guid. ...
2
votes
2answers
104 views

Automatically insert php function into post $the_content

I am trying to have 2 php functions automatically inserted in every post for my CPT. The problem I am having is that even though I've found a way to add text, Im not sure how to add the php functions ...
0
votes
0answers
42 views

Use return values on AJAX call to async-upload.php via Add Media

I noticed, every time I upload images via Add Media button on front-end. It makes AJAX request to async-upload.php and returns attachment file information. On above image, I have 3 images uploaded ...
0
votes
0answers
53 views

How to update post_parent on images uploaded via Add Media button from front-end

I'm working on a plugin that will allow registered users to post content from front-end. I added WordPress default Add Media button on TinyMCE and noticed all the images uploaded via Add Media get ...
8
votes
8answers
10k views

Check for update vs new post on save_post action

Is it possible within the save_post action to determine whether it's a new post being created or an existing post being update?
0
votes
0answers
107 views

How to update posts via PHP in wordpress

I need to do the exact same what "update" button in the WP Backend does, but with PHP (and I know it has been asked 10'000 times, but the situation isn't that trivial :( ) wp_update_post should be ...
0
votes
1answer
81 views

Error in WP_update_post

i make php file outside from wordpress folder to edit wordpress post and i get error when i use this code. wp_update_post <?php include '/go1/wp-includes/post.php';?> <?php // Update post ...
0
votes
0answers
16 views

Set post_parent value for the images uploaded by Add Media button into post

I'm working on a front-end form plug-in and create shortcode to display front-end form on a page or post. While I was testing, I found all image files uploaded by Add Media button which will be ...
0
votes
1answer
157 views

Display success message after wp_update_post

I want to display a success message on updating a form from front-end using wp_update_post at the top of the form. I use below on edit page $post_id = wp_update_post($edit_post); and defined ...
0
votes
1answer
47 views

set_post_format called after wp_update_post when using bulk edit?

EDIT: See comments below. changing the question to reflect this new info From what I understand from the codex, save_post is meant to always fire after the post is saved (and when creating a new ...
1
vote
1answer
102 views

Function to change post status IF current user and post author are the same

I'm looking to force a post to revert to draft if it is published by the author. Here's the function I've wrote so far: function check_user_publish () { $user_id = get_current_user_id(); $author_id ...
0
votes
0answers
19 views

Update to editted posts

If I edit a post after it has been published and I then click 'update', does the post then get re-sent to all email recipients?
0
votes
0answers
31 views

Auto draft posts when scheduled date is reached

I have a plugin that allows all scheduled posts to be visible immediately... I'm looking for a function that will automatically set a post's status to "draft" when it reaches it's scheduled date and ...
0
votes
3answers
522 views

I need to bulk update all wordpress posts on a scheduled time

I need to update all posts on my wordpress site on a scheduled time (every day). So I wanted to create a new page template which I can call everyday through a cronjob to update all the posts at once. ...
0
votes
1answer
85 views

Custom Post save causes 500 error

Been having issues with getting a 500 error. Sometimes a change is saved, usually not. I've output the $key/$values to verify it's reaching the function and foreach. The output is the first ...
1
vote
2answers
3k views

How to batch update post content with custom post meta value

I have a custom meta box, using WPAlchemy, in which I am looking to get rid of. However, I would like to get all posts that have a specific custom meta value set, and insert it into the begininning of ...
0
votes
0answers
523 views

How to configure Dropzone.js to work with Wordpress media attachments

I have built a site that has a public front end which shows off profile pages for cars. I have built a members only back end which allows people to create accounts, and then make a profile page for ...
0
votes
0answers
76 views

update user data when save post

Hi I want to save authors' last post's date to wp_users table. I will use it for featured authors plugin. "date" is new column in my databese where in wp_users. function lastpostdate() { ...
0
votes
0answers
54 views

Using function to set youtube featured image works, but doesn't update before manually clicking post update

I am using a function to set the post featured image for a youtube video (see below). My Wordpress blog post is made by IFTTT (If This Then That). The function works, but the featured image update is ...
0
votes
0answers
60 views

Using $wpdb_update and foreach loop

I have this function to update data in my table list but it's not working. My insert and delete are working well, but I don't know what's wrong with this: function update_data() { global $wpdb; ...
0
votes
0answers
50 views

making custom post publish/update button

I'm here with a issue regarding my plugin... I've added a menu that should serve as a floating quick-action menu.. For example i would like that if you click the save button it will save the current ...
1
vote
1answer
210 views

Updating / Saving items generated by wp_terms_checklist on frontend

I'm displaying a list of custom taxonomies from a custom post type on a frontend page which shows any items that the user has previously selected as checked. I have got it displaying correctly, but I ...
0
votes
1answer
20 views

Update a Post after a user uploads a video

I am using the WP-File-Upload Plugin: https://wordpress.org/support/plugin/wp-file-upload This plugin allows you to upload a file on the front end and have it "attach" to the post that the plugin is ...
0
votes
0answers
38 views

Update existing post by email

Hi I would like to know if any possibility to update an existing post by sending an email.
0
votes
0answers
27 views

WordPress Database Update Required

This is my first time experiencing the "DataBase update required" and then will not login in to the site. I am currently running version 4.2.2. I have read many blogs and see many people have had ...
0
votes
1answer
81 views

How to check if wp_update_post was successful

I want to update a post using wp_update_post( $my_post ); How can I check if it was successful? Should it return the post ID on successful update? I'm trying this: $post_id = wp_update_post( ...
0
votes
2answers
462 views

wp_update_post on specific custom post type

first of all, im sorry for my poor english, when i upadte a post this code changes the post slug to a "profileid" costom field value.. add_action('save_post', 'my_custom_slug'); function ...
1
vote
1answer
751 views

how to get last revision id created after wp_update_post

wordpress always store revision after call wp_update_post. How to get the post revision ID after call wp_update_post? Thanks
0
votes
0answers
888 views

How can I bulk update all posts without making changes?

I'm setting up a site which uses a custom vehicle auction theme. Using the WP All Import plugin, an XML file loads vehicle details into the theme, these are a type of post. In order for vehicles to ...
1
vote
1answer
129 views

How can I stop wp_update_post messing up HTML example code?

I'm showing little pieces of example HTML/PHP code on the frontend (with syntax highlighting). The entries are displayed as FAQ custom posts, and have a plugin (CMS Tree page) to alter the menu order, ...
1
vote
3answers
4k views

how can I set the post author of a post I just created with php?

I'm using php to dynamically create a custom post, and I need the author to be someone other than the logged in user. I found this ...
0
votes
0answers
95 views

Change permalink , keeping old structure with date

Currently on our website we have the /date/postname permalink structure with quite a number of posts. For SEO purposes we want to change it to /postname permalink structure but we want to keep the ...
1
vote
1answer
347 views

Programatically change post author

Given a user id, $user_id, and post id, $post_id, how can I programatically update a wordpress post author? Note: these posts are already created and the author cannot be set upon creation. Another ...
1
vote
1answer
350 views

Insert and then update post_type by wp_update_post

I wrote a function to insert content in the page and every date update automatic . I used wp_update_post( $my_post ); to update page . I want first insert content in top specific page and then ...