Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to disable scrolling #15

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

# Age Verify
[![WordPress](https://img.shields.io/wordpress/v/akismet.svg)](https://wordpress.org/download/)
[![version](https://img.shields.io/badge/stable-v0.3.1-4A8F80.svg)](https://wordpress.org/plugins/wp-drinking-age/)
[![License: GPL v2](https://img.shields.io/badge/License-GPL%20v2-blue.svg)](https://www.gnu.org/licenses/gpl-2.0.html)


## Description
This plugin is a fork of Chase Wiseman's popular [age-verify plugin](https://github.com/ChaseWiseman/age-verify), adding an additional option to the admin panel for users to disable the browser's scrollbar when the gateway is present.


## Installation
1. Upload the plugin file to '/wp-content/plugins/' directory or upload the [zip](https://github.com/d0n601/age-verify/archive/master.zip) file through the plugins section of the admin panel
2. Activate the plugin through 'Plugins' menu in WordPress admin
3. Adjust plugin's settings by going to **Settings->Age Verify**
4. Now enjoy your Age Gateway!

10 changes: 5 additions & 5 deletions age-verify.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
*
* This file loads the main plugin class and gets things running.
*
* @since 0.2.6
* @since 0.3.1
*
* @package Age_Verify
*/

/**
* Plugin Name: Age Verify
* Plugin Name: Age Verify Fork
* Description: A simple way to ask visitors for their age before viewing your site.
* Author: Chase Wiseman
* Author URI: http://chasewiseman.com
* Version: 0.3.0
* Author: Ryan Kozak
* Author URI: https://ryankozak.com
* Version: 0.3.1
* Text Domain: age-verify
* Domain Path: /languages
*/
Expand Down
6 changes: 5 additions & 1 deletion includes/admin/class-age-verify-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Define the admin class
*
* @since 0.2.6
* @since 0.3.1
*
* @package Age_Verify\Admin
*/
Expand Down Expand Up @@ -171,6 +171,10 @@ public function register_settings() {
add_settings_field( '_av_styling', __( 'Styling', 'age-verify' ), 'av_settings_callback_styling_field', 'age-verify', 'av_settings_display' );
register_setting ( 'age-verify', '_av_styling', 'intval' );

// Disable Scrollbar
add_settings_field( '_av_scroll', __( 'Scroll', 'age-verify' ), 'av_settings_callback_scroll_field', 'age-verify', 'av_settings_display' );
register_setting ( 'age-verify', '_av_scroll', 'intval' );

// Overlay Color
add_settings_field( '_av_overlay_color', __( 'Overlay Color', 'age-verify' ), 'av_settings_callback_overlay_color_field', 'age-verify', 'av_settings_display' );
register_setting ( 'age-verify', '_av_overlay_color', array( $this, 'validate_color' ) );
Expand Down
27 changes: 24 additions & 3 deletions includes/admin/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@
/**
* Define the settings page.
*
* @since 0.1
* @since 0.3.1
*/
function av_settings_page() { ?>

<div class="wrap">

<?php screen_icon(); ?>

<h2><?php esc_html_e( 'Age Verify Settings', 'age-verify' ) ?></h2>

<form action="options.php" method="post">
Expand Down Expand Up @@ -204,6 +202,29 @@ function av_settings_callback_styling_field() { ?>

<?php }


/**
* Prints the scrollbar settings field.
*
* @since 0.3.1
*/
function av_settings_callback_scroll_field() { ?>

<fieldset>
<legend class="screen-reader-text">
<span><?php esc_html_e( 'Styling', 'age-verify' ); ?></span>
</legend>
<label for="_av_scroll">
<input name="_av_scroll" type="checkbox" id="_av_scroll" value="1" <?php checked( 1, get_option( '_av_scroll', 1 ) ); ?>/>
<?php esc_html_e( 'Disable scrollbar when gateway is present', 'age-verify' ); ?>
</label>
</fieldset>

<?php }




/**
* Prints the overlay color settings field.
*
Expand Down
4 changes: 2 additions & 2 deletions includes/assets/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@
border-radius: 3px;
}

/* Minimum width of 400 pixels. */
@media screen and (min-width: 400px) {
/* Minimum width of 416 pixels. */
@media screen and (min-width: 416px) {

#av-overlay {
position: relative;
Expand Down
11 changes: 10 additions & 1 deletion includes/class-age-verify.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Define the main plugin class
*
* @since 0.2.6
* @since 0.3.1
*
* @package Age_Verify
*/
Expand Down Expand Up @@ -234,6 +234,15 @@ public function verify_overlay() {

<div id="av-overlay-wrap">

<?php if(get_option('_av_scroll', 1)): ?>
<style>
html,body {
height:100%;
overflow:hidden;
}
</style>
<?php endif; ?>

<?php do_action( 'av_before_modal' ); ?>

<div id="av-overlay">
Expand Down
7 changes: 5 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
=== Age Verify ===
Contributors: ChaseWiseman
Contributors: Ryan Kozak, ChaseWiseman
Tags: age, restrict, verify
Requires at least: 3.2
Tested up to: 4.4.1
Tested up to: 4.8.1
Stable tag: 0.3.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Expand All @@ -26,6 +26,9 @@ Whatever your reasons, you may need your site's visitors to confirm their age be

== Changelog ==

= 0.3.1 =
* Option to disable scrollbar when gateway is present.

= 0.3.0 =
* New: French and Italian translations
* Tweak: Use strings for the textdomain and change to 'age-verify'
Expand Down