The tag has no usage guidance.

learn more… | top users | synonyms

0
votes
0answers
20 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
13 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
28 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
53 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
33 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
21 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 ...
0
votes
1answer
46 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
12 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
44 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
25 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
38 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
17 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
26 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
1answer
44 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 ...
0
votes
0answers
297 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
62 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
33 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
35 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
43 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
112 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
15 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
34 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
22 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
59 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
78 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
455 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
101 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
81 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
138 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
249 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
79 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 &amp;. (I need to add plaintext URLs ...
0
votes
0answers
89 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
345 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
52 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
376 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
124 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
699 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
587 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 ...
1
vote
0answers
1k 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
83 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
410 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
122 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
449 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
84 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
179 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
170 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
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
127 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
120 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
86 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 ...