{"id":1075,"date":"2015-05-26T09:38:07","date_gmt":"2015-05-26T14:38:07","guid":{"rendered":"http:\/\/agileadam.com\/?p=1075"},"modified":"2015-05-26T09:38:07","modified_gmt":"2015-05-26T14:38:07","slug":"private-messages-moving-delete-button-into-actions-select-list","status":"publish","type":"post","link":"https:\/\/agileadam.com\/2015\/05\/private-messages-moving-delete-button-into-actions-select-list\/","title":{"rendered":"Private Messages – Moving “Delete” button into “Actions” select list"},"content":{"rendered":"

By default the “Delete” operations will show as a button\u00a0on Privatemsg<\/a>‘s message listing page. There is an “Actions” dropdown that includes actions to “mark as read” or “mark as unread” so why not include “delete” there?<\/p>\n

Luckily the module developers included a hook to easily override the options. If you set the “button” property of the “delete” operation to FALSE it’ll render in the select list instead of as a button.<\/p>\n

\/**\r\n * Implements hook_privatemsg_thread_operations_alter().\r\n *\/\r\nfunction mymodule_privatemsg_thread_operations_alter(&$operations, $type) {\r\n  \/\/ This will remove the delete button and will instead include \"Delete\" in the \"Actions\" dropdown\r\n  if (isset($operations['delete'])) {\r\n    $operations['delete']['button'] = FALSE;\r\n  }\r\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"

By default the “Delete” operations will show as a button\u00a0on Privatemsg‘s message listing page. There is an “Actions” dropdown that includes actions to “mark as read” or “mark as unread” so why not include “delete” there? Luckily the module developers included a hook to easily override the options. If you set the “button” property of the “delete” operation to FALSE it’ll render in the select list instead of as a button. \/** * Implements hook_privatemsg_thread_operations_alter(). *\/ function mymodule_privatemsg_thread_operations_alter(&$operations, $type) { \/\/ This will remove the delete button and will instead include “Delete” in the “Actions” dropdown if (isset($operations[‘delete’])) { $operations[‘delete’][‘button’] = FALSE; } }<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[79],"tags":[84,238],"_links":{"self":[{"href":"https:\/\/agileadam.com\/wp-json\/wp\/v2\/posts\/1075"}],"collection":[{"href":"https:\/\/agileadam.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/agileadam.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/agileadam.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/agileadam.com\/wp-json\/wp\/v2\/comments?post=1075"}],"version-history":[{"count":1,"href":"https:\/\/agileadam.com\/wp-json\/wp\/v2\/posts\/1075\/revisions"}],"predecessor-version":[{"id":1076,"href":"https:\/\/agileadam.com\/wp-json\/wp\/v2\/posts\/1075\/revisions\/1076"}],"wp:attachment":[{"href":"https:\/\/agileadam.com\/wp-json\/wp\/v2\/media?parent=1075"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/agileadam.com\/wp-json\/wp\/v2\/categories?post=1075"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/agileadam.com\/wp-json\/wp\/v2\/tags?post=1075"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}