2017 © Pedro Peláez
 

library dismissible-notice

Creates a dismissible--via AJAX--admin nag.

image

calderawp/dismissible-notice

Creates a dismissible--via AJAX--admin nag.

  • Monday, August 24, 2015
  • by Shelob9
  • Repository
  • 4 Watchers
  • 13 Stars
  • 736 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 2 Forks
  • 3 Open issues
  • 3 Versions
  • 1 % Grown

The README.md

A simple way to add an admin nag, that can be dismissed via AJAX., (*1)

Example

Show a warning if current version of PHP is less than 5.3., (*2)

    add_action( 'plugins_loaded', 'caeq_bootstrap' );
    function caeq_bootstrap(){

        if (  ! version_compare( PHP_VERSION, '5.3.0', '>=' ) ) {
            if ( is_admin() || defined( 'DOING_AJAX' ) && DOING_AJAX ) {
                include_once CAEQ_PATH . 'vendor/calderawp/dismissible-notice/src/callback_hook.php';
            }

            if ( is_admin() ) {
                //BIG nope nope nope!

                $message = sprintf( __( 'Caldera Easy Queries requires PHP version %1s or later. We strongly recommend PHP 5.4 or later for security and performance reasons. Current version is %2s.', '5.3.0', 'caldera-text-domain' ), PHP_VERSION );
                echo caldera_warnings_dismissible_notice( $message, true, 'activate_plugins' );
            }

        }else{
            //bootstrap plugin
            require_once( CAEQ_PATH . 'bootstrap.php' );

        }

}

Backwards Compat and such

This library was written with PHP 5.2 backwards-compat in mind. Hence the prefixed, instead of namespaced class name. You will also need to manually include the class., (*3)

Copyright 2015 Josh Pollock, (*4)

Licensed under the terms of the GNU General Public License version 2 or later. Please share with your neighbor., (*5)

The Versions

24/08 2015

dev-master

9999999-dev

Creates a dismissible--via AJAX--admin nag.

  Sources   Download

GPL v2+

24/08 2015

0.3.0

0.3.0.0

Creates a dismissible--via AJAX--admin nag.

  Sources   Download

GPL v2+

08/06 2015

0.2.0

0.2.0.0

Creates a dismissible--via AJAX--admin nag.

  Sources   Download

GPL v2+