[display-posts post_status=”archived”]
It returns the archived post but also shows the ones that are published and not archived. How do I eliminate showing the public ones and only show archived?
]]>After further investigations, I found 2 more orders (out of 500+) with a similar issue.
What could have caused the DB entry to be written incorrectly?
]]>Display Posts suggests that a shortcode of [display-posts post_status=”archive”] should return only those with that status but in fact I get all posts returned.
I can use a custom post type like [display-posts post_status=”archive” post_type=”news” ] and get all the ‘news’ posts but still not filter by ‘archive’
So is post_status working or not, please?
]]>
'post_status' => array('publish','draft','trash')
Unable to search for pages with ‘private’ post_status.
]]>Is there a parameter for showing only published events? I’ve tried using ‘post_status’ => ‘publish’, but it doesn’t seem to take that parameter.
Seems silly that by default the tribe_get_events() would show events regardless of post status, or am I missing something?
Edit: sorry, just realized someone else had changed the status to published when I was investigating, so that’s why it’s showing. You can delete this thread, admin!
]]>Everything works fine, except one thing: According to this code snippet
https://broadcast.plainviewplugins.com/snippet/change-post-status-during-broadcast/
I would like to change the child posts’ status to “draft”. But the action hook “threewp_broadcast_broadcasting_started” seems to be ignored. Is this example still up to date?
Thanks for a hint in the right direction!
]]>there are 19 post from post type wc_user_membership
withe the folloing post statuses > 1 null 2 public 16 wcm-active
I use the follow arguments
$args = array(
'numberposts' => -1,
'post_type' => 'wc_user_membership',
'post_status' => 'auto-draft',
);
$posts = get_posts( $args );
return all 19 post
$args = array(
'numberposts' => -1,
'post_type' => 'wc_user_membership',
'post_status' => 'publish',
);
$posts = get_posts( $args );
return 2 posts
$args = array(
'numberposts' => -1,
'post_type' => 'wc_user_membership',
'post_status' => 'wcm-active',
);
$posts = get_posts( $args );
return all 19 post`
I make test also with post and pages, arguments works only when ‘post_status’ => ‘publish’
I working on WP multisite and I use before the code switch_to_blog( 2 ) and after restore_current_blog(), but even is I don’t use it and visit the blog #2 I receive the same result.
Thanks
(edit)
I try also WP_Query() with same results, seems like cannot recognize non default post statues
the php code I wrote have the following tasks:
the first code has the task of showing a list of dynamically generated years based on the creation date of the archived posts.
the second code will have the task of displaying a list of archived posts based on the previous year chosen by the user in the previous list of archived posts divided by year (post creation year).
That said, the problem is the following:
The page that has the task of displaying a list of posts archived based on the chosen year (according to PHP code) does not work if the year chosen in the query is before or after 2021 (therefore 2022, 2020 and so on), showing the following PHP error appears on the screen:
“Warning: Attempt to read property” post_status “on null in C: \ xampp \ htdocs \ wordpress \ wp-content \ plugins \ lh-archived-post-status \ lh-archived-post-status.php on line 512”
And under this WordPress says that the page was not found.
the error is written twice. going to view the source code of the plugin I see no problems …
screen:https://gyazo.com/79621874e8bf18c89cbb0a876f81c11f
I checked the mysql database and comparing the posts archived for year 2021 and those with different year like 2022 or 2020, where the problem is present, there is no data difference except rightly the creation date that I manually changed from wordpress / mysql. I also checked the plugin settings later but I don’t notice any problems. The other strange thing is that the archived post is not viewable through a query but if I click on the “view” link within wordpress in the post section, it is correctly displayed on the page.
the PHP codes are as follows:
code 1: https://gyazo.com/0fae2bf66a01189e820e4901c1eaeea3
code 2: https://gyazo.com/b333594c479476a269d24a859973942a
I hope I made the idea as clear as possible, thank you very much in advance!
EDIT: I forgot to mention that the plugin is broken… if I remember good your plugin should be able to manage the archiving date, but somehow i cant add or change that parameter from wordpress options, both in posts edit options and plugin options.
To do that i installed another plugin called “Post Expirator”, that let me activate the expiration date via post options and then specify the date and more options are available in the plugins settings.
I’ve seen this exact same issue here several times, and it seems to have always been closed with no solution. I can tell you that we do not have any custom product types.
Here is the error:
Trying to get property ‘post_status’ of non-object in [path to root]/wp-content/plugins/facebook-for-woocommerce/includes/fbproductfeed.php on line 456
]]>“Warning: Undefined property: stdClass::$post_status in C:\xampp\htdocs\*mywordpresssitefolder*\wp-admin\includes\misc.php on line 1433”
The if statement including the function wherein $post_status is found goes like this:
if ( $switched_locale ) {
restore_previous_locale();
}
}
/**
* Appends ‘(Draft)’ to draft page titles in the privacy page dropdown
* so that unpublished content is obvious.
*
* @since 4.9.8
* @access private
*
* @param string $title Page title.
* @param WP_Post $page Page data object.
* @return string Page title.
*/
function _wp_privacy_settings_filter_draft_page_titles( $title, $page ) {
if ( ‘draft’ === $page->post_status && ‘privacy’ === get_current_screen()->id ) {
/* translators: %s: Page title. */
$title = sprintf( __( ‘%s (Draft)’ ), $title );
}
return $title;
}.
post_status is not found anywhere else in the document.
I am not very good at php and really not sure what to do, so please help