This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Validate polish postcode. | |
* | |
* @param string $field_label . | |
* @param string $value . | |
*/ | |
function wpdesk_is_polish_postcode( $field_label, $value ) { | |
if ( ! ( (bool) preg_match( '/^([0-9]{2})-([0-9]{3})$/', $value ) ) ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Validate polish postcode. "-" is required. | |
* | |
* @param bool $valid . | |
* @param string $postcode . | |
* @param string $country . | |
* | |
* @return bool |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
wpdesk_permanent_dismissible_notice( 'Success notice.', 'my-success-notice', 'success' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
wpdesk_init_notice_ajax_handler(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
wpdesk_notice_success( 'Success notice.' ); | |
wpdesk_notice_info( 'Info notice.' ); | |
wpdesk_notice_warning( 'Warning notice.' ); | |
wpdesk_notice_error( 'Error notice.' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once 'wp-desk/wp-notice/init.php'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once 'vendor/autoload.php'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
composer require wpdesk/wp-notice |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function wpdesk_permanent_dismisible_info_notice_for_administrator() { | |
$notice name = 'admin_notice'; | |
if ( intval( get_option( 'wpdesk_notice_dismiss_' . $notice_name, 0 ) ) !== 1 ) { | |
$user = wp_get current_user(); | |
if ( in_array( 'administrator', $user->roles ) ) { | |
?> | |
<div class="notice notice-info is-dismissible" data-notice-name="<?php echo $notice_name; ?>"> | |
<p>Info notice for administrator.</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function wpdesk_dismisible_info_notice_for_administrator() { | |
$user = wp_get current_user(); | |
if ( in_array( 'administrator', $user->roles ) ) { | |
?> | |
<div class="notice notice-info is-dismissible"> | |
<p>Info notice for administrator.</p> | |
</div> | |
<?php |
NewerOlder