column
12 years ago
storage_model
12 years ago
api.php
12 years ago
column.php
12 years ago
deprecated.php
12 years ago
export_import.php
12 years ago
settings.php
12 years ago
storage_model.php
12 years ago
third_party.php
12 years ago
upgrade.php
12 years ago
utility.php
12 years ago
utility.php
39 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Admin message |
| 4 | * |
| 5 | * @since 1.5.0 |
| 6 | * |
| 7 | * @param string $message Message. |
| 8 | * @param string $type Update Type. |
| 9 | */ |
| 10 | function cpac_admin_message( $message = '', $type = 'updated' ) { |
| 11 | $GLOBALS['cpac_messages'][] = '<div class="cpac_message ' . $type . '"><p>' . $message . '</p></div>'; |
| 12 | |
| 13 | add_action( 'admin_notices', 'cpac_admin_notice' ); |
| 14 | add_action( 'network_admin_notices', 'cpac_admin_notice' ); |
| 15 | } |
| 16 | |
| 17 | /** |
| 18 | * Admin Notice |
| 19 | * |
| 20 | * This uses the standard CSS styling from WordPress, no additional CSS have to be loaded. |
| 21 | * |
| 22 | * @since 1.5.0 |
| 23 | * |
| 24 | * @return string Message. |
| 25 | */ |
| 26 | function cpac_admin_notice() { |
| 27 | echo implode( $GLOBALS['cpac_messages'] ); |
| 28 | } |
| 29 | |
| 30 | /** |
| 31 | * Don't display unused licences |
| 32 | * |
| 33 | * @since 2.0.0 |
| 34 | */ |
| 35 | add_filter( 'cac/display_licence/addon=cac-filtering', '__return_false' ); |
| 36 | add_filter( 'cac/display_licence/addon=cac-custom-fields', '__return_false' ); |
| 37 | |
| 38 | |
| 39 |