The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
0answers
17 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
18 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
47 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
18 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
20 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
1answer
35 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
31 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
0answers
43 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
52 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
154 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
121 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
244 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
31 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
59 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
165 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
76 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
257 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
68 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
78 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
120 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
90 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
101 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
73 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
223 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
708 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
89 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
423 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
501 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
312 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
29 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
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
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
128 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
136 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
30 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
44 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
96 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
1k 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
144 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
112 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
638 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
409 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
387 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
416 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
109 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
298 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
69 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
639 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
841 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. ...