Plugin Directory

Changeset 3491589


Ignore:
Timestamp:
03/26/2026 08:45:30 AM (2 days ago)
Author:
wpdevelop
Message:

Update 10.15.3

Location:
booking/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • booking/trunk/includes/page-form-builder/save-load/bfb-activate.php

    r3491564 r3491589  
    543543
    544544
    545 
    546 
     545/**
     546 * Remove BFB Preview page from rendered nav menus.
     547 *
     548 * @param array    $sorted_menu_items Menu item objects.
     549 * @param stdClass $args              Menu args.
     550 *
     551 * @return array
     552 */
     553function wpbc_bfb_preview__exclude_from_nav_menus( $sorted_menu_items, $args ) {
     554
     555    $page_id = absint( get_option( wpbc_bfb_activation__get_preview_page_option_key() ) );
     556
     557    if ( $page_id <= 0 ) {
     558        return $sorted_menu_items;
     559    }
     560
     561    $filtered_items = array();
     562
     563    foreach ( $sorted_menu_items as $menu_item ) {
     564
     565        $object_id = isset( $menu_item->object_id ) ? absint( $menu_item->object_id ) : 0;
     566        $object    = isset( $menu_item->object ) ? (string) $menu_item->object : '';
     567
     568        if ( ( 'page' === $object ) && ( $page_id === $object_id ) ) {
     569            continue;
     570        }
     571
     572        $filtered_items[] = $menu_item;
     573    }
     574
     575    return $filtered_items;
     576}
     577add_filter( 'wp_nav_menu_objects', 'wpbc_bfb_preview__exclude_from_nav_menus', 10, 2 );
     578
     579
     580/**
     581 * Exclude BFB Preview page from wp_list_pages() outputs.
     582 *
     583 * @param array $exclude_array Excluded page IDs.
     584 *
     585 * @return array
     586 */
     587function wpbc_bfb_preview__exclude_from_page_lists( $exclude_array ) {
     588
     589    $page_id = absint( get_option( wpbc_bfb_activation__get_preview_page_option_key() ) );
     590
     591    if ( $page_id > 0 ) {
     592        $exclude_array[] = $page_id;
     593    }
     594
     595    return array_unique( array_map( 'absint', $exclude_array ) );
     596}
     597// add_filter( 'wp_list_pages_excludes', 'wpbc_bfb_preview__exclude_from_page_lists' );
     598
     599// FixIn: 10.15.3.1.
     600/**
     601 * Check whether current request is the BFB Preview page request.
     602 *
     603 * @return bool
     604 */
     605function wpbc_bfb_is_preview_request() {
     606
     607    if ( empty( $_GET['wpbc_bfb_preview'] ) ) {                              // phpcs:ignore WordPress.Security.NonceVerification.Recommended
     608        return false;
     609    }
     610
     611    return ( '1' === sanitize_text_field( wp_unslash( $_GET['wpbc_bfb_preview'] ) ) );   // phpcs:ignore WordPress.Security.NonceVerification.Recommended
     612}
     613
     614/**
     615 * Add noindex / noarchive robots directives for BFB Preview.
     616 *
     617 * @param array $robots Robots directives.
     618 *
     619 * @return array
     620 */
     621function wpbc_bfb_preview__wp_robots( $robots ) {
     622
     623    if ( ! wpbc_bfb_is_preview_request() ) {
     624        return $robots;
     625    }
     626
     627    return wp_robots_sensitive_page( $robots );
     628}
     629add_filter( 'wp_robots', 'wpbc_bfb_preview__wp_robots' );
     630
     631/**
     632 * Send no-cache headers for BFB Preview responses.
     633 *
     634 * @return void
     635 */
     636function wpbc_bfb_preview__nocache_headers() {
     637
     638    if ( ! wpbc_bfb_is_preview_request() ) {
     639        return;
     640    }
     641
     642    if ( ! headers_sent() ) {
     643        nocache_headers();
     644    }
     645}
     646add_action( 'template_redirect', 'wpbc_bfb_preview__nocache_headers', 1 );
    547647
    548648/**
  • booking/trunk/readme.txt

    r3491564 r3491589  
    66Requires PHP: 5.6
    77Tested up to: 7.0
    8 Stable tag: 10.15.2
     8Stable tag: 10.15.3
    99License: GPLv2 or later
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    336336
    337337== Changelog ==
     338= 10.15.3 =
     339- Changes in **all** versions:
     340    * **Fix**: Exclude the Preview page from nav menus (10.15.3.1)
     341
    338342= 10.15.2 =
    339343- Changes in **all** versions:
    340     * **New**: Force a safe template for the BFB Preview page. (10.15.2.1)
     344    * **Fix**: Force a safe template for the BFB Preview page. (10.15.2.1)
    341345
    342346= 10.15.1 =
  • booking/trunk/wpdev-booking.php

    r3491564 r3491589  
    88Text Domain: booking
    99Domain Path: /languages/
    10 Version: 10.15.2
     10Version: 10.15.3
    1111License: GPLv2 or later
    1212*/
     
    3535
    3636if ( ! defined( 'WP_BK_VERSION_NUM' ) ) {
    37     define( 'WP_BK_VERSION_NUM', '10.15.2' );
     37    define( 'WP_BK_VERSION_NUM', '10.15.3' );
    3838}
    3939if ( ! defined( 'WP_BK_MINOR_UPDATE' ) ) {
Note: See TracChangeset for help on using the changeset viewer.