• Resolved Matthew

    (@kidsguide)


    I am trying to make a plugin with a settings page, but when I upload it there was an error.

    This is the HTML:

    *
    
    Plugin Name: Stops Core, Theme, and Plugin Updates
    
    Version: 0.2
    
    Plugin URI: https://www.ads-software.com/plugins/stops-core-theme-and-plugin-updates/
    Author: <a href="https://profiles.www.ads-software.com/kidsguide"><a href="https://profiles.www.ads-software.com/kidsguide">Websiteguy</a></a>
    
    Description: A Simple WordPress Plugin That Deletes All Updating of Plugins, Themes, and Even The WordPress Core.
    
    Compatible with WordPress 3.6+.
    
    */
    
    <?php
    function msp_add_admin_menu() {
    add_options_page(
    'Stops Updates Page',
    'Stops Updates',
    'manage_options',
    'msp-stops-updates-page',
    'msp_display_settings_page'
    );
    if(isset($_POST['msp_save'])) {
    add_action("admin_head-$page",'msp_save_settings_handler');
    }
    }
    add_action('admin_menu','msp_add_admin_menu');
    
    function edit_theme_settings() {
        if ( get_option('sold_text') == true ) { $display = 'checked'; }
        else { $display = ''; }
        update_option( 'sold_text', $display );
    ?>
    
    <p>Check if you don't won't updates of it</p> 
    
    <input type="checkbox" name='Plugin_Updates' id='Plugin' value="1" <?= checked( get_option('Plugin'), 1, false );?> />
    <input type="checkbox" name='WordPress_Core_Updates' id='Core' value="1" <?= checked( get_option('Core'), 1, false );?> />
    <input type="checkbox" name='Theme_Updates' id='Theme' value="1" <?= checked( get_option('Theme'), 1, false );?> />

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator bcworkz

    (@bcworkz)

    The C style comment/template header needs to be within the <?php ?> block. Your last function lacks a terminating <?php } ?>. If you define WP_DEBUG as true in wp-config.php, you will see error messages giving you a good clue to what is wrong and where.

    Thread Starter Matthew

    (@kidsguide)

    What would this look like?

    Moderator bcworkz

    (@bcworkz)

    <?php
    /*
     * Plugin header info
     */
    add_action('admin_menu','msp_add_admin_menu');
    
    function edit_theme_settings() {
       //more php code
        update_option( 'sold_text', $display );
    ?>
    <p>Check if you don't won't updates of it</p>
    <!-- More HTML input fields -->
    
    <?php } ?>
    Thread Starter Matthew

    (@kidsguide)

    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Settings page truble’ is closed to new replies.