Skip to content

Custom Marker Limits

Sven edited this page Jun 20, 2020 · 4 revisions

As of version 1.0.4 of the Mark Posts Plugin we've implemented the filter mark_posts_marker_limit to allow custom marker limits.

Restricted markers will only be available to users with at least the defined capability.

Note: Markers with no custom limit are available to all users!

Usage

The filter takes an array with the name of your marker and the depending user capability:

'marker name' => 'user capability',

You can add the filter to your themes functions.php like this:

add_filter( 'mark_posts_marker_limit', 'set_custom_marker_limit' );
function set_custom_marker_limit() {
  $marker_limit = [
    // 'marker name' => 'user capability',
    'Final' => 'activate_plugins',
    'Review' => 'edit_posts'
  ];
  return $marker_limit;
}

User Roles & Capabilities

In detail information about user roles and capabilities can be found at the Capability vs. Role Table

Having questions? Feel free to raise an issue :)

Clone this wiki locally