Skip to content

Instantly share code, notes, and snippets.

Avatar

HivePress hivepress

View GitHub Profile
@hivepress
hivepress / functions.php
Created Apr 26, 2022
Make attachments optional for marketplace listings #hivepress #marketplace
View functions.php
<?php
add_filter(
'hivepress/v1/models/listing/attributes',
function( $attributes ) {
if ( isset( $attributes['attachments'] ) ) {
$attributes['attachments']['edit_field']['required'] = false;
}
return $attributes;
},
@hivepress
hivepress / functions.php
Created Apr 26, 2022
Change the price display format for marketplace listings #hivepress #marketplace
View functions.php
<?php
add_filter(
'hivepress/v1/models/listing/attributes',
function( $attributes ) {
if ( isset( $attributes['price'] ) ) {
$attributes['price']['display_format'] = '%value% / item';
}
return $attributes;
},
@hivepress
hivepress / style.css
Created Apr 26, 2022
Hide the Add Listing (List a Service, List a Property) button #hivepress #listings
View style.css
.hp-menu--site-header .hp-menu__item--listing-submit{
display: none;
}
@hivepress
hivepress / functions.php
Created Apr 26, 2022
Make the purchase note or booking note required #hivepress #marketplace #bookings
View functions.php
<?php
add_filter(
'hivepress/v1/forms/listing_update',
function( $form ) {
if(isset($form['fields']['purchase_note'])){
$form['fields']['purchase_note']['required'] = true;
}
return $form;
},
@hivepress
hivepress / style.css
Created Apr 26, 2022
Hide the Post a Request button #hivepress #requests
View style.css
.hp-menu--site-header .hp-menu__item--request-submit{
display: none;
}
@hivepress
hivepress / functions.php
Created Apr 26, 2022
Change the minimum password length for users #hivepress #users
View functions.php
<?php
add_filter(
'hivepress/v1/models/user',
function( $model ) {
$model['fields']['password']['min_length'] = 123;
return $model;
},
1000
);
@hivepress
hivepress / functions.php
Created Apr 26, 2022
Remove the Location field from the listing search form #hivepress #geolocation
View functions.php
<?php
add_filter(
'hivepress/v1/forms/listing_search',
function( $form ) {
unset($form['fields']['location']);
return $form;
},
1000
);
@hivepress
hivepress / style.css
Created Apr 26, 2022
Hide the listing category description #hivepress #listings
View style.css
.hp-listing-category--view-block .hp-listing-category__description{
display: none;
}
@hivepress
hivepress / functions.php
Created Apr 26, 2022
Make first and last name fields required for users #hivepress #users
View functions.php
<?php
add_filter(
'hivepress/v1/forms/user_update',
function( $form ) {
$form['fields']['first_name']['required'] = true;
$form['fields']['last_name']['required'] = true;
return $form;
},
1000
@hivepress
hivepress / functions.php
Created Apr 26, 2022
Change the listing region URL slug (requires refreshing permalinks) #hivepress #geolocation
View functions.php
<?php
add_filter(
'hivepress/v1/taxonomies',
function( $taxonomies ) {
if(isset($taxonomies['listing_region'])){
$taxonomies['listing_region']['rewrite']['slug'] = 'custom-slug-here';
}
return $taxonomies;
},