Filters Associated With Admin

Filter: wp_travel_display_critical_admin_notices #

Show critical admin notices or not.

Source

File: /inc/admin/admin-notices.php
Used by: /inc/admin/admin-notices.php

Parameters
Default is false.

Example:

function prefix_wp_travel_display_critical_admin_notices() {
    return true;
}
add_filter( 'wp_travel_display_critical_admin_notices', 'prefix_wp_travel_display_critical_admin_notices' );

Filter: wp_travel_admin_general_notice_page_screen_ids #

Show general admin notice on defined notice pages.

Source

File: /inc/admin/admin-notices.php
Used by: /inc/admin/admin-notices.php

Parameters
$notice_pages

Example:

function prefix_wp_travel_admin_general_notice_page_screen_ids( $notice_pages ) {
    $notice_pages[] = ‘custom-page’;
    return $notice_pages;
}
add_filter( 'wp_travel_admin_general_notice_page_screen_ids', 'prefix_wp_travel_admin_general_notice_page_screen_ids' );

Filter: wp_travel_display_general_admin_notices #

Show general admin notices or not.

Source

File: /inc/admin/admin-notices.php
Used by: /inc/admin/admin-notices.php

Parameters
Default is false.

Example:

function prefix_wp_travel_display_general_admin_notices() {
    return true;
}
add_filter( 'wp_travel_display_general_admin_notices', 'prefix_wp_travel_display_general_admin_notices' );

Filter: wp_travel_deprecated_admin_notice #

Deprecated notice on admin.

Source

File: /inc/admin/admin-notices.php
Used by: /inc/admin/admin-notices.php

Parameters
$notices

Example:

function prefix_wp_travel_deprecated_admin_notice() {
    $screen = get_current_screen();
    $post_id = get_the_ID();
    if ( WP_TRAVEL_POST_TYPE === $screen->post_type &&
    $screen->parent_base == 'edit' && ( isset( $_GET['action'] ) &&
    'edit' === $_GET['action'] ) && $post_id ) {
    if ( $post_id ) {
    $pricing_option_type =
    wp_travel_get_pricing_option_type( $post_id );
    if ( 'single-price' === $pricing_option_type ) {
    $notices[] = __( 'Single Pricing is
    deprecated and will be removed in future versions of WP Travel.
    Please update your pricing to multiple pricing.', 'wp-travel' );
    }
    }
    }
    return $notices;
}
add_filter( 'wp_travel_deprecated_admin_notice', 'prefix_wp_travel_deprecated_admin_notice' );