Questions tagged [publish]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
1k views

disable publish button until condition is not met

I currently wrote a plugins to customize my wordpress website. I surprisly find it easy to do many things with hook. Now I want to make author not be able to push publish button if no category is ...
0 votes
1 answer
59 views

using add_action without having custom plugin or theme

I need to send an email after an author publishes or updates a post. But I don't like developing custom plugin or theme. Is there any plugin that runs a php script after publish. Or where can I insert ...
0 votes
1 answer
62 views

How can I get the user that publishes a post?

I have multiple users. Some are writers, others are editors. Is there a way to get the editor (id) that publish the post? I am able to get the author id but the not the editor's id that publish the ...
0 votes
0 answers
97 views

problem with blank page

i have a real big problem with my wordpress website functions.php when i put the following code to achive post view and thumbnail. i'm getting the blank page error which when i publish or update a ...
2 votes
1 answer
1k views

How can I display a specific user's first published post?

I'm looking for a way to display a user's first published post using their unique ID. I have a function that calls a list of specific users using their IDs, and would like to display the date the ...
1 vote
1 answer
1k views

new_to_publish fires multiple times

i have been trying to use draft_to_publish & new_to_publish to create an update when ever a post of a specific type (cpt) is published... it works but published 600+ times instead of one time! ...
3 votes
3 answers
7k views

How to access the post meta of a post that has just been published?

I am using the hook publish_post to run my code where I need the post meta of the just published post. But the post meta value I am looking for is somehow not available at this point of execution. On ...
0 votes
3 answers
166 views

How to hook into publish_posttype?

I'm trying to hook into WordPress publish. The code below is what I'm using, but it doesn't appear to be running. I have it in a plugin file that I deactivate/reactivate each time I make changes (...
3 votes
2 answers
12k views

How to show an error message after publishing a post?

I'm using the transition_post_status hook to perform some operations after publishing a post. In some conditions I would like to show an error message in a red box under "Edit Post" and above "Post ...
4 votes
2 answers
7k views

How to limit user to publish post per day and per role?

I would like to know is there any way/Plugin to limit the user published post (in a given time span) by his role? Like this: Role A -> 1 post per day and 30 post total. Role B -> 10 post per ...
2 votes
2 answers
35k 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
2 answers
104 views

How to handle a post before publishing?

I want to do a regex match to each post before it gets published, and if the regex fails to match, delete the post entirely, what hook should I use?
14 votes
4 answers
2k views

How can I delay the publishing of a page or post?

Sometimes it would be nice to be able to set a draft to be published when I'm not in front of the keyboard. Is this possible? If so, how?
0 votes
2 answers
10k views

Post publish date [duplicate]

if I have more than one posts that publish in the same day, the_date() function does not print publish date. How can I fix it? thanks I solve this by: "the_time(get_option('date_format'));"
6 votes
2 answers
274 views

Is it possible to Schedule Attachments in Wordpress?

As it's fairly well known, it is possible to schedule Posts in Wordpress for publishing. Also Attachments are actually Posts (in the more internal, technical meaning). So the question that bothers ...
0 votes
1 answer
451 views

Updating User Meta from Custom Post Field Upon Publish Not Working

I'm trying to get the user_meta to be updated based on the custom post field type. However the information won't transfer if the new post is published by a user through a frontend form. Currently it ...
0 votes
1 answer
330 views

Publish a Silent Post without updating Feed

Is there a way to publish certain posts, silently without updating the feeds and those posts also should not appear in the home page. Appreciate your help.
0 votes
1 answer
74 views

I need to modify drafts using custom data from database and then publish it

First of all I'm still relatively new to programming and wordpress development. I'm building a plugin that takes custom data from database and a list of saved drafts and then modifies draft chosen ...
0 votes
2 answers
80 views

Unable to access wordpress login.php [closed]

I has been completed a theme for a client. I Used to access the live wp-admin page using http://name.myname.com/wp-login.php But that page shows just a blank(white) page. How to get fix that? Note:...
1 vote
1 answer
3k views

Notification to Admin or Author upon new post [duplicate]

I am using a custom function with 'publish_post' hook for a notification to the author when the post has been published but the issue I am facing right now is that the notification is being sent out ...
0 votes
1 answer
212 views

How to edit wordpress post without republishing

Is there a way to update an older post without republishing the post? If I am looking at a previously published post and discover a misplaced comma or reformat an image I don't need all my RSS and ...
0 votes
0 answers
125 views

Adding a Custom 'Now' button under 'Published on' header to return current date and time

I want to add a new 'Now' button under the 'Published on' header so as to return the current date and time to the post update time. This would help people who want to update their post with a recent ...
0 votes
1 answer
133 views

How can my plugin display a populated new post window

I've written a plugin that creates a feed reader like google reader in wordpress. Currently I let folks reblog feed items by using the built in WP PressThis plugin url. I pass in parameters and WP ...
0 votes
1 answer
117 views

Change event firing in wordpress

I have to run a function when a post is published. The function checks a custom meta value and works accordingly. I am using couple of hooks for this purpose: new_to_publish draft_to_publish ...
0 votes
1 answer
49 views

Tracing dashboard publish settings from input form in WordPress

I need to replicate a plugin's input form from the dashboard and make it available to the public so that they can enter data directly to the DB rather than using a form that is emailed and then ...
0 votes
1 answer
515 views

Custom Meta Box Causing Error: "Are you sure you want to do this? Please try again."

My custom post type have a meta box that is listing another custom post types in its meta box. And it is causing error each time I try to publish a post with that custom post type. It is always bring ...
1 vote
1 answer
554 views

Publish Post After Click On A Link

I have a frontend posting form (CF7), where user inputs (among other data of course) his email. Now I set the status to pending. What I want is, that the user would get trough autoresponder a mail, ...
1 vote
0 answers
50 views

Controlled publishing in Wordpress

We are currently rebuilding our corporate website and I'm looking for a way to control the publishing of pages. The flow to create or amend pages would be something like this: 1) New page is built or ...
0 votes
2 answers
365 views

check if a draft has been moved there from publish to draft

I am writing a plugin, part of the functionality does functions on hook: publish_to_draft I then later want to re-publish that post and trigger specific functionality to see if it has previously been ...
0 votes
1 answer
2k views

do more action after I publish a post

I am using wordpress3.5, I need to write post information to a file after I publish a post successfully. What I am not know is When I click Publish button, what function wordpress invoke to save the ...
9 votes
2 answers
366 views

How to prevent posts from being published too close to each other?

I manage a blog which consists of about 25 writers. Sometimes a few of them are in the process of writing a new post at once, and they end up publishing them too close to each other. Is there a way ...
0 votes
2 answers
339 views

How to add correct Last update in Postings (the_modified_time)

Having little issue with following: We want to add "Last update" after making important corrections or additional text/images to existing Postings. Using following code (hardcoded) does in a way ...
4 votes
1 answer
5k views

Post publish only hook?

Is there any hook which is fired only when the post is "published" for the first time. I dont want to execute my code when the post is "updated" or when its status is set to "not-published" and then ...
0 votes
1 answer
236 views

an action hook when a post reaches a certain number of views

I am using WP Post Views plugin to display the post number of views. I use: <?php if(function_exists('the_views')) { the_views(); } ?> I am creating a badge system for my wordpress site. My ...
0 votes
1 answer
2k views

How to display and use all existing tags at my write-post-at-frontend-panel?

I can write and publish posts from my frontend - everything is fine. You know the backend: write-post-style, right? There it lists all existing tags. How can I display all existing tags at frontend ...
5 votes
2 answers
8k views

How can I make post fields required in Wordpress?

I am setting up a Wordpress site as a CMS and trying to figure out a way to make certain post fields "required" before an author can publish a post. In particular, I want authors to be required to ...
4 votes
1 answer
2k views

How to add a "publish" link to the quick actions

I'm trying to add a "Publish" link by the quick actions: but I'm not exactly sure of how implement it. Here's what I've got so far: add_filter('post_row_actions', function ( $actions ) { global ...
1 vote
1 answer
1k views

Update post meta on bulk edit / update

I have a small problem with a code that works most of the time. I just discovered it cannot be used when I bulk edit custom post type. If I'm on individual post page and hit publish, the custom post ...
0 votes
2 answers
339 views

How to show or hide a post based on meta_value selection?

How would I go about hiding a post based on a meta_value selection done on the back end. The usual method is to just change the post status from Publish to Draft however, I want this to work based on ...
0 votes
2 answers
146 views

I want my post to republish again after adding a custom field

I wanted a code in Wordpress that could allow me to republish the post every time I add a new custom field. For example, if I already have a post and wanted to add an update to it; I want it to appear ...
1 vote
2 answers
224 views

Make the Status, Visibility, or Date fields opened by default in the Publish box

By default, the Status, Visibility, and Date fields in the Publish metabox are closed, and you have to click Edit to show them. Is there a way to make these fields visible by default? The hidden ...
1 vote
2 answers
1k views

Auto Publish On Cron

I have some 100 unpublished posts. I want to publish 1 random post every time a cron is run. Is there a way or plugin to achieve this...
0 votes
1 answer
12k views

Force Publish Future (Scheduled) Posts Immediately [duplicate]

I am trying to force publish 'future' or 'scheduled' posts, and I am having trouble The reason I am asking is because I am creating a site that allows users to do the editing on the front of the site,...
0 votes
3 answers
557 views

Default pages to be unpublished - possible?

Is it possible to change the default status of every new page created to be "unpublished"? We want to have someone help us add pages to a site, but not have them show up by default until it is (all ...
0 votes
1 answer
215 views

Showing the next post's title, even if it's an unpublished post

At the bottom of each post I need to either: Offer a link to the next post (if the next post is published); or Display the title of the next post with the date it will be published (if it's a future ...
4 votes
2 answers
4k views

How can I add a jQuery OnClick event to the Publish posts button?

I want to add a simple confirmation event to the Publish posts button, so when my client hits "Publish" it will ask him if he's sure, to which he clicks "Yes" or "cancel" and the post then publishes ...
0 votes
1 answer
115 views

Plugin that generates a page of post content

My script is generating a duplicate post even after I explicitly state that the post_type should be a page. It also ignores the $post_title, which I do not want to create a duplicate post if the title ...
1 vote
1 answer
3k views

publish_post action hook not working

I've got a really simple problem here, and i'm sure that the solution is going to be really simple. Here is the code: function the_fat_lady_sings() { echo 'this plugin is a far harder than i ...
2 votes
2 answers
3k views

get_terms on save_post hook

Usually, if I want to check for some attribute of the post I'm about to publish, I will check like this: $post_title = $_POST['post_title']; post_title is the name of the title field in the edit ...
0 votes
1 answer
128 views

i am making text changes on my page show in preview not on live site, why? [closed]

I go into the admin back room on my site make text changes and hit preview changes and they show up, but when i go to the live site, they don't show at all. What am i missing, what should i be doing?