The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
0answers
39 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
49 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
48 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
1answer
82 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
49 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
64 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
90 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
797 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
64 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
75 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
60 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
180 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 ...
0
votes
1answer
318 views

wordpress function to change post status

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
61 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
280 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
371 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
0answers
22 views

When click Update button all changes are lost

when I update the slider on my site's home page and click preview changes, I can see the changes. But when I click Update everything is lost. What causes this? How to solve this? Any suggestions will ...
0
votes
1answer
235 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
27 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
0answers
271 views

Programmatically schedule post with wp_update_post function

I schedule posts in a wp plugin (WP 3.8) with the following function. My posts seem to be in the correct status after scheduling them (when editing them, date time and status are good), and also after ...
0
votes
1answer
2k 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
986 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
104 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
112 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
27 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
42 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
79 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 ...
0
votes
2answers
817 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
120 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
101 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
446 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
339 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
318 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 ...
0
votes
1answer
328 views

Update Custom Taxonomy Value for a post based on custom date field

Quick read: I need to update the value of a custom taxonomy based on two custom field values (dates) automatically, meaning the post updates itself with having to click "update" to change the value. ...
0
votes
1answer
87 views

Update user from external script

I am using the API code of WordPress to update some fields of user profiles but I am having some problems. When I try to save information, it is not updating unless I click twice. For example for ...
1
vote
1answer
247 views

If modified on same day, show only time

I have a date on each post and comment which shows the date of placement. If I edit it, it shows me the date of the post and the modified date. That's fine, but now, I want to show only the post date ...
0
votes
1answer
61 views

wp_update_post making my post sticky

I am updating my post using below code: $post_information = array( 'ID' => $_REQUEST['ID'], 'post_content' => $_REQUEST['content'], 'post_status' => 'publish' ); ...
1
vote
1answer
531 views

SQL query to update post_date (one post = one single date & time)

I have 120 posts of one category ready for my wordpress blog. For the moment, posts are drafts and I don't want to schedule them manually. I want to publish them like this: 4 articles each day from ...
0
votes
1answer
668 views

Custom wp_editor doesn't update post_content

I'm working on a client's site, creating a staff profile plugin. The issue is that they previously created the profiles as regular posts. I converted all of the staff posts into a custom post types. ...
1
vote
1answer
286 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
1answer
1k views

Automatically fill custom field value on post publish/update

I've searched around a bit, and I'm having trouble finding an answer to this question. What I'm trying to do is automatically fill a custom field when a post (custom post type) is updated or ...
0
votes
0answers
220 views

Wordpress custom field being lost on wp_update_post, with a twist

I'm using wp_update_post to programmatically add a title and tags to posts from the front end. I'm running into a hair-tearing issue with custom fields in the process: one of the two custom fields ...
0
votes
1answer
248 views

Gravity forms and wp_update_post [closed]

I am using Gravity Forms to let users create posts. The user fills out a bunch of information, and a post is created. The user gets to choose which categories the post is in, but there is one more ...
2
votes
1answer
1k views

Problem with wp_update_post

I'm trying to write a plugin that creates a page if a box is checked (value 1) and if the post id doesn't already exist. If the post id does already exist, then I want to update the post with whatever ...
3
votes
1answer
155 views

Fill post titles from post content?

I imported over 1000 posts from a Tumblr gallery. All the posts are untitled, but each has a photo and name inside of the post. How do I make take the content of each post and make it the post name?
2
votes
1answer
984 views

Which action hook can I use when a featured image has been selected

I have made a plugin for wordpress which copies the image to another directory when a post has been edit. But if you only upload another featured image and don't save the post. The image has been ...
0
votes
1answer
88 views

How to keep a record of changes to a custom field?

I have a custom post type that hold real estate listings and I need to figure out a way to keep a record of the price of the property is listed for. For example a user lists a property for sale and ...
0
votes
1answer
400 views

The work of Wordpress Function update_post

I use wp_update_post() in a Frontend Page. The first part of the function works as expected. post_content and/or post_title will be changed in wp_posts. But the function does not create a revision ...
0
votes
1answer
800 views

wp_update_post is not updating category

I am using this custom function to add a publish/unpublish button to the front end of my site for the users: if ('draft' == get_post_status ($post_id)) { $post = ...
0
votes
1answer
466 views

How to use wp_update_post with ajax on frontend

I've been working hard trying to implement a frontend post editor "sidebar" on each post when I'm logged in. You can see what is going on here with a test post: ...