Skip to content

Instantly share code, notes, and snippets.

Avatar

HivePress hivepress

View GitHub Profile
@hivepress
hivepress / functions.php
Created April 26, 2022 21:28
Change the maximum number of images per request #hivepress #requests
View functions.php
<?php
add_filter(
'hivepress/v1/models/request',
function( $model ) {
$model['fields']['images']['max_files'] = 123;
return $model;
},
100
);
@hivepress
hivepress / functions.php
Last active January 30, 2023 21:12
Change the maximum number of images per listing #hivepress #listings
View functions.php
<?php
add_filter(
'hivepress/v1/models/listing',
function( $model ) {
$model['fields']['images']['max_files'] = 123;
return $model;
},
100
);
@hivepress
hivepress / functions.php
Created April 27, 2022 10:16
Change the Add Listing page URL slug (requires refreshing permalinks) #hivepress #listings
View functions.php
<?php
add_filter('hivepress/v1/routes', function($routes) {
$routes['listing_submit_page']['path']='/custom-slug-here';
return $routes;
}, 1000);
@hivepress
hivepress / functions.php
Created April 26, 2022 18:16
Change the request URL slug (requires refreshing permalinks) #hivepress #requests
View functions.php
<?php
add_filter(
'hivepress/v1/post_types',
function( $args ) {
if ( isset( $args['request'] ) ) {
$args['request']['rewrite']['slug'] = 'custom-slug-here';
}
return $args;
},
@hivepress
hivepress / functions.php
Created April 27, 2022 10:34
Enable rich text (HTML) editor for the vendor description #hivepress #vendors
View functions.php
<?php
add_filter(
'hivepress/v1/models/vendor',
function( $model ) {
$model['fields']['description']['editor'] = true;
return $model;
},
1000
);
@hivepress
hivepress / functions.php
Created April 27, 2022 10:17
Add a custom checkbox to the user registration form #hivepress #users
View functions.php
<?php
add_filter(
'hivepress/v1/forms/user_register',
function( $form ) {
$form['fields']['custom_name_here'] = [
'caption' => 'custom text here',
'type' => 'checkbox',
'_order' => 123,
];
@hivepress
hivepress / functions.php
Created December 7, 2022 15:55
Change the Add Details page title for listings #hivepress #listings
View functions.php
<?php
add_filter(
'hivepress/v1/routes',
function( $routes ) {
$routes['listing_submit_details_page']['title'] = 'Custom title here';
return $routes;
},
1000
);
@hivepress
hivepress / style.css
Created April 26, 2022 16:32
Hide map on the listings search page #hivepress #listings
View style.css
.hp-template--listings-view-page .hp-map {
display: none;
}
@hivepress
hivepress / functions.php
Created April 26, 2022 16:13
Enable rich text (HTML) editor for the listing description #hivepress #listings
View functions.php
<?php
add_filter(
'hivepress/v1/models/listing',
function( $model ) {
$model['fields']['description']['editor'] = true;
return $model;
},
1000
);
@hivepress
hivepress / functions.php
Created April 26, 2022 16:58
Add first and last name fields to the user registration form #hivepress #users
View functions.php
<?php
add_filter(
'hivepress/v1/forms/user_register',
function ( $form ) {
$form['fields'] = array_merge(
$form['fields'],
[
'first_name' => [
'required' => true,
'_order' => 1,