link) pairs
* @param $post - Current post object for row
*/
public static function setup_actions($actions, $post) {
if ($post->post_type != AF_POSTTYPE) return $actions;
unset($actions['inline hide-if-no-js']); // Ditch quickedit.
$trash = $actions['trash']; // Array slice seemed more complicated than just doing this...
unset($actions['trash']);
// Set the actions for real now.
// Uses the same filters that potentially hide these sections in the form builder to prevent the row action link from being shown.
// Also verifies capabilities.
if (apply_filters('alchemyst_forms:form-builder-view-section:form-builder', true, $post->ID) && current_user_can('af-edit-forms')) {
$actions['alchemyst_forms_notifications'] = 'Notifications';
}
if (apply_filters('alchemyst_forms:form-builder-view-section:notifications', true, $post->ID) && current_user_can('af-edit-notifications')) {
$actions['alchemyst_forms_entries'] = 'Entries';
}
if (apply_filters('alchemyst_forms:form-builder-view-section:entries', true, $post->ID) && current_user_can('af-view-entries')) {
$actions['trash'] = $trash;
}
return $actions;
}
}
add_action('alchemyst_forms:loaded', array('Alchemyst_Forms_Row_Actions', 'init'));