Search Documentation

WP Travel Developer Documentation

  1. Home
  2. Docs
  3. WP Travel Developer Documentation
  4. Filters Associated With Admin
  5. Filter :wp_travel_deprecated_admin_notice

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' );
Was this article helpful to you? Yes No

How can we help?