# public RalfAlbert / functions-php.part.php Last active 2012-12-31

Removing the Forgetmenot-checkbox on the WordPress login screen.

functions-php.part.php
PHP
 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 .+

#Uuis';  $html = preg_replace($search, '', $html ); echo$html; }
index.php
PHP
 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112  * @license GPLv3 http://www.gnu.org/licenses/gpl-3.0.txt * @version 0.1 * @date 20112-12-29 * @link http://wordpress.com */ /** * Plugin Name: Remove Forgetmenot * Plugin URI: http://yoda.neun12.de * Description: Removes the 'forgetmenot' checkbox from the login screen * Version: 0.1 * Author: Ralf Albert * Author URI: http://yoda.neun12.de * Text Domain: * Domain Path: * Network: * License: GPLv3 */ /* This program is free software; you can redistribute it and/ormodify it under the terms of the GNU General Public Licenseas published by the Free Software Foundation; either version 2of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See theGNU General Public License for more details. You should have received a copy of the GNU General Public Licensealong with this program; if not, write to the Free SoftwareFoundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.*/  namespace WPSE77581; /** * Start the plugin when plugins was loaded */add_action( 'plugins_loaded', 'WPSE77581\remove_forgetmenot', 10, 0); /** * Initialize the plugin. Hook up all actions and filters */function remove_forgetmenot() {  // add JavaScript add_action( 'login_enqueue_scripts', 'WPSE77581\enqueue_script', 10, 0 );  // plain PHP with outputbuffering add_action( 'login_head', 'WPSE77581\start_outputbuffer', 1, 0 ); add_action( 'login_footer', 'WPSE77581\end_outputbuffer', 1, 0 ); } /** * Enqueueing needed JavaScripts */function enqueue_script() {  wp_enqueue_script( 'WPSE77581-remove-forgetmenot', plugins_url( 'wpse77581.js', __FILE__ ), array( 'jquery' ), false, true ); } /** * Start outputbuffering * Buffers the DOM for later manipulation */function start_outputbuffer() {  ob_start(); } /** * End outputbuffering * Get the content from outputbuffer and remove the paragraph with checkbox */function end_outputbuffer() {  $html = ob_get_clean();$search = '#

.+

#Uuis';  $html = preg_replace($search, '', $html ); echo$html; }
index_php52.php
PHP
 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 * @license GPLv3 http://www.gnu.org/licenses/gpl-3.0.txt* @version 0.1* @date 20112-12-29* @link http://wordpress.com*/ /*** Plugin Name: Remove Forgetmenot* Plugin URI: http://yoda.neun12.de* Description: Removes the 'forgetmenot' checkbox from the login screen* Version: 0.1* Author: Ralf Albert* Author URI: http://yoda.neun12.de* Text Domain:* Domain Path:* Network:* License: GPLv3*/ /* This program is free software; you can redistribute it and/ormodify it under the terms of the GNU General Public Licenseas published by the Free Software Foundation; either version 2of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See theGNU General Public License for more details. You should have received a copy of the GNU General Public Licensealong with this program; if not, write to the Free SoftwareFoundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.*/  /** * Start the plugin when plugins was loaded */add_action( 'plugins_loaded', 'WPSE77581_remove_forgetmenot', 10, 0); /** * Initialize the plugin. Hook up all actions and filters*/function WPSE77581_remove_forgetmenot() {  // add JavaScript add_action( 'login_enqueue_scripts', 'WPSE77581_enqueue_script', 10, 0 );  // plain PHP with outputbuffering add_action( 'login_head', 'WPSE77581_start_outputbuffer', 1, 0 ); add_action( 'login_footer', 'WPSE77581_end_outputbuffer', 1, 0 ); } /** * Enqueueing needed JavaScripts */function WPSE77581_enqueue_script() {  wp_enqueue_script( 'WPSE77581-remove-forgetmenot', plugins_url( 'wpse77581.js', __FILE__ ), array( 'jquery' ), false, true ); } /** * Start outputbuffering * Buffers the DOM for later manipulation */function WPSE77581_start_outputbuffer() {  ob_start(); } /** * End outputbuffering * Get the content from outputbuffer and remove the paragraph with checkbox */function WPSE77581_end_outputbuffer() {  $html = ob_get_clean();$search = '#

.+

#Uuis';  $html = preg_replace($search, '', $html ); echo$html; }
 1 2 3 4 5 6 7 README InstallDonwload the zip-archive, uncompress it into a folder, upload the folder to your WordPress plugin-folder. Activate the plugin on the plugin screen. !!!ATTENTION!!!If you are using PHP5.2, delete or rename the file 'index.php' BEFORE upload/activate the plugin. Then rename the file 'index_php52.php' into 'index.php'
 1 2 3 4 5 6 7 8 9 /** * JavaScript (jQuery) * Removes all paragraphs with class '.forgetmenot' */jQuery( document ).ready( function ( $) {$( '.forgetmenot' ).remove(); });