Skip to content

Instantly share code, notes, and snippets.

View tharlab's full-sized avatar
💭
I may be slow to respond.

Hary AK tharlab

💭
I may be slow to respond.
  • TharLab
  • east java
View GitHub Profile
@hivepress
hivepress / functions.php
Created February 20, 2023 21:17
Make the location field required in the listing search form #hivepress #geolocation
<?php
add_filter(
'hivepress/v1/forms/listing_search',
function( $form ) {
if ( isset( $form['fields']['location'] ) ) {
$form['fields']['location']['required'] = true;
}
return $form;
},
@hivepress
hivepress / functions.php
Created February 20, 2023 20:50
Restrict decimals in the payout request amount #hivepress #marketplace
<?php
add_filter(
'hivepress/v1/forms/payout_request',
function( $form ) {
$form['fields']['amount']['type'] = 'number';
$form['fields']['amount']['decimals'] = 0;
$form['fields']['amount']['min_value'] = 0;
return $form;
},
@xlplugins
xlplugins / WFACP_ReCaptcha_For_WC
Created February 10, 2023 13:32
Funnelkit Checkout comptability added with ReCaptcha For WC by Thirteen Web Solution
class WFACP_ReCaptcha_For_WC {
private $instance = null;
public function __construct() {
add_action( 'wfacp_template_load', [ $this, 'actions' ] );
}
public function is_enable() {
return class_exists( 'I13_Woo_Recpatcha' );
}
@hivepress
hivepress / functions.php
Created May 29, 2022 16:57
Add description to the note field in the order delivery form #hivepress #marketplace
<?php
add_filter(
'hivepress/v1/forms/order_deliver',
function( $form ) {
$form['fields']['note']['description'] = 'custom text here';
return $form;
},
1000
);
@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 May 4, 2022 20:18
Limit the maximum number of listings per user account #hivepress #listings
<?php
add_filter(
'hivepress/v1/forms/listing_submit/errors',
function( $errors, $form ) {
$listing = $form->get_model();
if ( $listing && $listing->get_user__id() ) {
$listing_count = \HivePress\Models\Listing::query()->filter(
[
'status__in' => [ 'publish', 'pending', 'draft' ],
@hivepress
hivepress / functions.php
Last active December 19, 2023 08:31
Hide the images field in the listing form #hivepress #listings
<?php
add_filter(
'hivepress/v1/forms/listing_update',
function( $form ) {
unset($form['fields']['images']);
return $form;
},
1000
);
@hivepress
hivepress / functions.php
Created April 27, 2022 09:53
Add description to the details field in the payout request form #hivepress #marketplace
<?php
add_filter(
'hivepress/v1/forms/payout_request',
function( $form ) {
$form['fields']['details']['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 / functions.php
Created April 27, 2022 09:02
Change maximum length of title and description for listings #hivepress #listings
<?php
add_filter(
'hivepress/v1/models/listing',
function( $model ) {
$model['fields']['title']['max_length'] = 123;
$model['fields']['description']['max_length'] = 123;
return $model;
}
);