column
11 years ago
storage_model
11 years ago
addons.php
11 years ago
column.php
11 years ago
settings.php
11 years ago
storage_model.php
11 years ago
third_party.php
11 years ago
upgrade.php
11 years ago
utility.php
11 years ago
utility.php
32 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * Admin message |
| 5 | * |
| 6 | * @since 1.5.0 |
| 7 | * |
| 8 | * @param string $message Message. |
| 9 | * @param string $type Update Type. |
| 10 | */ |
| 11 | function cpac_admin_message( $message = '', $type = 'updated' ) { |
| 12 | $GLOBALS['cpac_messages'][] = '<div class="cpac_message ' . $type . '"><p>' . $message . '</p></div>'; |
| 13 | |
| 14 | add_action( 'admin_notices', 'cpac_admin_notice' ); |
| 15 | add_action( 'network_admin_notices', 'cpac_admin_notice' ); |
| 16 | } |
| 17 | |
| 18 | /** |
| 19 | * Admin Notice |
| 20 | * |
| 21 | * This uses the standard CSS styling from WordPress, no additional CSS have to be loaded. |
| 22 | * |
| 23 | * @since 1.5.0 |
| 24 | * |
| 25 | * @return string Message. |
| 26 | */ |
| 27 | function cpac_admin_notice() { |
| 28 | |
| 29 | echo implode( $GLOBALS['cpac_messages'] ); |
| 30 | } |
| 31 | |
| 32 |