It looks like someone else requested this at https://www.ads-software.com/support/topic/archive-date-and-time/, but the topic was closed.
It would be great to be able to set a specific time for archiving content.
It looks like your cron job runs once an hour, so maybe the plugin would to do something like create a custom cron job for each post when an archive date is set, maybe called {postID}_archive_scheduled. That cron job would be set to run at the date and time and then delete itself after archiving the related post (to keep things tidy.)
Hi,
please find my patch attached, which makes all __()
, _x()
, _n_noop()
, and _e()
translatable by replacing some wrongfully placed self::return_plugin_namespace()
with self::return_plugin_text_domain()
.
Please also consider to check out the translations waiting for approval at https://translate.www.ads-software.com/projects/wp-plugins/lh-archived-post-status/dev/de/default/.
Index: lh-archived-post-status.php
===================================================================
--- lh-archived-post-status.php (revision 3236713)
+++ lh-archived-post-status.php (working copy)
@@ -339,7 +339,7 @@ class LH_archived_post_status_plugin {
if (empty($date)){
- _e( 'Never', self::return_plugin_namespace());
+ _e( 'Never', self::return_plugin_text_domain());
} else {
@@ -432,8 +432,8 @@ class LH_archived_post_status_plugin {
}
?><select name="<?php echo self::return_opt_name().'['.$args[0].']'; ?>" id="<?php echo self::return_publicly_available(); ?>"><?php
- ?><option value="1" <?php if ($selected == 1){ echo 'selected="selected"'; } ?>><?php _e('Yes - But not in the, main loop, frontpage, or feed', self::return_plugin_namespace()); ?></option><?php
- ?><option value="0" <?php if ($selected == 0){ echo 'selected="selected"'; } ?>><?php _e('No - only logged in users can view archived posts', self::return_plugin_namespace()); ?></option><?php
+ ?><option value="1" <?php if ($selected == 1){ echo 'selected="selected"'; } ?>><?php _e('Yes - But not in the, main loop, frontpage, or feed', self::return_plugin_text_domain()); ?></option><?php
+ ?><option value="0" <?php if ($selected == 0){ echo 'selected="selected"'; } ?>><?php _e('No - only logged in users can view archived posts', self::return_plugin_text_domain()); ?></option><?php
echo '</select>'."\n";
}
@@ -452,7 +452,7 @@ class LH_archived_post_status_plugin {
}
- echo '<input type="text" name="'.self::return_opt_name().'['.$args[0].']" id="'.$args[0].'" value="'.$value.'" size="20" /><br/>'.__('This label will appear after the title for archived posts on the front end of your website', self::return_plugin_namespace())."\n";
+ echo '<input type="text" name="'.self::return_opt_name().'['.$args[0].']" id="'.$args[0].'" value="'.$value.'" size="20" /><br/>'.__('This label will appear after the title for archived posts on the front end of your website', self::return_plugin_text_domain())."\n";
}
@@ -498,7 +498,7 @@ class LH_archived_post_status_plugin {
add_settings_field( // Option 1
self::return_publicly_available(), // Option ID
- __('Can Archived Posts be read publicly:', self::return_plugin_namespace()), // Label
+ __('Can Archived Posts be read publicly:', self::return_plugin_text_domain()), // Label
array($this, 'render_publicly_dropdown'), // !important - This is where the args go!
'reading', // Page it will be displayed (General Settings)
self::return_opt_name(), // Name of our section
@@ -511,7 +511,7 @@ class LH_archived_post_status_plugin {
add_settings_field( // Option 2
self::return_title_label_field_name(), // Option ID
- __('Title Label:', self::return_plugin_namespace()), // Label
+ __('Title Label:', self::return_plugin_text_domain()), // Label
array($this, 'render_title_label_input'), // !important - This is where the args go!
'reading', // Page it will be displayed (General Settings)
self::return_opt_name(), // Name of our section
@@ -522,7 +522,7 @@ class LH_archived_post_status_plugin {
add_settings_field( // Option 3
self::return_message_field_name(), // Option ID
- __('Archive Message:', self::return_plugin_namespace()), // Label
+ __('Archive Message:', self::return_plugin_text_domain()), // Label
array($this, 'render_message_editor'), // !important - This is where the args go!
'reading', // Page it will be displayed (General Settings)
self::return_opt_name(), // Name of our section
@@ -536,7 +536,7 @@ class LH_archived_post_status_plugin {
add_settings_section(
self::return_opt_name(), // Section ID
- __('Archiving Settings', self::return_plugin_namespace()), // Section Title
+ __('Archiving Settings', self::return_plugin_text_domain()), // Section Title
array($this, 'reading_setting_callback'), // Callback
'reading' // What Page? This makes the section show up on the General Settings Page
);
@@ -630,7 +630,7 @@ class LH_archived_post_status_plugin {
if ( current_user_can('publish_posts') ) {
- $actions['archive_link'] = '<a href="'.self::get_archive_post_link($post->ID).'" title="' . esc_attr( __( 'Archive this post' , self::return_plugin_namespace()) ) . '">' . __( 'Archive', self::return_plugin_namespace() ) . '</a>';
+ $actions['archive_link'] = '<a href="'.self::get_archive_post_link($post->ID).'" title="' . esc_attr( __( 'Archive this post' , self::return_plugin_text_domain()) ) . '">' . __( 'Archive', self::return_plugin_text_domain() ) . '</a>';
}
@@ -658,7 +658,7 @@ class LH_archived_post_status_plugin {
if (!get_post_status($post_id)){
- echo __('invalid post id', self::return_plugin_namespace());
+ echo __('invalid post id', self::return_plugin_text_domain());
exit;
}
@@ -666,7 +666,7 @@ class LH_archived_post_status_plugin {
if ( ! current_user_can( 'edit_post', $post_id ) ) {
- echo __('Current user does not have capability', self::return_plugin_namespace());
+ echo __('Current user does not have capability', self::return_plugin_text_domain());
exit;
@@ -782,7 +782,7 @@ class LH_archived_post_status_plugin {
if (!get_option(self::return_opt_name())){
$options[ self::return_publicly_available() ] = true;
- $options[ self::return_message_field_name() ] = '<p>'.__('This content has been archived. It may no longer be relevant', self::return_plugin_namespace()).'</p>';
+ $options[ self::return_message_field_name() ] = '<p>'.__('This content has been archived. It may no longer be relevant', self::return_plugin_text_domain()).'</p>';
update_option( self::return_opt_name(), $options );
@@ -905,7 +905,7 @@ class LH_archived_post_status_plugin {
if ($url = self::get_archive_post_link( $post_object->ID )){
- $string .= "\n".'<li><a rel="nofollow" href="'.$url.'">'.__('Archive', self::return_plugin_namespace()).'</a></li>';
+ $string .= "\n".'<li><a rel="nofollow" href="'.$url.'">'.__('Archive', self::return_plugin_text_domain()).'</a></li>';
}
@@ -928,9 +928,9 @@ class LH_archived_post_status_plugin {
}
$args = array(
- 'label' => _x( ucwords(self::return_new_status_label()), 'post status label', self::return_plugin_namespace() ),
+ 'label' => _x( ucwords(self::return_new_status_label()), 'post status label', self::return_plugin_text_domain() ),
'public' => $public,
- 'label_count' => _n_noop( self::return_new_status_count(), self::return_new_status_count(), self::return_plugin_namespace() ),
+ 'label_count' => _n_noop( self::return_new_status_count(), self::return_new_status_count(), self::return_plugin_text_domain() ),
'post_type' => self::get_applicable_post_types(), // Define one or more post types the status can be applied to.
'show_in_admin_all_list' => true,
'show_in_admin_status_list' => true,
@@ -939,17 +939,17 @@ class LH_archived_post_status_plugin {
'publicly_queryable' => true,
'dashicon' => 'dashicons-archive',
'labels' => array(
- 'metabox_dropdown' => __( 'Archived', self::return_plugin_namespace() ),
- 'metabox_submit' => __( 'Archive', self::return_plugin_namespace()),
- 'metabox_save_on' => __( 'Archive on:', self::return_plugin_namespace() ),
+ 'metabox_dropdown' => __( 'Archived', self::return_plugin_text_domain() ),
+ 'metabox_submit' => __( 'Archive', self::return_plugin_text_domain()),
+ 'metabox_save_on' => __( 'Archive on:', self::return_plugin_text_domain() ),
/* translators: Post date information. 1: Date on which the post is to be archived */
- 'metabox_save_date' => __( 'Archive on: <b>%1$s</b>', self::return_plugin_namespace() ),
- 'metabox_saved_on' => __( 'Archived on:', self::return_plugin_namespace() ),
+ 'metabox_save_date' => __( 'Archive on: <b>%1$s</b>', self::return_plugin_text_domain() ),
+ 'metabox_saved_on' => __( 'Archived on:', self::return_plugin_text_domain() ),
/* translators: Post date information. 1: Date on which the post was archived */
- 'metabox_saved_date' => __( 'Archived on: <b>%1$s</b>', self::return_plugin_namespace()),
- 'metabox_save_now' => __( 'Archive <b>now</b>', self::return_plugin_namespace() ),
- 'inline_dropdown' => __( 'Archived', self::return_plugin_namespace() ),
- 'press_this_dropdown' => __( 'Add to archives', self::return_plugin_namespace() ),
+ 'metabox_saved_date' => __( 'Archived on: <b>%1$s</b>', self::return_plugin_text_domain()),
+ 'metabox_save_now' => __( 'Archive <b>now</b>', self::return_plugin_text_domain() ),
+ 'inline_dropdown' => __( 'Archived', self::return_plugin_text_domain() ),
+ 'press_this_dropdown' => __( 'Add to archives', self::return_plugin_text_domain() ),
),
);
@@ -1211,9 +1211,6 @@ class LH_archived_post_status_plugin {
}
-
-
-
public function __construct() {
//create the archived custom post status
@@ -1222,7 +1219,6 @@ class LH_archived_post_status_plugin {
//try to run everything on plugins loaded
add_action( 'plugins_loaded', array($this,'plugin_init'), 1000, 1);
-
}
Index: partials/option-settings.php
===================================================================
--- partials/option-settings.php (revision 3236713)
+++ partials/option-settings.php (working copy)
@@ -3,7 +3,7 @@
<?php wp_nonce_field( self::return_plugin_namespace()."-nonce", self::return_plugin_namespace()."-nonce", false ); ?>
<table class="form-table">
<tr valign="top">
-<th scope="row"><label for="<?php echo self::return_publicly_available(); ?>"><?php _e("Can Archived Posts be read publicly:", self::return_plugin_namespace()); ?></label></th>
+<th scope="row"><label for="<?php echo self::return_publicly_available(); ?>"><?php _e("Can Archived Posts be read publicly:", self::return_plugin_text_domain()); ?></label></th>
<td><select name="<?php echo self::return_publicly_available(); ?>" id="<?php echo self::return_publicly_available(); ?>">
<option value="1" <?php if ($options[self::return_publicly_available()] == 1){ echo 'selected="selected"'; } ?>>Yes - But not in the, main loop, frontpage, or feed</option>
<option value="0" <?php if ($options[self::return_publicly_available()] == 0){ echo 'selected="selected"';} ?>>No - only logged in users can view archived posts</option>
@@ -11,15 +11,15 @@
</td>
</tr>
<tr valign="top">
-<th scope="row"><label for="<?php echo self::return_title_label_field_name(); ?>"><?php _e("Title Label:", self::return_plugin_namespace()); ?></label>
+<th scope="row"><label for="<?php echo self::return_title_label_field_name(); ?>"><?php _e("Title Label:", self::return_plugin_text_domain()); ?></label>
</th>
-<td><input type="text" name="<?php echo self::return_title_label_field_name(); ?>" id="<?php echo self::return_title_label_field_name(); ?>" value="<?php echo $options[self::return_title_label_field_name()] ; ?>" size="20" /><br/><?php _e("This label will appear after the title for archived posts on the front end of your website", self::return_plugin_namespace()); ?>
+<td><input type="text" name="<?php echo self::return_title_label_field_name(); ?>" id="<?php echo self::return_title_label_field_name(); ?>" value="<?php echo $options[self::return_title_label_field_name()] ; ?>" size="20" /><br/><?php _e("This label will appear after the title for archived posts on the front end of your website", self::return_plugin_text_domain()); ?>
</td>
</tr>
<tr valign="top">
-<th scope="row"><label for="<?php echo self::return_message_field_name(); ?>"><?php _e("Archive Message:", self::return_plugin_namespace()); ?></label></th>
+<th scope="row"><label for="<?php echo self::return_message_field_name(); ?>"><?php _e("Archive Message:", self::return_plugin_text_domain()); ?></label></th>
<td>
<?php
$settings = array( 'media_buttons' => false );
]]>
I installed as instructed. The option to Archive does show under each post. I click on it and it opens a blank page with a 0 on the upper left corner.
Contacted Peter direct but no response now for a few weeks.
This would be a great tool, only if it would work.
Thanks, poleroad
]]>This Plug-in is great! We have just one issue, though.
On installing the Plug-in it replaces the usual Status field in the Post Editor and replaces it with the STATUS drop list, the issue is that the usual Status field also contained options to make the Post Sticky. This option does not appear in the new drop list and this makes it difficult to apply the Sticky status.
Any suggestions?
Thanks,
Colin
]]>I’ve logged out, deleted cache, checked for possible conflicting plugins (I have very few and none that deal with the loop).
The theme is basic and uses Gutenberg. I’ve looked at the template, and there are no weird queries. I even deleted the query block and started from scratch.
The plugin settings are default. I haven’t changed a thing.
…. Wow. Am I missing something that isn’t in the documentation (lol)? Should we deactivate the plugin after archiving the pages/posts we want? Because in the process of deactivating and activating all the plugins, the only one that I found conflicting with LH Archived Post Status was LH Archived Post Status! Yes, it appears the plugin is conflicting with itself. I deactivated LH Archived Post Status, and the archived posts disappeared from the front page. I activated LH Archived Post Status, and all the posts appeared again.
Now what?
]]>Hi there,
After the installation of your plugin, our FAQs posts from the Avada theme doesn`t have the possibility anymore to set the status on “password protected”. This is actually not really nice. Can you please fix this? Avada is a big theme, so it would be nice if it works.
]]>I have had to deactivate the plugin. I had archived a product and wanted to publish it again – which worked for a few minutes and then the product vanished from my store. I went back and found it listed as archived (again) with the original archive date. I carefully published it again and checked to be sure it was in the store and then an hour later it vanished again. I’ve published it a 3rd time and turned off the plugin. I noticed I have 2 archive categoris – which seems odd. Is there a fix?
]]>Hi
I have discovered that this plugin is conflicting with @tangibleinc ‘s Loops & Logic – https://www.ads-software.com/plugins/tangible-loops-and-logic/.
It is causing the Publish screen element on the Edit Template screen to disappear. If I deactivate your plugin the Publish box reappears.
Can you provide a fix for this please?
thanks
]]>Hi there!
I’ve installed this plugin to my WordPress blog (version 6.5.5) and faced two problems:
What can cause the problem and how can I fix it?
(I also run the Unlist Posts & Pages plugin in my blog)
]]>Hi,
I’ve noticed that when this plugin is activated, within each page/post, the visibility of all posts is set to “Private”, and then underneath it says its status is “Published publicly” (or “Archived” depending on what you choose…). See: https://imgur.com/a/8sMZYBU
I tried switching the Visibility from “Private” to “Public” but it reverts back to “Private”. If I deactivate the plugin, this issue is gone.
Now, the posts are not really “private”, I do see the posts when logged out, but it’s a bit confusing. Also, since the post visibility seems to be set to Private, the SEO framework plugin thinks the posts are private and puts its default index setting to “Default (noindex)”. Again, they’re not really not indexed, but this is confusing and is based on the “Private” setting that seems to come from this plugin.
Is there a way to keep the default posts visibility to “Public” instead of “Private” while this plugin is activated?
Thanks!
Hello! Great plugin, exactly what I need.
I have one question: I have a bilingual site, and I’m using WPML, but I’m just having a hard time translating the Archive Message. I scanned the plugin, but the string does not appear in WPML to translate it. Is this field not translation-ready? Is there something I can do at my end to fix this?
Thanks!
Setting a post to Archive makes it disappear from main loop, e.g. in front page, and that’s ok. But the post disappears also from the archive pages, and that does no seem to be correct, Am I missing something obvious?
]]>First I want to say that I am using this plugin and it works well with no problems at this time.
Yet, I do believe others need to know about one short-coming this plugin has.
I have tried other plugins that perform this same function of creating custom statuses for posts or pages. Each of them, and this plugin here, all suffer the same problem or short-coming.
That short-coming is when the plugin is deactivated for any reason or if someone deletes the plugin without being aware of this issue, all posts or pages that are set to a custom status will disappear from the Admin area.
Those pages or posts will not be retrievable unless their status is changed back to any one of the default statuses given by WordPress, and there are only two ways to do this.
So this is more a FYI post about it so people need to be aware of this issue any time they change, remove or deactivate this plugin.
]]>Hi
Is there any way to change it so that posts are archived on the date defined rather than after? I know the user could just set the date to the day before however logically for my use case the date selected would ideally be the date the post is archived.
Thank you
]]>I want to keep older posts/pages out of WP search results – but I also want them not to appear in Google search, does that work? I understand the WP search would recognize ‘archived’ status but maybe not Google?
]]>The Archive Link in Posts page has broken once again (sorry). Selecting the archive option takes you to a blank page with a zero top left. and the archive action fails.
I’m on WordPress Version 6.4.2
]]>Since a few weeks the plugin does not set archive status when archive date set is reached. The end user is now manually setting the archive status. No other settings have been changed.. Please let me know what might be the issue.
]]>Hi There,
The Plugin Description Says.
Content can either be hidden entirely from public view or simply from the main loop and feed and pages
How Do I Do That?
I Can Only See The Archive Option On The Post. I Assume That That Hides It In The Backend.
I Just Want To Remove It From The Main Loop And Leave It In The Archive.
]]>The plugin description says “Allows you to set an archiving date after which content is automatically changed to having an archived status”
I don’t see any setting under Settings -> Reading to set this, can you please explain how to set this up?
Once it is set up, will it automatically archive existing posts that fall into the date category?
]]>I see the “Archive” option on my page list but when I select it nothing happens – the Archive Date does not appear. I notice it has been 11 months since the last update and it isuntested with current WordPress. Is this plugin still supported. I really need this feature as my client pages should be archived in years they are not working with me but reactivated when they come back and I have a lot of change each year.
]]>After activating this plugin I cannot access WP Give plugin admin listing page. It shows this error.
Fatal error: Uncaught Error: Call to undefined method stdClass::is_builtin() in /home/yiplne5/creaworld.yipl.net/wp-content/plugins/lh-archived-post-status/includes/wp-statuses/inc/core/functions.php:395 Stack trace: #0 /home/yiplne5/creaworld.yipl.net/wp-content/plugins/lh-archived-post-status/includes/wp-statuses/inc/core/functions.php(412): wp_statuses_get_customs() #1 /home/yiplne5/creaworld.yipl.net/wp-content/plugins/lh-archived-post-status/includes/wp-statuses/inc/core/functions.php(501): wp_statuses_get_customs_post_types() #2 /home/yiplne5/creaworld.yipl.net/wp-includes/class-wp-hook.php(310): wp_statuses_register_post_types_field(Object(WP_REST_Server)) #3 /home/yiplne5/creaworld.yipl.net/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters(NULL, Array) #4 /home/yiplne5/creaworld.yipl.net/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #5 /home/yiplne5/creaworld.yipl.net/wp-includes/rest-api.php(587): do_action('rest_api_init', Object(WP_REST_Server)) #6 /home/yiplne5/creaworld.yipl.net/wp-includes/ in /home/yiplne5/creaworld.yipl.net/wp-content/plugins/lh-archived-post-status/includes/wp-statuses/inc/core/functions.php on line 395
]]>
Hello there,
Your plugin has been working very well so far, but with one of the latest updates, it seems to be conflicting with another plugin we have installed: WP Job Openings. The issue is that we can’t change the status of the applicants anymore. Whenever we click on “Save,” the applicant status goes back to “New.”
Thank you so much for looking into this in advance!!
Best regards,
]]>Greetings – We have your plugin installed. We can select the archive status, but it still shows up in search, etc. We want to pull visibility from search engines but hang on to the posts (just in case).
Your documentation says you can select that in Settings>LH Archived Posts but we don’t have the option in our Settings menu.
Are there certain types of plugins that might typically conflict? We are running WP 6.3.1 and LH plugin version 3.06.
]]>A client of mine reached out earlier today as the Publish module was gone on the Soliloquy Slider editor. I pinpointed the issue to the LH Archived Post Status plugin which they installed a few months ago. Thoughts? Thanks!
]]>I wanted to remove the archived status from the 1,442 posts currently archived. When I archived them, I used the bulk edit feature to change the status to archived. Now when I use bulk edit on the archived posts, there is no status option available. I started publicly publishing them one by one yesterday and got through 10. Today those posts are archived again. I published them again one by one and a few hours later, they’re archived again. I can’t delete the plug-in because then I lose access to those posts. I can’t edit the status in bulk, so have to do it1,445 times,, but they keep reverting back. Please help! There has to be an easier way to publish them all at once, then maybe delete the plug-in before they archive again?
]]>Is there a way to make archived posts still show up in the category and tag archives? I ask because a lot of my tags now show as having 0 posts even though there are a lot of posts with that tag, they are just archived? Google Adsense brought to my attention the number of empty tag pages on my site. For instance 2020 election has a lot of posts in it, but shows as having zero because the posts are archived. I don’t want archived posts showing on the front page, but I want people to be able to find them in search results and on archive pages; taxonomy and date. Is this possible?
]]>I’ve been using the plugin for months now. My site is news content, so it gets stale quickly. I set posts to archived status every 1-2 months, starting in January. I have the plugin set to only allow members to view archived posts. Maybe that’s the issue? I use the archive widget at a dropdown in my sidebar, but only the last 2 months are showing, destroying it’s purpose, which us to view archived content. Can you please help me figure out if it’s the plugin causing this? Or WordPress? And if it’s WordPress, how can I easily allow members to view archived news?
]]>Hi,
I previously archived many posts on the url above using the archive plug in and it has been working well for several months. However, today the archived posts are showing again in the main feed. Can you please advise?
Thank you!
]]>This is probably a stupid question but will archived pages also no longer be visible to search engine robots? They will ‘think’ the page has been deleted?
thanks
]]>Thanks for a great plugin. The only function I miss is a opportunity to set both archive date and time. But this is an important function, in my opinion. So I would like to add this to the wish-list. ??
]]>