/** * */ function rtmedia_actions() { $actions = array(); if (is_user_logged_in() && rtmedia_edit_allowed()) { $edit_button = '<button type="submit" class="rtmedia-edit rtmedia-action-buttons button" >' . __('Edit', 'rtmedia') . '</button>'; $edit_button = apply_filters('rtmedia_edit_button_filter', $edit_button); $actions[] = '<form action="' . get_rtmedia_permalink(rtmedia_id()) . 'edit/">' . $edit_button . "</form>"; } $actions = apply_filters('rtmedia_action_buttons_before_delete', $actions); foreach ($actions as $action) { echo $action; } $actions = array(); if (rtmedia_delete_allowed()) { //add_filter('rtmedia_addons_action_buttons','rtmedia_delete_action_button',10,1); $actions[] = rtmedia_delete_form($echo = false); } $actions = apply_filters('rtmedia_action_buttons_after_delete', $actions); foreach ($actions as $action) { echo $action; } do_action("after_rtmedia_action_buttons"); }
/** * list of actions might be performed on media */ function rtmedia_actions() { $actions = array(); if (is_user_logged_in() && rtmedia_edit_allowed()) { $edit_button = '<button type="submit" class="rtmedia-edit rtmedia-action-buttons button" >' . esc_html__('Edit', 'buddypress-media') . '</button>'; $edit_button = apply_filters('rtmedia_edit_button_filter', $edit_button); $actions[] = '<form action="' . esc_url(get_rtmedia_permalink(rtmedia_id())) . 'edit/">' . $edit_button . '</form>'; } $actions = apply_filters('rtmedia_action_buttons_before_delete', $actions); foreach ($actions as $action) { echo $action; // @codingStandardsIgnoreLine } $actions = array(); if (rtmedia_delete_allowed()) { $actions[] = rtmedia_delete_form($echo = false); } $actions = apply_filters('rtmedia_action_buttons_after_delete', $actions); foreach ($actions as $action) { echo $action; // @codingStandardsIgnoreLine } do_action('after_rtmedia_action_buttons'); }