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 | |
add_action( 'template_redirect', function () { | |
if ( ! is_404() ) { | |
return; | |
} | |
$path = trim( $_SERVER['REQUEST_URI'] ?? '', '/' ); | |
if ( $path === 'your-deleted-page' ) { | |
status_header( 410 ); |
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 | |
/** | |
* Block: Hero | |
* -------------------------------- | |
* The hero block for all pages. | |
*/ | |
$block_data = get_fields(); | |
?> |
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 | |
// This code shows a simple meta box with a simple text, no inputs. | |
// And the "Update" button in WordPress is always active, e.g. never disabled, even if there's no changes, no updates. | |
add_action( 'add_meta_boxes', function() { | |
add_meta_box( 'test', 'Test', 'my_callback_func', 'post' ); | |
} ); | |
function my_callback_func() { | |
echo 'Just a text, and the Update button is always active.'; | |
} |
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 | |
add_filter( "slim_seo_schema_article", function ( $schema ) { | |
unset( $schema['keywords'] ); | |
return $schema; | |
} ); |
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 | |
add_filter( 'slim_seo_schema_graph', function( $graph ) { | |
foreach( $graph as &$schema ) { | |
list( $url ) = explode( '#', $schema['@id'] ); | |
$schema['@id'] = $url; | |
} | |
return $graph; | |
}, 20 ); |
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 | |
add_action( 'mb_relationships_init', function () { | |
MB_Relationships_API::register( [ | |
'id' => 'users_to_posts', | |
'from' => [ | |
'object_type' => 'user', | |
'field' => [ | |
'field_type' => 'checkbox_list', | |
], | |
], |
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
if ( ! get_option( 'rwmb_bookings' ) ) { | |
add_option( 'rwmb_bookings', array() ); | |
} | |
add_action( 'rwmb_booking-fields_after_save_post', 'update_bookings_date' ); | |
function update_bookings_date( $post_id ) { | |
$bookings = get_post_meta( $post_id, 'group_booking', true ); |
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 get_header(); ?> | |
<div id="primary" class="content-area"> | |
<main id="main" class="site-main"> | |
<?php | |
while ( have_posts() ) : the_post(); | |
get_template_part( 'template-parts/content', 'single' ); | |
the_post_navigation(); | |
echo do_shortcode("[mb_frontend_form id='booking-fields' post_fields='title,content']"); |
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
jQuery( function($) { | |
setTimeout(function(){ | |
datepicker_reinstall(); | |
console.log(disable_dates); | |
}, 1000); | |
function datepicker_reinstall(){ | |
var dateFormat = "yy-mm-dd", | |
from = $( "#group_booking_check_in" ), | |
to = $( "#group_booking_check_out" ); |
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
<main id="Main"> | |
<div class="page-wrapper"> | |
<div class="container"> | |
<div class="row"> | |
<div id="menuBarleft" class="col-lg-3 col-sm-12"> | |
<div id="navbarNav" class="nav nav-tabs"> | |
<div id="v-pills-tab" class="nav flex-column nav-pills menu-left" role="tablist" aria-orientation="vertical"> | |
<?php $group_values = rwmb_meta( 'faq_tab' ); | |
$count = 0; | |
if ( ! empty( $group_values ) ) { |
NewerOlder