Changeset 3092591
- Timestamp:
- 05/26/2024 06:15:27 AM (22 months ago)
- Location:
- badgeshift-for-recaptcha/trunk
- Files:
-
- 3 edited
-
badge-shift-for-recaptcha.php (modified) (2 diffs)
-
badge-shift-recaptcha.css (modified) (1 diff)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
badgeshift-for-recaptcha/trunk/badge-shift-for-recaptcha.php
r3089844 r3092591 3 3 * Plugin Name: BadgeShift for ReCAPTCHA 4 4 * Description: BadgeShift for ReCAPTCHA will <strong>move the Google reCAPTCHA v3 badge to the left side.</strong> Just install and it's done. The plugin is super lightweight so adding it will not slow down your website. 5 * Version: 1.0. 05 * Version: 1.0.3 6 6 * Author: WpConsults LLC 7 7 * Author URI: https://www.wpconsults.com/ … … 11 11 12 12 13 // Enqueue custom CSS13 /// Enqueue custom CSS with dynamic values 14 14 function badge_shift_enqueue_styles() { 15 $plugin_version = '1.0.0'; // Set your plugin version here 15 $plugin_version = '1.0.0'; // Set your plugin version here 16 wp_enqueue_style( 'badge-shift-recaptcha-css', plugins_url( 'badge-shift-recaptcha.css', __FILE__ ), array(), $plugin_version ); 16 17 17 wp_enqueue_style( 'badge-shift-recaptcha-css', plugins_url( 'badge-shift-recaptcha.css', __FILE__ ), array(), $plugin_version ); 18 $left_position = get_option( 'badge_shift_left_position', '-2px' ); 19 $bottom_position = get_option( 'badge_shift_bottom_position', '20px' ); 20 $z_index = get_option( 'badge_shift_z_index', '999' ); // Default z-index value 21 $hide_badge = get_option( 'badge_shift_hide_badge' ); 22 23 $custom_css = " 24 .grecaptcha-badge { 25 left: {$left_position} !important; 26 bottom: {$bottom_position} !important; 27 z-index: {$z_index} !important; 28 visibility: " . ( $hide_badge ? 'hidden' : 'visible' ) . " !important; 29 } 30 "; 31 32 wp_add_inline_style( 'badge-shift-recaptcha-css', $custom_css ); 18 33 } 19 34 add_action( 'wp_enqueue_scripts', 'badge_shift_enqueue_styles' ); 20 35 36 // Add settings page 37 function badge_shift_settings_page() { 38 add_options_page( 'BadgeShift Settings', 'BadgeShift Settings', 'manage_options', 'badge_shift_settings', 'badge_shift_settings_page_content' ); 39 } 40 add_action( 'admin_menu', 'badge_shift_settings_page' ); 41 42 43 44 // Register settings 45 function badge_shift_register_settings() { 46 register_setting( 'badge_shift_settings_group', 'badge_shift_left_position' ); 47 register_setting( 'badge_shift_settings_group', 'badge_shift_bottom_position' ); 48 register_setting( 'badge_shift_settings_group', 'badge_shift_z_index' ); 49 register_setting( 'badge_shift_settings_group', 'badge_shift_hide_badge' ); 50 } 51 add_action( 'admin_init', 'badge_shift_register_settings' ); 52 53 // Save settings 54 function badge_shift_save_settings() { 55 // Validation and sanitization can be added here if needed 56 } 57 58 59 60 // Settings page content 61 function badge_shift_settings_page_content() { 62 ?> 63 <div class="wrap"> 64 <h2>BadgeShift Settings</h2> 65 <p> 66 Normally it will work fine, However If you need you can Adjust position by inputing respective values here. 67 </p> 68 <form method="post" action="options.php"> 69 <?php settings_fields( 'badge_shift_settings_group' ); ?> 70 <?php do_settings_sections( 'badge_shift_settings_group' ); ?> 71 <table class="form-table"> 72 <tr valign="top"> 73 <th scope="row">Left Position:</th> 74 <td><input type="text" name="badge_shift_left_position" placeholder="-2px" value="<?php echo esc_attr( get_option( 'badge_shift_left_position' ) ); ?>" /></td> 75 </tr> 76 <tr valign="top"> 77 <th scope="row">Bottom Position:</th> 78 <td><input type="text" name="badge_shift_bottom_position" placeholder="20px" value="<?php echo esc_attr( get_option( 'badge_shift_bottom_position' ) ); ?>" /></td> 79 </tr> 80 <tr valign="top"> 81 <th scope="row">Z-Index:</th> 82 <td><input type="text" name="badge_shift_z_index" placeholder="9999" value="<?php echo esc_attr( get_option( 'badge_shift_z_index' ) ); ?>" /></td> 83 </tr> 84 <tr valign="top"> 85 <th scope="row">Hide reCAPTCHA Badge:</th> 86 <td><input type="checkbox" name="badge_shift_hide_badge" <?php checked( get_option( 'badge_shift_hide_badge' ), 'on' ); ?> /></td> 87 </tr> 88 </table> 89 <?php submit_button(); ?> 90 </form> 91 </div> 92 <?php 93 } 94 95 96 97 98 -
badgeshift-for-recaptcha/trunk/badge-shift-recaptcha.css
r3089844 r3092591 6 6 overflow: hidden !important; 7 7 transition: all 0.3s ease !important; 8 left: -2px !important;9 bottom: 20px !important;10 8 } 11 9 -
badgeshift-for-recaptcha/trunk/readme.txt
r3089983 r3092591 1 1 === BadgeShift for ReCAPTCHA === 2 2 Contributors: wpconsults 3 Donate link: https://www.wpconsults.com/ easy-payment/3 Donate link: https://www.wpconsults.com/support-us/ 4 4 Tags: move google recaptcha, hide recaptcha, google recaptcha, hidden recaptcha, hide google recaptcha 5 5 Requires at least: 3.0.0 6 Tested up to: 6. 4.37 Stable tag: 1.0. 08 Requires PHP: 7. 06 Tested up to: 6.5.3 7 Stable tag: 1.0.1 8 Requires PHP: 7.4 9 9 License: GPLv2 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 13 13 14 14 == Description == 15 This plugin move the Google reCAPTCHA logo to left side from the front end of your website. 15 BadgeShift for ReCAPTCHA will allow you to move Google reCAPTCHA badge from right to bottom left side. 16 16 17 17 == Installation == … … 29 29 30 30 == Changelog == 31 = 1.0.1 = 32 * Hide features added. 31 33 = 1.0.0 = 32 34 * Initial release.
Note: See TracChangeset
for help on using the changeset viewer.