/** * Delete an MLA post_mime_type object * * @since 1.40 * * @param string MLA post_mime_type slug * * @return array Message(s) reflecting the results of the operation */ public static function mla_delete_post_mime_type($slug) { if (!self::_get_post_mime_templates()) { self::$mla_post_mime_templates = array(); } if (isset(self::$mla_post_mime_templates[$slug])) { unset(self::$mla_post_mime_templates[$slug]); self::_put_post_mime_templates(); self::_get_post_mime_templates(true); if (isset(self::$mla_post_mime_templates[$slug])) { return array('message' => sprintf(__('View "%1$s" reverted to standard', 'media-library-assistant'), $slug), 'body' => ''); } else { return array('message' => sprintf(__('View "%1$s" deleted', 'media-library-assistant'), $slug), 'body' => ''); } } return array('message' => sprintf(__('%1$s: Did not find view "%2$s"', 'media-library-assistant'), __('ERROR', 'media-library-assistant'), $slug), 'body' => ''); }