Hot answers tagged draft
12
Since a picture is worth a thousand words:
1) Click "Edit" next to "Publish Immediately"
2) Change the date
3) Click "OK"
10
It should be possible to add a button to the Publish box Save as changed copy. You have to hook into content_save_pre then and copy the content and all meta data into a new post with a draft status. After the review the posts have to be merged back.
I haven’t done this yet, but it is really needed.
7
Yes, as you - so far - have no publish date.
You could use $post->post_modified, which will always be the date of the latest modification to the post data.
Debug:
Try hooking into the filter and dump both vars:
function date_dump_callback( $date, $d )
{
echo '<pre>'; print_r( $date ); print_r( $d ); echo '</pre>';
return $date;
...
5
Hi @e100;
If you were interested in a custom plugin solution I can envision several approaches.
A process similar to what @toscho described as "Save as Changed Copy" but with some subtle differences. The plugin could lock editing of published posts but allow you to create derived posts with a new status like "Updated Draft" which could be tied back to the ...
4
I should start off by saying that linking to drafts will only work for logged in users (with appropriate permissions) - other users will simply hit a 404 Not Found!
You'd be much better off getting all your content ready & published, or only link to it once it is ready!
Nevertheless, to answer your question, to link to a draft simply enter the URL ...
3
I'm not sure why it is modifying the data like that when displaying, but you can use
$post->post_date_gmt
This will return the scheduled post date the same as it is in the DB except it's in GMT time format, so you might need to convert the time to your local time zone first (this blog post may help). Otherwise, you should be able to use it as is if ...
3
I rarely deal with cookies and not sure about complete mechanics there, but here is basic working example of passing current user's cookies to retrieve preview page source:
$preview_link = set_url_scheme( get_permalink( $post->ID ) );
$preview_link = esc_url( apply_filters( 'preview_post_link', add_query_arg( 'preview', 'true', $preview_link ) ) );
...
3
http://wordpress.org/extend/plugins/revisionary/
This plugin will do what you want. It creates a role Revisor that is kind of in between Contributor and Editor. The UI could be improved and the internal code had to work around a lot of WordPress' missing features, but yeah, this solves your problem: It will allow you to save a draft (actually a 'pending' ...
3
See: Writing Posts (emphasis added):
To schedule a post for publication on
a future time or date, click "Edit" in
the Publish area next to the words
"Publish immediately". You can also
change the publish date to a date in
the past to back-date posts. Change
the settings to the desired time and
date. You must also hit the "Publish"
button ...
3
Not at this time, unfortunately. If the page/post is already published, your only recourse would be to create a new page/post to hold your edits and privately publish it so your colleague can check your changes. Then replace the content on your live page/post with the revised version.
Just FYI: Making draft-status changes to already published content is a ...
2
Create a .php file in root of your WordPress directory and write:
<?php
require( 'wp-load.php' );
$urunler = array(
'order' => 'ASC',
'post_type' => 'urun',
'post_status' => null,
'numberposts' => -1,
);
$tumurunler = get_posts($urunler);
if ($tumurunler) {
foreach ($tumurunler as $urun) {
...
2
The get_posts method of WP_Query is what does the heavy lifting as far as getting the posts to display. Before it does anything, however, there's a hook called pre_get_posts that you can hook into. The hooked function will receive a reference (pointer) to the current query object. So you can change the query vars to be whatever you'd like.
So...
<?php
...
2
I recently was dealing with the exact same problem. I didn't solve it, and we decided that since people had to pay a relatively large sum for their listings that they would be sufficiently incented not to post bad stuff. Plus it would be a pain to manually approve each one -- people don't like waiting a day to get results.
So we gave our directory_member ...
2
Since editor displays projected permalink for slug editor, it must have some way to figure it out. From looking at source that is handled by get_sample_permalink_html() and get_sample_permalink().
Since we only need link without form cruft, we can rework it into something like:
function get_draft_permalink( $post_id ) {
require_once ABSPATH . ...
2
This is a little "hacky", but when you call get_permalink and you need the permalink from a draft, provide a clone of your post object with the details filled in:
global $post;
if (in_array($post->post_status, array('draft', 'pending', 'auto-draft'))) {
$my_post = clone $post;
$my_post->post_status = 'published';
$my_post->post_name = ...
1
This is very similar to this question.
We have to hook into check_ajax_referer to address the internal linking feature only. Then we register an action for pre_get_posts to extend the search to drafts and pending posts.
We will still get no pretty permalinks, because they are excluded in get_permalink. So we register a filter for that too and ask WordPress ...
1
Use the pre_get_posts action to alter the main query with meta_query arguments to only select posts with active current_status.
This example would work for your main posts page. See Conditional Tags for how to determine when other types of queries are run.
function wpa_current_status( $query ) {
if ( $query->is_home() && ...
1
You can use wp_update_post() to change the status of a post.
global $current_user;
get_currentuserinfo();
$post_id = $_GET['post_id'];
$the_post = get_post( $post_id );
if ( $the_post->post_author == $current_user->ID && $the_post ) {
$the_post->post_status = 'draft';
wp_update_post( $the_post );
}
Use wp_insert_post() with ...
1
WordPress has built in Revision Management.
You can set the saved revisions to a custom number in the wp-config.php file in your installation.
define( 'WP_POST_REVISIONS', 30 );
NOTE: You should be aware of the »autosave« mechanism, which also sets post revisions. So leaving a tab open for 1 hour with a Post Revision interval of 6minutes and a Revision ...
1
I have no idea what IFTTT is but you can use the save_post action hook to do a check for duplicate posts. This hook runs whenever a post is created or updated you would then be able to right your own code to check against existing posts.
http://codex.wordpress.org/Plugin_API/Action_Reference/save_post
1
I found Quick Review Post Access (Figure 1) which does the trick. It’s not perfect; I was hoping for the little circle, but this works just as well, and even better, it links directly to the page with non-drafts filtered out, making it even easier to keep track of and work with incomplete posts. It even works for pending and future posts as well.
It’s ...
1
You can hide them using CSS. Add this to the theme's functions.php file, or add a plug-in header to the top of the file and zip it up to use as a plug-in:
<?php
add_action('admin_print_styles', 'remove_this_stuff');
function remove_this_stuff() {
?>
<style>
#misc-publishing-actions, #minor-publishing-actions {
display:none;
}
...
1
try pasting this in your theme's functions.php file
add_filter( 'parse_query', 'display_autosave_and_revisions' );
function display_autosave_and_revisions( $query )
{
global $pagenow,$typenow;
if ( is_admin() && $pagenow == 'edit.php' && $typenow == "post") {
$query->query_vars['post_type'] = array('revision','post');
...
1
You probably need to modify the columns displayed in your Custom Post posts list, so that the list isn't dependent solely on Post Title.
I have a similar situation, with a Custom Post Type that consists solely of a "featured image" (and a "link" custom metabox). I modified the Post list to output the image, which linked to the edit-post page.
You may need ...
1
If by draft, you mean "autosave", you can consider using this plugin:
http://wordpress.org/extend/plugins/wp-feature-disable/
If you want to disable revisions, instead...try this:
define('WP_POST_REVISIONS', 'false');
You can put that in your /wp-config.php file and it should immediately take effect. Any previously saved revisions in your database will ...
1
a similar question was asked before, if you take a look here obviously for 1 column use 'post_status' => 'published' and for the other column call 'post_status' => 'draft' and set number of posts to show to 8 for each column
1
I'm posting this as another solution for you and its based on the page id
/*
$post_id - The ID of the post you'd like to change.
$status - The post status publish|pending|draft|private|static|object|attachment|inherit|future|trash.
*/
function change_post_status($post_id,$status){
$current_post = get_post( $post_id, 'ARRAY_A' );
...
1
There is now a very neat solution to this with a plugin Drafts of Post Revisions.
Users can be permitted to create a draft revision of a published post (or custom post type) which is created as a child copy of the post.
Drafts can be compared to its published parent via the compare revisions feature.
On publishing a draft revision, any changes are ...
Only top voted, non community-wiki answers of a minimum length are eligible
