芝麻web文件管理V1.00
编辑当前文件:/home/p/r/i/prismawe/clients/origami-events.com/wp-content/themes/kallyas/framework/class-gdpr.php
$textConfig ) { if ( empty( $textConfig['text'] ) ) { continue; } $inputId = self::generateId( $key); ?>
'zn_gdpr_options', 'title' => __( "GDPR options", 'zn_framework' ), ); return $admin_pages; } /** * Add options for the GDPR requirements * * @param mixed $options * * @return array The options array containing GDPR specific options */ public static function addOptions( $options) { $options[] = array( 'slug' => 'zn_gdpr_options', 'parent' => 'general_options', "name" => __( 'GDPR Options', 'zn_framework' ), "description" => __( 'These options helps you be in compliance with General Data Protection Regulation.', 'zn_framework' ), "id" => "gdpr_info", "type" => "zn_title", "class" => "zn_full zn-custom-title-large zn-top-separator", ); $options[] = array( 'slug' => 'zn_gdpr_options', 'parent' => 'general_options', "name" => __( 'After login form checkboxes', 'zn_framework' ), "description" => __( 'Using this option you can add extra information after the login forms created by the theme.', 'zn_framework' ), "id" => "after_login_texts", "type" => "group", "subelements" => array( array( "name" => __( 'Checkbox text', 'zn_framework' ), "description" => __( 'Add the text that will appear next to the checkbox.', 'zn_framework' ), "id" => "text", "type" => "textarea", "class" => "zn_full", ), array( "name" => __( 'Validation error text', 'zn_framework' ), "description" => __( "Add the text that will appear if the user doesn't check the checkbox.", 'zn_framework' ), "id" => "validation_text", "type" => "textarea", "class" => "zn_full", ), ), ); return $options; } /** * Validate the Registration form checkboxes * * @param array $error_messages The error messages attached to the array so far * * @return array The array containing validation errors if there are present */ public static function validateRegistration( $error_messages) { $gdpr_text = zget_option( 'after_login_texts', 'general_options', false, array() ); // Don't proceed if the gdpr text is empty if ( is_array( $gdpr_text ) && ! empty( $gdpr_text ) ) { foreach ( $gdpr_text as $key => $config ) { if ( empty( $gdpr_text['text'] ) ) { continue; } $inputId = self::generateId( $key); if ( ! isset( $_POST[$inputId] ) ) { $error_messages[] = $config['validation_text']; } } } return $error_messages; } } new ZnHg_GDPR();