The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
0answers
19 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
7 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
15 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
0answers
32 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 ...
1
vote
0answers
45 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 ...
1
vote
1answer
26 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, ...
0
votes
0answers
40 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
27 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
85 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 ...
0
votes
1answer
37 views

Updating a post without escaping ampersands?

I've found that wp_update_post() escapes all ampersands provided in the post's post_content. I'm trying to update a post without converting ampersands to &. (I need to add plaintext URLs ...
1
vote
0answers
43 views

wp_update_post adding a -2 to the post slug

I've recently created a php file that is creating posts using the wp_insert_post function. This is working great and its inserting the post as it should do. I am leaving out the post title as I want ...
0
votes
2answers
98 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 ...
0
votes
1answer
39 views

Comparing pre-saved post_title to post-saved post_title

I'm implementing an inventory updater on a Wordpress product site that integrates with a 3rd-party website via their custom api. We're going to have a number of people updating the 3rd-party website, ...
0
votes
1answer
114 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
73 views

wp_update_post function ignores HTML tags

I have a custom plugin that moves posts from one category to another and then inserts text after the post is moved. This works fine except for I am trying to insert some CSS like you see below in the ...
0
votes
0answers
305 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 ...
0
votes
1answer
247 views

Programmatically change post visibility on save_post action return a 500

I'm trying to change the post visibility for my custom post type. On the edit.php screen the user can use a custom field to set the post type to normal or extended. That field shall work as ...
0
votes
0answers
506 views

wp_update_post does not update post_name

I have a post with id=1, post_title = 'Some post title' and slug(post_name)='some-post-title'. I want to update it's title and slug. $update_args = array( 'ID' => '1', 'post_title' => ...
0
votes
0answers
37 views

wp_update_post set value to null

Is it possible to set a field to NULL using wp_update_post? I'm trying the following: wp_update_post( array( 'ID' => $future_orphan_id, 'post_parent' ...
0
votes
0answers
61 views

Updating posts not working

Lets say I want to change a posts comment count to 50 everytime the post is viewed. I have this simple code in functions.php: function update_shares() { $my_post = array(); $my_post['ID'] = ...
1
vote
2answers
237 views

wp_insert_post_data filter hook identify current action

I have this function to set the title of a wordpress post which works properly for saving / updating posts. The major issue is that the function stops posts being deleted (it removes the title but the ...
0
votes
1answer
90 views

Change custom post status to draft before today

I tried this code which I made but looks like I am not doing it correctly.. The main problem is my code fetches all posts ordered by meta value date, but I need to hide the posts from the date today ...
0
votes
3answers
329 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
76 views

wp_update_post behaves differently for different user role

{ "sections": [ { "section_name": "Objective", "data": "<span style=\"font-weight: bold;\">Test</span>", "key": "ref" } ] } I am updating the above JSON ...
0
votes
0answers
98 views

Update post title from external file?

I have an external script I wrote (for admins only) that loads in the following at the top: require_once('./../wp-blog-header.php'); I'm aware that it can be a plugin, but it's just not right now.. ...
1
vote
0answers
130 views

Update a post's info when clicking on a javascript button

I have a series of posts about various locations. I need people to verify if the location informaton is correct. The question is asked with two buttons for options. If "no" is clicked, they are taken ...
3
votes
1answer
1k 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
102 views

Setting a featured image while creating the post

I am creating a post with wp_insert_post/wp_update_post. The post should have a featured image. But to set a featured image I need the postID. The problem is I do not have any postID. What I am doing ...
0
votes
1answer
107 views

Update post title with category name after editing a category

I have this relationshop between some categories and posts where the name of the category is also the name of the post. When I add a new category, a post that has the same title as the category is ...
1
vote
0answers
78 views

Post author for revision not being set on update/insert

I'm trying to programmatically update a custom-type post with revisions enabled via form, and everything seems to be working fine except the post_author field for the revision is being set to 0 ...
1
vote
2answers
252 views

wp_update_post via ajax from frontend

Setting: three open Tabs in browser: Tab 1: Admin edit post Tab 2: Frontend view of that post in "editing mode" Tab 3: Frontend view in "non-editing" mode (default request) I edit the post on Tab ...
1
vote
1answer
949 views

wordpress function to change post status [duplicate]

I'm running the YouTube Video Fetcher plugin at . It fetches videos using the youtube api and displays them on your website. Within the plugin script, there is the following sequence: if ...
1
vote
1answer
96 views

Posts are duplicating on wp_post_update

I have stucked in writing a simple function that on certain page update refresh all posts in a custom post type. Here is my code (based on this): add_action('save_post', 'bulk_refresh'); function ...
0
votes
1answer
461 views

Wp_update_post: Infinite loop even with remove_action solution, OOP

I have a quite complex PHP class, reponsible for creating and printing meta_boxes, generating and saving meta fields, ... Each meta_box (object of class) has its own save function, that updates meta ...
1
vote
0answers
560 views

wp_update_post not working

I have the following code in a single script to be run one time to fix post names which are empty. // WP_Query arguments $args = array ( 'post_type' => 'books', ...
0
votes
1answer
342 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
30 views

How to disable saving/changing update date for certain admin users?

I have an admin user who is only for correcting the spelling errors and grammar stuff, however, when he corrects some post that is several hours or days old and just changes "People are gready" to ...
0
votes
1answer
3k views

Updating post title using wp_update_post

I am creating a custom post type for a people page for a client website that has meta fields for both first and last name, but I would also like to update the title for the custom posts to be a ...
0
votes
2answers
2k views

post_status => publish not working

I have a front end form that let users submit a post. This is how i store the data when a post is submitted : if ( isset( $_POST['submitted'] )) { $post_information = array( ...
0
votes
1answer
155 views

Wp_editor doesn't send the required data

The wp_editor function is working fine concerning the displaying of editor and sending of information, except that the information is never sent as it is. In a template file responsible of updating ...
0
votes
0answers
149 views

Function working in single.php but not working in custom template file

I defined in my functions.php the following code: function fix_footnotes($content){ return preg_replace('/href\s*=\s*"[^"]+(#[^"]+)"/','href="$1"', $content); } When I call this ...
0
votes
0answers
35 views

How to create posts with a specific date in bulk

I need to import posts with a specific date. They way I am doing it now is I import as draft, then I use php to publish, then use php to change the date. The problem is that if I make a mistake in ...
0
votes
0answers
46 views

publish posts immediately when updating

i'm looking for a way (maybe a plugin) to have a choice of just updating an already published post, and updating and republishing it with a current date and time basically, two options when editing: ...
0
votes
0answers
115 views

Update Post with Modified Data

Task is to take class from <pre class="php"></pre>, and add that class to <code></code> and wrap all content of <pre> into <code> after that. I am querying WP with ...
1
vote
2answers
2k 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
0answers
159 views

Changing random post publish time for repost

I have a lot of image posts. So, on weekends I don't work for that I want to re-post a random post. I made my own code. It schedules random post with its permalink too. $time= strtotime("+10 min") ...
1
vote
1answer
119 views

custom post scheduler for drafts

I have a lot of posts everyday to publish. Now, I am thinking to schedule all those posts which I saved them as drafts. So, I tried to make a custom post scheduler. Here is what I tried, $time = ...
1
vote
1answer
738 views

Scheduling posts to update once per day with wp_cron

I have a function that hooks into save_post that changes the value of a custom taxonomy term based on today's date. That's working fine. When I update a post, the taxonomy term is updated correctly. ...
0
votes
1answer
446 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. ...
3
votes
1answer
416 views

Endless loop with wp_insert_post and wp_update_post

I have an array $unqiues which contains URL's, I loop over the array with the code below to get the URL titles, insert a new post, update the post meta. Then I change the the posts title and name to ...