Skip to content

Instantly share code, notes, and snippets.

View hivepress's full-sized avatar

HivePress hivepress

View GitHub Profile
@hivepress
hivepress / style.css
Last active January 30, 2024 07:04
Make the location link non-clickable for listings #hivepress #geolocation
.hp-listing--view-block .hp-listing__location a,
.hp-listing--view-page .hp-listing__location a {
pointer-events: none;
}
@hivepress
hivepress / functions.php
Created April 26, 2022 16:00
Remove the Location field from the listing search form #hivepress #geolocation
<?php
add_filter(
'hivepress/v1/forms/listing_search',
function( $form ) {
unset($form['fields']['location']);
return $form;
},
1000
);
@hivepress
hivepress / functions.php
Created July 14, 2022 21:26
Hide the booking request field in the listing form #hivepress #bookings
<?php
add_filter(
'hivepress/v1/forms/listing_update',
function( $form ) {
unset( $form['fields']['booking_moderated'] );
return $form;
},
1000
);
@hivepress
hivepress / functions.php
Created April 27, 2022 13:49
Hide the booking offset and window fields in the listing form #hivepress #bookings
<?php
add_filter(
'hivepress/v1/forms/listing_update',
function( $form ) {
unset( $form['fields']['booking_offset'] );
unset( $form['fields']['booking_window'] );
return $form;
},
1000
@hivepress
hivepress / functions.php
Last active January 12, 2024 09:31
Hide the description field in the listing edit form #hivepress #listings
<?php
add_filter(
'hivepress/v1/forms/listing_update',
function( $form ) {
unset( $form['fields']['description'] );
return $form;
},
1000
);
@hivepress
hivepress / functions.php
Created April 26, 2022 16:58
Add first and last name fields to the user registration form #hivepress #users
<?php
add_filter(
'hivepress/v1/forms/user_register',
function ( $form ) {
$form['fields'] = array_merge(
$form['fields'],
[
'first_name' => [
'required' => true,
'_order' => 1,
@hivepress
hivepress / functions.php
Created May 8, 2022 12:09
Add description to the user registration form #hivepress #users
<?php
add_filter(
'hivepress/v1/forms/user_register',
function( $form ) {
$form['description'] = 'custom text here';
return $form;
},
1000
);
@hivepress
hivepress / functions.php
Created April 27, 2022 09:11
Change the columns number of listings on the single vendor page #hivepress #vendors
<?php
add_filter(
'hivepress/v1/templates/vendor_view_page',
function( $template ) {
return hivepress()->helper->merge_trees(
$template,
[
'blocks' => [
'listings' => [
'columns' => 3,
@hivepress
hivepress / style.css
Last active January 5, 2024 15:29
Hide the Delete Listing link on the listing edit pages #hivepress #listings
.hp-template--listing-edit-page .hp-listing__action--delete,
.hp-template--listings-edit-page .hp-listing__action--delete {
display: none;
}
@hivepress
hivepress / functions.php
Created April 26, 2022 17:31
Add a custom item to the user account menu #hivepress #users
<?php
add_filter(
'hivepress/v1/menus/user_account',
function( $menu ) {
$menu['items']['custom_name_here'] = [
'label' => 'custom label here',
'url' => 'custom url here',
'_order' => 123,
];