Skip to content

Reset Custom Post Types

hofmannsven edited this page Nov 7, 2014 · 2 revisions

With v1.1.2 of the Mark Posts Plugin we've implemented the filter mark_posts_excluded_post_types to exclude or include (custom) post types within the mark posts settings.

Usage

To use the markers within the media library (for attachments) one can reset the excluded post types by adding the following filter to the functions.php:

add_filter( 'mark_posts_excluded_post_types', 'reset_custom_marker_post_types' );
function reset_custom_marker_post_types() {
  return array( 'revision', 'nav_menu_item' );
}

The filter above will enable Attachments within the settings:

Available post types

It's also possible to completely prevent usage for any other post type e.g. Posts:

add_filter( 'mark_posts_excluded_post_types', 'reset_custom_marker_post_types' );
function reset_custom_marker_post_types() {
  return array( 'post', 'attachment', 'revision', 'nav_menu_item' );
}

Note: The usage of markers in combintion with revision or nav_menu_item is not yet supported.

Having questions? Feel free to raise an issue :)

Clone this wiki locally