WordPress.org

Ready to get started?Download WordPress

Forums

Post Expirator
Notices & Site Breaking (3 posts)

  1. Travis Smith
    Member
    Posted 2 years ago #

    In a multisite installation, the plugin generated 348 characters of unexpected output during activation on a single site.

    Also with WP_DEBUG, on the post-new screen, it generated this notice:
    Notice: Undefined variable: enabled in /HOME/USERNAME/public_html/wp-content/plugins/post-expirator/post-expirator.php on line 196

    When I try to save a post, I get the white screen of death and these notices:
    Notice: Undefined index: expirationdate_category in /HOME/USERNAME/public_html/wp-content/plugins/post-expirator/post-expirator.php on line 338

    Notice: Undefined index: expirationdate_category in /HOME/USERNAME//public_html/wp-content/plugins/post-expirator/post-expirator.php on line 338

    Warning: Cannot modify header information - headers already sent by (output started at /HOME/USERNAME/public_html/wp-content/plugins/post-expirator/post-expirator.php:338) in /HOME/USERNAME/public_html/wp-includes/pluggable.php on line 881

    http://wordpress.org/extend/plugins/post-expirator/

  2. Travis Smith
    Member
    Posted 2 years ago #

    To clear the characters during activation, it appears that you are missing a global var. Line 127ff add global $current_blog;:
    global $current_blog;

    if (postExpirator_is_wpmu())
    	add_action ('expirationdate_delete_'.$current_blog->blog_id, 'expirationdate_delete_expired_posts');
    else
    	add_action ('expirationdate_delete', 'expirationdate_delete_expired_posts');

    Then to clear the notice on line 196, add $enabled = ''; at about line 184.

    if (empty($expirationdatets)) {
    	$defaultmonth = date('F');
    	$defaultday = date('d');
    	$defaulthour = date('H');
    	$defaultyear = date('Y');
    	$defaultminute = date('i');
    	$enabled = '';
    	$disabled = ' disabled="disabled"';
    	$categories = get_option('expirationdateCategoryDefaults');
    } else {
    	$defaultmonth = date('F',$expirationdatets);
    	$defaultday = date('d',$expirationdatets);
    	$defaultyear = date('Y',$expirationdatets);
    	$defaulthour = date('H',$expirationdatets);
    	$defaultminute = date('i',$expirationdatets);
    	$categories = get_post_meta($post->ID,'_expiration-date-category',true);
    	$enabled = ' checked="checked"';
    	$disabled = '';
    }
  3. Aaron Axelsen
    Member
    Plugin Author

    Posted 2 years ago #

    Take a look at the development version - I believe all of these and a few others are addressed.

    http://downloads.wordpress.org/plugin/post-expirator.zip

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags