Skip to content

Instantly share code, notes, and snippets.

View hivepress's full-sized avatar

HivePress hivepress

View GitHub Profile
@hivepress
hivepress / functions.php
Created April 26, 2022 11:00
Make attachments optional for marketplace listings #hivepress #marketplace
<?php
add_filter(
'hivepress/v1/models/listing/attributes',
function( $attributes ) {
if ( isset( $attributes['attachments'] ) ) {
$attributes['attachments']['edit_field']['required'] = false;
}
return $attributes;
},
@hivepress
hivepress / style.css
Created April 26, 2022 15:56
Hide the Post a Request button #hivepress #requests
.hp-menu--site-header .hp-menu__item--request-submit{
display: none;
}
@hivepress
hivepress / style.css
Created April 26, 2022 16:02
Hide the listing category description #hivepress #listings
.hp-listing-category--view-block .hp-listing-category__description{
display: none;
}
@hivepress
hivepress / functions.php
Created April 26, 2022 16:17
Change the listing description position (order) on a page #hivepress #listings
<?php
add_filter(
'hivepress/v1/templates/listing_view_page',
function( $template ) {
return hivepress()->helper->merge_trees(
$template,
[
'blocks' => [
'listing_description' => [
'_order' => 123,
@hivepress
hivepress / functions.php
Created April 26, 2022 16:40
Change the Keywords field placeholder in the listing search form #hivepress #listings
<?php
add_filter(
'hivepress/v1/forms/listing_search',
function( $form ) {
if ( isset( $form['fields']['s'] ) ) {
$form['fields']['s']['placeholder'] = 'custom text here';
}
return $form;
},
@hivepress
hivepress / functions.php
Created April 26, 2022 16:48
Change the columns number on the listing search page #hivepress #listings
<?php
add_filter(
'hivepress/v1/templates/listings_view_page',
function( $template ) {
return hivepress()->helper->merge_trees(
$template,
[
'blocks' => [
'listings' => [
'columns' => 3,
@hivepress
hivepress / functions.php
Created April 26, 2022 16:52
Set the default time slot duration #hivepress #bookings
<?php
add_filter(
'hivepress/v1/forms/listing_update',
function( $form ) {
if ( isset( $form['fields']['booking_slot_duration'] ) ) {
$form['fields']['booking_slot_duration']['default'] = 123;
}
return $form;
},
@hivepress
hivepress / functions.php
Created April 26, 2022 17:12
Hide the booking note field #hivepress #bookings
<?php
add_filter(
'hivepress/v1/forms/booking_update',
function ( $form ) {
unset($form['fields']['note']);
return $form;
},
1000
);
@hivepress
hivepress / style.css
Created April 26, 2022 17:16
Hide map on the single listing page #hivepress #geolocation
.hp-template--listing-view-page .hp-map {
display: none;
}
@hivepress
hivepress / functions.php
Created April 26, 2022 17:19
Change the opening hours field order in the listing edit form #hivepress #opening-hours
<?php
add_filter(
'hivepress/v1/forms/listing_update',
function( $form ) {
if ( isset( $form['fields']['opening_hours'] ) ) {
$form['fields']['opening_hours']['_order'] = 123;
}
return $form;
},