public function filter_attachment_url($content, $post_id) { if (is_admin()) { //No need to filter on the admin side return $content; } $acl = SwpmAccessControl::get_instance(); if (has_post_thumbnail($post_id)) { return $content; } if ($acl->can_i_read_post($post_id)) { return $content; } return SwpmUtils::get_restricted_image_url(); }