Skip to content

Instantly share code, notes, and snippets.

View alfredo-wpmudev's full-sized avatar
🏠
Working from home

Alfredo Galano Loyola alfredo-wpmudev

🏠
Working from home
View GitHub Profile
@alfredo-wpmudev
alfredo-wpmudev / forminator_sph_cyl_logic.php
Last active June 5, 2024 17:01
Forminator SPH and CYL Logic and conditionals
<?php
/*
Plugin Name: Forminator Lens SPH and CYL logic conditions
Version: 0.1
Description: Forminator Lens SPH and CYL logic conditions
Author: Alfredo Galano Loyola
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/
defined('ABSPATH') || exit;
@alfredo-wpmudev
alfredo-wpmudev / wpmudev_server_cache.php
Last active June 2, 2024 20:00
Clear Static Server Cache and Object Cache(Only site Administrators)
<?php
/**
* Plugin Name: WPMUDEV Hosting Clear Static Server Cache and Object Cache
* Description: Adds a button to the WordPress Admin Bar to clear WPMUDEV Hosting Static Server Cache and Object Cache.
* Version: 1.0
* Author: Alfredo Galano Loyola | WPMUDEV
* Author URI: https://wpmudev.com/
*/
function cwpai_add_clear_static_cache_button() {
@alfredo-wpmudev
alfredo-wpmudev / convert_csv_to_json.php
Last active May 26, 2024 19:14
Convert a CSV file with two columns, where column A is the source URL and column B is the destination
<?php
/**
* Settings your variables
* $csv_file handles the name of your CSV file.
* $csv_separator is the symbol used to sepparate the columns in the CSV file.
* $sc_redirect_file is the final file you will need to import in Smartcrawl Pro -> Tools -> URL Redirection
*/
$csv_file = "redirect_list.csv";
$csv_separator = ";";
$sc_redirect_file = "sc_redirect.json";
@alfredo-wpmudev
alfredo-wpmudev / redirect_guest_visitor.php
Last active May 23, 2024 04:58
Custom redirect for guest visitors and in logout.
<?php
/**
* Plugin Name: Custom Guess Redirector
* Description: Redirect guess visitor to the Home Page or custom page, same after user logout will be redirected to a custom page.
* Version: 1.0.0
* Author: Alfredo Galano Loyola
* Author URI: https://wpmudev.com
* License: GPL v2 or later
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
*/
@alfredo-wpmudev
alfredo-wpmudev / forminator_show_entries_ip.php
Created May 15, 2024 18:38
Show entry IP in the Forminator Submission without the need to add any extra fiekd
<?php
/**
* Plugin Name: [Forminator Pro] - Show IPs on the submission list
* Plugin URI: https://premium.wpmudev.org/
* Description: Show IPs on the submission list
* Author: Alfredo Galano Loyola | @WPMUDEV
* Author URI: https://premium.wpmudev.org/
* License: GPLv2 or later
*/
<?php
/**
* Plugin Name: [Forminator] - Pagination skip empty pages
* Plugin URI: https://premium.wpmudev.org
* Description: A custom snippet that allows skipping empty pages when Pagination is used.
* Task: SLS-2198
* Author: Panos Lyrakis @ WPMUDEV
* Author URI: https://premium.wpmudev.org
* License: GPLv2 or later
*/
@alfredo-wpmudev
alfredo-wpmudev / forminator_order_number.php
Last active May 13, 2024 03:17
Custom submission id as order number, available to display it with the tag {order}
<?php
/**
* Plugin Name: [Forminator] - Custom submission id as order number
* Description: [Forminator] - Custom submission id as order number, available to display it with the tag {order}
* Jira: SLS-224
* Author: Thobk | Alfredo Galano Loyola @ WPMUDEV
* Author URI: https://premium.wpmudev.org
* License: GPLv2 or later
*/
if (!defined('ABSPATH')) {
@alfredo-wpmudev
alfredo-wpmudev / forminator_webhook_submission_id_fix.php
Created April 30, 2024 17:18
A way to modify the values of data that will be send in Webhook, in this specific case the submission ID field is not sending the Entry ID, it's sending a default text
<?php
/**
* Plugin Name: [Forminator Pro] - Replace Submission ID before send Webook request
* Plugin URI: https://wpmudev.com/
* Description: Replace Submission ID before send Webook request
* Author: Alfredo Galano Loyola @ WPMUDEV
* Author URI: https://wpmudev.com/
* License: GPLv2 or later
*/
if (!defined('ABSPATH')) {
@alfredo-wpmudev
alfredo-wpmudev / Form_1_JSON.txt
Created April 29, 2024 20:42
Company Attendee Management with two forms
{"type":"form","data":{"fields":[{"id":"select-1","element_id":"select-1","form_id":"wrapper-4657-4128","parent_group":"","type":"select","options":[{"key":"9625-4626","label":"3M","value":"3M Thailand Limited.","default":"","error":""},{"key":"2770-6830","label":"AAA","value":"AAPICO Amata Co.,Ltd.","default":"","error":""},{"key":"8283-5587","label":"AAP","value":"AAPICO Plastics Public Company Limited","default":"","error":""},{"key":"6101-5467","label":"AAPICO","value":"AAPICO Hitech Public Co.,Ltd.","default":"","error":""},{"key":"5367-7931","label":"AATH","value":"AGC Automotive (Thailand) Co.,Ltd.","default":"","error":""},{"key":"7511-3969","label":"ACT1","value":"ATA Casting Technology Co.,Ltd.","default":"","error":""},{"key":"5294-7867","label":"ADVICS","value":"ADVICS Asia Pacific Co.,Ltd.","default":"","error":""},{"key":"8713-1275","label":"AIAP","value":"Aisin Asia Pacific Co.,Ltd.","default":"","error":""},{"key":"9833-3429","label":"AIC","value":"Asian Inoac Co.,Ltd.","default":"","error":""
@alfredo-wpmudev
alfredo-wpmudev / Form JSON
Created April 28, 2024 05:12
Form 2 Company Attendee List and Delete
{"type":"form","data":{"fields":[{"id":"select-1","element_id":"select-1","form_id":"wrapper-1015-7110","parent_group":"","type":"select","options":[{"label":"3M Thailand Limited.","value":597,"limit":"","key":"8606-4941"}],"cols":"12","conditions":[],"wrapper_id":"wrapper-1015-7110","hidden_behavior":"zero","value_type":"single","field_label":"Companies","options_bulk_editor":""}],"settings":{"pagination-header":"nav","paginationData":{"pagination-header-design":"show","pagination-header":"nav"},"formName":"Company Attendee List","version":"1.30.1","form-border-style":"none","form-padding":"","form-border":"","fields-style":"open","field-image-size":"custom","validation":"on_submit","akismet-protection":"0","form-style":"default","enable-ajax":"false","autoclose":"true","submission-indicator":"show","indicator-label":"Submitting...","form-type":"default","submission-behaviour":"behaviour-thankyou","thankyou-message":"Thank you for contacting us, we will be in touch shortly.","submitData":{"custom-submit-text