Skip to content

Instantly share code, notes, and snippets.

@wp126
wp126 / gravity form with wp_user_query
Created November 17, 2022 07:46
gravity form with wp_user_query
if ( !empty( $_GET['branch'] ) ) {
add_action( 'pre_user_query', 'add_my_custom_queries' );
}
$user_query = new WP_User_Query( $arr );
if ( !empty( $_GET['branch'] ) ) {
remove_action( 'pre_user_query', 'add_my_custom_queries' );
}
function add_my_custom_queries( $query ) {
global $wpdb;
https://codepen.io/atelierbram/pen/LRZrxQ
<?php
if (!defined('_PS_ADMIN_DIR_')) {
define('_PS_ADMIN_DIR_', __DIR__);
}
include _PS_ADMIN_DIR_.'/../config/config.inc.php';
$id_lang=2;
$start=3001;
$limit=4000;
$order_by='id_product';
<?php
add_action('wp', 'mysialus');
function mysialus(){
if(!is_admin()){
if(!is_user_logged_in()){
if(!is_page(1587)){
wp_redirect( get_permalink(1587));
exit;
}
}
@wp126
wp126 / google anyalytice event and facebook pixel on contact form 7
Created April 24, 2023 04:01
google anyalytice event and facebook pixel on contact form 7
<!-- Meta Pixel Code -->
<script>
!function(f,b,e,v,n,t,s)
{if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};
if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];
s.parentNode.insertBefore(t,s)}(window, document,'script',
'https://connect.facebook.net/en_US/fbevents.js');