Free and Premium WordPress Plugins & Themes Forums WordPress Plugins Hotel Booking Auto fill in the ID in Divi
- This topic has 1 reply, 2 voices, and was last updated 3 years, 3 months ago by Andre Flores.
Viewing 2 posts - 1 through 2 (of 2 total)
- AuthorPosts
- July 29, 2021 at 11:28 am #1164000Ace SuaresParticipant
We use the mphb-divi plugin, it’s not listed in the forum.
If we use the Divi builder blocks for MPHB, you have to provide an ID. However, the blocks can be used in templates, and in that case, it is needed that the block fills in the ID by itself.
This is a very quick and dirty fix, but I think it could be done in a better way.
static function get_availability_calendar($args = array()){ $defaults = array( 'id' => '', 'monthstoshow' => '2,3', 'class' => '' ); $args = wp_parse_args($args, $defaults); // add this line. $args['id'] = get_the_ID(); if($args['id'] !== ''){ return do_shortcode('[mphb_availability_calendar class="'.$args['class'].'" id="'.$args['id'].'" monthstoshow="'.$args['monthstoshow'].'"]'); } return esc_html__('Please insert accommodation id.'); }
July 30, 2021 at 1:51 am #1164209Andre FloresModeratorHello Ace,
Thank you for sharing your insights, it is much appreciated. I will make sure to pass this information to our developers for further consideration.
Regards,
Andre - AuthorPosts
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.