Skip to content

Instantly share code, notes, and snippets.

@adczk
adczk / forminator-userreg-post-author.php
Created August 18, 2022 10:12
Forminator - newly registered user as post author of new post (user registration form with postdata on it)
<?php
/*
Forminator - set new user as author of new post
This is only for user registration forms that also have postdata field
and have user activation set to "default"
Tested with Forminator 1.17.2
by adamcz/WPMU DEV
@adczk
adczk / forminator-acf-chekbox-comaptibility.php
Created August 31, 2022 16:23
Forminator - ACF checkbox compatibility
<?php
/*
* *
* makes Forminator's "post data" custom field checkbox
* compatible with ACF checkbox
*
*1. post data custom field label must be same as name of ACF checkbox field
*2. and it has to be mapped to a chekbox form field
*3. $chekboxes array should contain names of ACF chekcbox fields (same as set as labels in postdata custom fields)
@adczk
adczk / forminator-upload-display-shortcode-multisite.php
Created September 13, 2022 10:06
Forminator - custom logo/image upload and shortcode display on multisite
<?php
/* tested with Forminator 1.18
use as MU plugin */
add_shortcode('custom-site-logo', 'my_custom_site_logo' );
function my_custom_site_logo() {
$logo_url = get_option( 'frmt_site_custom_logo' );
@adczk
adczk / forminator-poll-only-loggedin-vode.php
Created October 20, 2022 11:00
Forminator 1.18+ - allow poll votes only for logged-in users
<?php
/**
* Plugin Name: [Forminator] Disallow guests to vote in polls
* Plugin URI: https://premium.wpmudev.org/
* Description: This plugin disables voting for guest users (as of 1.10.2)
* Author: Alessandro Kaounas @ WPMUDEV
* Author URI: https://premium.wpmudev.org/
* License: GPLv2 or later
*
* updated on Oct 20, 2022 to work wtih Forminator 1.18+
@adczk
adczk / forminator-submission-id-in-post-custom-field.php
Created January 23, 2023 11:10
Forminator - save submission id (entry id) in custom field upon post creation
<?php
/*
Forminator - save submission ID in posts custom field upon new post creation
This is only post creation forms
Tested with Forminator 1.22.1
by adamcz/WPMU DEV
USE AS MU PLUGIN
Config explained in comments
@adczk
adczk / forminator-textarea-minimu-words-limit.php
Created January 25, 2023 10:19
Forminator - textarea minimum words limit
<?php
/**
* Plugin Name: [Forminator] Set minimum number of words limit for textarea field
* Plugin URI: https://premium.wpmudev.org/
* Description: Sets minium number of words for textarea field
* Author: adczk
* Author URI: https://premium.wpmudev.org/
* License: GPLv2 or later
*
@adczk
adczk / forminator-knowledge-quiz-score-based-result-message.php
Created January 27, 2023 11:19
Forminator - customize knowledge quiz result message depending on score
<?php
/**
* Plugin Name: [Forminator] Set minimum number of words limit for textarea field
* Plugin URI: https://premium.wpmudev.org/
* Description: Sets minium number of words for textarea field
* Author: adczk
* Author URI: https://premium.wpmudev.org/
* License: GPLv2 or later
*
@adczk
adczk / forminator-prevent-duplicate-data-entry.php
Created February 8, 2023 15:57
Forminator - validate if same data for given fields was already submitted and prevent duplicated submission
<?php
/**
* Plugin Name: [Forminator] Check submission duplicated data
* Plugin URI: https://premium.wpmudev.org/
* Description: check if entry with same data (per defined field) already exists and prevent such duplicated data submission
* Author: adczk
* Author URI: https://premium.wpmudev.org/
* License: GPLv2 or later
*
@adczk
adczk / forminator-schedule-form.php
Last active February 20, 2023 08:43
Forminator - schedule rendering form on page
<?php
/**
* Plugin Name: [Forminator] Schedule rendering form on page (form must be already published)
* Plugin URI: https://premium.wpmudev.org/
* Description: Allows rendering form according to schedule (show/hide)
* Author: adczk
* Author URI: https://premium.wpmudev.org/
* License: GPLv2 or later
*
* Tested with Forminator 1.17.0 - 1.23.0
@adczk
adczk / forminator-select-cpt-options.php
Created February 21, 2023 12:51
[Forminator] populate select field with posts and calculation value
<?php
/**
* Plugin Name: [Forminator] populate select field with posts and calculation value
* Plugin URI: https://premium.wpmudev.org/
* Description: Populates select field with posts of selected type (label = post title,
* value = post ID ) and sets calculation values for select options based on selected ACF custom post field
* Author: adczk (with adjustments of Prashant Singh)
* Author URI: https://premium.wpmudev.org/
* License: GPLv2 or later
*