Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author ClubDesign

    (@clubdesign)

    Hey, there is a way without modifying the files. You could try to overwrite the main plugin options file, and set set the “read setting” to 1 before my plugin even loads.
    The Plugins Options are held as array at ‘subpat_options’

    So basically you must get the options with
    $subpat_options = get_option(‘subpat_options’)

    Set the correct setting
    $subpat_options[‘subtle-notice’] = ‘1’;

    And Update the options again:
    update_option( ‘subpat_options’, $subpat_options )

    But you should do some checking before updating if the setting isn`t already set to 1, or your theme will make this request every time it loads.

    I am not gonna change the options names in the future, so this might be a safe and secure way.

    Another way might be to append ?subtle_msg = 1 to your url after installing of your theme. Then the plugin does it own worl and removes the message.

    Please tell me what theme will be using my plugin (link!) once finished, that i can maybe feature on my website!

    Greets!

    Plugin Author ClubDesign

    (@clubdesign)

    If more people need this plugin required in their plugins, please tell me! I can add a filter function to prevent notices at the beginning.

    But this only makes sense if many theme developers need this…

    Greets

    Thread Starter DSafari

    (@dsafari)

    Thanks, would love the filter added or just remove the message – I don’t think it’s needed.

    Where in functions.php would be the best place to put the above code?

    Appreciate the help.

    Plugin Author ClubDesign

    (@clubdesign)

    I suggest you to hook it into the admin_init action, like that:

    add_action( 'admin_init', 'yourfunction' );
    
    function yourfunction() {
     $subpat_options = get_option('subpat_options');
     if( $subpat_options['subtle-notice'] != '1' ) {
       $subpat_options['subtle-notice'] = '1';
       update_option( 'subpat_options', $subpat_options );
     }
    }

    This should do the trick, not tested though… Tell me if it works…

    Thread Starter DSafari

    (@dsafari)

    Unfortunately this doesn’t work and msg is displayed.

    Not sure what it is…

    Plugin Author ClubDesign

    (@clubdesign)

    Wait a minute, i`m gonna check that…

    Plugin Author ClubDesign

    (@clubdesign)

    I currently have no access to the repository, as something is going wrong on the wp plugin servers, BUT open subtle_backgrounds.php in the plugin directory and add this on line 142, before parse_str:

    if (defined('SUBPAT_NOTICE') && SUBPAT_NOTICE == '0') {
    			return;
    		}

    and upload it again.
    Then in your Theme functions.php at the very top add this:

    define('SUBPAT_NOTICE', '0');

    And the messages are gone.
    This will be in the code of 0.2, so you can savely add it right now to test. The update will fly out whenever i have access to the repo again.

    Greets

    Thread Starter DSafari

    (@dsafari)

    This work great!

    Thanks for the help – will send over the link when done but should be a couple more weeks.

    Plugin Author ClubDesign

    (@clubdesign)

    So finally, as of version 1.0 this is implemented in the plugin. If you want to hide the first admin notices just add:

    define(‘SUBPAT_NOTICE’, ‘0’);

    at the top of your functions.php.

    Thanks

    Thread Starter DSafari

    (@dsafari)

    Thanks for implementing this!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Remove intro message’ is closed to new replies.