Code Duplication    Length = 5-13 lines in 3 locations

caffeinated/admin/extend/registration_form/Extend_Registration_Form_Admin_Page.core.php 1 location

@@ 671-675 (lines=5) @@
668
                    'event_espresso'), $question_ID, $wpdb->last_error), __FILE__, __FUNCTION__, __LINE__);
669
                $this->_redirect_after_action(false, '', '', array('action' => 'default'), false);
670
            }
671
        } else {
672
            EE_Error::add_error(sprintf(esc_html__('Could not duplicate question with ID %d because it didn\'t exist!',
673
                'event_espresso'), $question_ID), __FILE__, __FUNCTION__, __LINE__);
674
            $this->_redirect_after_action(false, '', '', array('action' => 'default'), false);
675
        }
676
    }
677
678

caffeinated/admin/extend/registrations/Extend_Registrations_Admin_Page.core.php 1 location

@@ 1019-1030 (lines=12) @@
1016
                    $errors++;
1017
                }
1018
            }
1019
        } else {
1020
            EE_Error::add_error(
1021
                esc_html__(
1022
                    'So, something went wrong with the bulk delete because there was no data received for instructions on WHAT to delete!',
1023
                    'event_espresso'
1024
                ),
1025
                __FILE__,
1026
                __FUNCTION__,
1027
                __LINE__
1028
            );
1029
            $this->_redirect_after_action(false, '', '', $query_args, true);
1030
        }
1031
        if ($errors > 0) {
1032
            EE_Error::add_error(
1033
                sprintf(__('There were %d records that did not delete successfully', 'event_espresso'), $errors),

admin_pages/registrations/Registrations_Admin_Page.core.php 1 location

@@ 2669-2681 (lines=13) @@
2666
    protected function _trash_or_restore_registrations($trash = true)
2667
    {
2668
        //if empty _REG_ID then get out because there's nothing to do
2669
        if (empty($this->_req_data['_REG_ID'])) {
2670
            EE_Error::add_error(
2671
                sprintf(
2672
                    esc_html__(
2673
                        'In order to %1$s registrations you must select which ones you wish to %1$s by clicking the checkboxes.',
2674
                        'event_espresso'
2675
                    ),
2676
                    $trash ? 'trash' : 'restore'
2677
                ),
2678
                __FILE__, __LINE__, __FUNCTION__
2679
            );
2680
            $this->_redirect_after_action(false, '', '', array(), true);
2681
        }
2682
        $success = 0;
2683
        $overwrite_msgs = false;
2684
        //Checkboxes