Skip to content

Instantly share code, notes, and snippets.

View patrickfreitasdev's full-sized avatar

Patrick de Freitas patrickfreitasdev

View GitHub Profile
<div>
<div style="display: block; background-color: #ddd; color: black; padding: 10px;">
Name:
</div>
<div style="display: block; color: black; padding: 10px 20px;">{name-1}</div>
<div style="display: block; background-color: #ddd; color: black; padding: 10px;">
Email:
</div>
<div style="display: block; color: black; padding: 10px 20px;">{email-1}</div>
<?php
//Based on https://thereforei.am/2011/03/15/how-to-allow-administrators-to-edit-users-in-a-wordpress-network/
function mc_admin_users_caps( $caps, $cap, $user_id, $args ){
foreach( $caps as $key => $capability ){
if( $capability != 'do_not_allow' )
continue;
<?php
add_action( 'plugins_loaded', function(){
if ( ! defined( 'DEFENDER_VERSION' ) ) {
return; // Defender is not installed/enabled.
}
if ( ! class_exists( 'Defender_Legacy_IP_Detection' ) ) {
class Defender_Legacy_IP_Detection {
use WP_Defender\Traits\IP;
<?php
/**
** Script to assign post to new user when Post Data field and user registration are used together.
**/
if (!defined('ABSPATH'))
{
exit;
<?php
// Use [pmu_mail_render] shortcode
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
add_action(
'wp_ajax_forminator_save_builder',
<?php
add_action('wp_footer','custom_js_form_validation');
function custom_js_form_validation(){
?>
<script>
jQuery( document ).ready(function($) {
<?php
add_filter(
'forminator_cform_render_fields',
function( $wrappers, $model_id ) {
if( $model_id != 847 ){
return $wrappers;
}
$select_fields_data = array(
<?php
defined('ABSPATH') or die('What are you looking for?');
/** Handle the HTML */
function my_custom_header_branda_shortcode_function( ){
ob_start(); ?>