Code Duplication    Length = 12-15 lines in 2 locations

core/admin/EE_Admin_Page.core.php 1 location

@@ 3335-3346 (lines=12) @@
3332
     */
3333
    protected function _set_add_edit_form_tags($route = '', $additional_hidden_fields = array())
3334
    {
3335
        if (empty($route)) {
3336
            $user_msg = esc_html__(
3337
                'An error occurred. No action was set for this page\'s form.',
3338
                'event_espresso'
3339
            );
3340
            $dev_msg = $user_msg . "\n"
3341
                       . sprintf(
3342
                           esc_html__('The $route argument is required for the %s->%s method.', 'event_espresso'),
3343
                           __FUNCTION__,
3344
                           __CLASS__
3345
                       );
3346
            EE_Error::add_error($user_msg . '||' . $dev_msg, __FILE__, __FUNCTION__, __LINE__);
3347
        }
3348
        // open form
3349
        $this->_template_args['before_admin_page_content'] = '<form name="form" method="post" action="'

core/helpers/EEH_URL.helper.php 1 location

@@ 27-41 (lines=15) @@
24
     */
25
    public static function add_query_args_and_nonce($args = array(), $url = '', $exclude_nonce = false)
26
    {
27
        if (empty($url)) {
28
            $user_msg = esc_html__(
29
                'An error occurred. A URL is a required parameter for the add_query_args_and_nonce method.',
30
                'event_espresso'
31
            );
32
            $dev_msg  = $user_msg . "\n"
33
                . sprintf(
34
                    esc_html__(
35
                        'In order to dynamically generate nonces for your actions, you need to supply a valid URL as a second parameter for the %s method.',
36
                        'event_espresso'
37
                    ),
38
                    __CLASS__ . '::add_query_args_and_nonce'
39
                );
40
            EE_Error::add_error($user_msg . '||' . $dev_msg, __FILE__, __FUNCTION__, __LINE__);
41
        }
42
        // check that an action exists and add nonce
43
        if (! $exclude_nonce) {
44
            if (isset($args['action']) && ! empty($args['action'])) {