Some code problems with my plugin
-
I am coding a plugin that changes the look of the wp admin page.
Currently I am coding the interface, and I am having some problems. as my site has a white screen with this plugin activated.
Below is the entire code, so if any coding ninjas could take a look and try and find any errors or missing brackets, ect I would be grateful.
——————-Code below here—————————————-
<?php
/*
Plugin Name: William’s Custom WP Login
Plugin URI: http://thewpkid.com/plugin
Description: Let’s you configure a custom login screen. Handy for web developers who have clients logging to a site. For troubleshooting please visit this page
Version: 1.0
Author: William DP
Author URI: http://thewpkid.com
Copyright: William DP – 2014
*/// START OF CORE PLUGIN CODE: CONTROLS LOGIN PAGE
function custom_login_css(){
echo ‘<link rel=”stylesheet” type=”text/css” href=”‘ . plugins_url( ‘/style.css’ , __FILE__ ) . ‘”/> ‘;
}
add_action (‘login_head’,’custom_login_css’);add_filter(‘login_headerurl’, ‘custom_login_header_url’);
function custom_login_header_url($url){
return ‘http://www.yourwebsitehere.com’;
}
add_filter(‘login_headertitle’, ‘custom_login_header_title’);function custom_login_header_title($title){
return ‘Add text here to change the text shown when your mouse hovers over the main header image’;
}
// END OF CORE PLUGIN CODE: CONTROLS LOGIN PAGE
// START OF CODE FOR: MENU, PAGES, SUB-PAGES AND CONTENT FOR PAGES
// OPTIONS AREA
function super_plugin_menu(){
add_options_page(‘Super Plugin Options’, ‘Super Plugin’, ‘manage_options’, ‘super-plugin-menu’, ‘super_plugin_options’);
}
//call register settings functionadd_action (‘admin_init’, ‘register_mysettings’);
function register_mysettings() {
//register our settings
register_setting( ‘super-settings-group’, ‘new_option_name’ );
register_setting( ‘super-settings-group’, ‘some_other_option’ );
register_setting( ‘super-settings-group’, ‘option_etc’ );
}
//END OF OPTIONS AREA
function register_my_custom_menu(){
add_menu_page( ‘Custom WP Login’, ‘Williams Custom WP Login Plugin’, ‘manage_options’, ‘custom_login’, ‘my_custom_menu_page_callback’, plugins_url( ‘logo.png’, __FILE__ ));
add_submenu_page( ‘custom_login’, ‘Settings’, ‘Settings’, ‘manage_options’, ‘custom_login_subpage’, ‘my_custom_submenu_page_callback’);
}add_action( ‘admin_menu’, ‘register_my_custom_menu’ );
function my_custom_menu_page_callback( ) {
echo ‘<h1>Williams Custom WP Login Plugin</h1>’;
echo ‘<h3>This plugin allows users to customize how their login screen looks. Instead of a boring plain white screen which clearly displays that your site is using WordPress, this plugin will allow you to customize the look of your login pagee. It is also a serious security issue if hackers know that you site is using WordPress then they can try to attack you by taking advantage of vulnerabilities that may appear in themes and plugins.</h3>’;
}function my_custom_submenu_page_callback( ) {
<div class=”wrap”>‘<h2>Williams Custom Login Plugin</h2>’
‘<h3>Plugin Options</h3>’
‘<h5>Copyright 2014 William Di Paolo. This plugin and all images and code are protected by copyright. Please do not copy this code and use it for your own plugins/custom projects. If you wish to have custom logins for other sites, please just install the plugin on the other stites. If you wish to support this plugin and my work, please donate. For instructions on how to donate please refer to the main plugin page. Donating helps keep me rolling out new features, and keep those updates coming.</h5>’
}<form action=”options.php” method=”post”>
<?php settings_fields( ‘super-settings-group’ ); ?>
<?php do_settings( ‘super-settings-group’ ); ?>
<table class=”form-table”>
<tr valign=”top”>
<th scope=”row”>Website Callback Link</th>
<td><input type=”text” name=”new_option_name” value=”<?php echo get_option(‘website_callback_link’); ?>” /></td>
</tr>
<tr valign=”top”>
<th scope=”row”>Some Other Option</th>
<td><input type=”text” name=”some_other_option” value=”<?php echo get_option(‘some_other_option’); ?>” /></td>
</tr>
<tr valign=”top”>
<th scope=”row”>More Options.</th>
<td><input type=”text” name=”option_etc” value=”<?php echo get_option(‘more_options’); ?>” /></td>
</tr>
—————End of code————————-
The topic ‘Some code problems with my plugin’ is closed to new replies.