Support » Plugin: Post Expirator » Remove tag

Viewing 4 replies - 1 through 4 (of 4 total)
  • yflement – I know this is an older thread, but did you every find a solution for this? I have a similar issue.

    I used this plugin but added code to remove the tag of a post. I know basically no PHP so it’s probably very ugly, but I can look up the code and post if you want.

    @yflement – If you are able to track down the code you used for it, that would be great. I appreciate your reply, thanks.

    I’m using version 2.1.4. In post-expirator.php:

    An if-else chain starts at line 472. I altered the last elseif to:

    elseif ($expireType == 'category-remove') {
        $tag = "registration closed";
        wp_set_object_terms( $id, array($tag), 'post_tag', false );        	

    What this does: it makes the ‘Remove category’-action remove all tags from the post (wp_set_object_terms) and replaces it with a single tag named ‘registration closed’ (i start with posts that have tag ‘registration’).

    In the _postExpiratorExpireType function i changed the last statement in if ($type != 'page') to:

    $rv[] = '<option value="category-remove" '. ($selected == 'category-remove' ? 'selected="selected"' : '') . '>'.__('Remove tag','post-expirator').'</option>';

    Which makes it so that when you select ‘Remove tag’ from the dropdown in the front-end that it will go into the modified elseif above.

    I have uploaded the complete file at In the end, it’s very limited and you can’t use the remove-category action anymore but it’s what did the job for me.

    Hopefully it helps you in any way!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Remove tag’ is closed to new replies.