I have an easy solution to this. Requirement is hiding the ECB context menu of the listItem. In my requirement I wanted to show only View,Edit,Delete options on hover of the listitem menu

I wanted to hide the 'Workflows', 'Compliance Details' and 'Shared With'.
Answer is :
First click on the settings button ->EditPage->Add webpart->under Media and content->select script editor webpart(place the script editor below the list)->click on 'edit snippet'-> and copy the following code:
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.11.1.min.js"></script>
<script language="javascript" type="text/javascript">
$(document).ready(hideECBMenuItem);
function hideECBMenuItem(){
//alert("jquery is working");
$("div.ms-list-itemLink").click(function(){
CoreInvoke('ShowECBMenuForTr', this, event);
MenuItemSetter(); return false;
});
$("a.ms-lstItmLinkAnchor").click(function(){
CoreInvoke('ShowECBMenuForTr', this, event);
MenuItemSetter(); return false;
});
}
function MenuItemSetter(){
setTimeout("WorkingWithMenuMenuItem()",300);
}
function WorkingWithMenuMenuItem(){
//give the names the Ecb menu items you want to hide
$("a[title='Workflows']").parent().hide();
$("a[title='Compliance Details']").parent().hide();
$("a[title='Shared With']").parent().hide();
}
</script>
Then click Page->'Stop editing'. And when you try to open the ECB context menu of the list item you find the required elements being hidden.
Hope this helps! :)