Skip to content

Instantly share code, notes, and snippets.

View Mediteranija's full-sized avatar
:shipit:
Exploring...

Miljenko Bulaš Mediteranija

:shipit:
Exploring...
View GitHub Profile
@tdrayson
tdrayson / populate-dropdown.php
Created August 23, 2022 09:54
Populate ACF dropdown with Fluent forms
<?php
/*
Instructions
Replace YOUR_ACF_FIELD with the name of your acf select dropdown key
Add to functions.php or code snippets plugin
Forms will load sorted by Title in ASC order (A to Z)
@thisbit
thisbit / sticky-nav.css
Last active June 23, 2022 21:42
Custom Sticky bar instead of GeneratePress jQuery solution
/**
* Enqueue this file like the above or use WPCodeBox snippets plugin to do it, or add it to customizer custom CSS box
*/
/* custom sticky header */
.main-navigation {
transition: all ease .5s;
position: fixed;
top: 0;
left:0;
@techjewel
techjewel / protect_login_for_admin_roles.php
Last active October 28, 2021 08:34
Code snippet to reject login for admin/authors from the regular login url
<?php
/*
* Code snippet to reject login for admin/authors from the regular login url
* In this example, people who have edit_posts permission is require special url string to login
* The URL need to be: https://yourdomain.com/wp-login.php?salt=your_random_url_string
* For normal users they can login without the special salt
* But If author or admin try to login it will reject the authentication
*
*/
@wplit
wplit / code-block.php
Created March 10, 2021 03:50
output woocommerce gallery images. (inside product builder inside a code block)
<?php
global $product;
$image_size = 'medium'; /* Image size */
$attachment_ids = $product->get_gallery_image_ids();
foreach( $attachment_ids as $attachment_id ) {
jQuery('.readonly').attr('readonly', 'true');
@Rados51
Rados51 / repeater-id-fix.js
Last active October 12, 2021 22:21
Synced via Snip
// All styling have to be inside a class
(function ($) {
let repeaterIdName = $(".oxy-dynamic-list").find("*").attr("id");
let repeaterIdCount = 1;
$(function () {
$(".oxy-dynamic-list")
.find("div")
.each(function (i) {
if ($(this).attr("class").includes("ct-div-block")) {
$(this).attr({ id: `${repeaterIdName}-${repeaterIdCount}` });
/*
* JS snippet to match two fields value as same
* Example: Email and Confirm Email need to be same
* Placement: Place the following code in your form -> Settings & Integrations -> Custom CSS/JS -> Custom Javascript BOX
*/
var $email = $form.find('input[name=email]'); // Name of the first Email Address
var $confirmEmail = $form.find('input[name=confirm_email]'); // Name of the Confirm Email Address
$confirmEmail.on('blur', function() {
$shortcodeDefaults = apply_filters('fluentform_info_shortcode_defaults', array(
'id' => null, // This is the form id
'info' => 'submission_count', // submission_count | created_at | updated_at | payment_total
'status' => 'all', // get submission count of a particular entry status favourites | unread | read
'with_trashed' => 'no', // yes | no
'substract_from' => 0, // [fluentform_info id="2" info="submission_count" substract_from="20"]
'hide_on_zero' => 'no',
'payment_status' => 'paid', // paid | all | pending | failed
'currency_formatted' => 'yes',
'date_format' => ''
@yankiara
yankiara / oxygen-repeater-dynamic-query.php
Last active September 6, 2023 19:25
Use dynamic queries with Oxygen's repeater
/* I'll put here different examples of dynamic query for Oxygen repeater :
* - Use one of the following repeater_dynamic_query definitions
* in code block just BEFORE the repeater
* - Set the repeater custom query settings : post type, number of posts, order...
* - Add the remove_action in a code block AFTER the repeater
*/
/****************************************************************************************************
* Display related posts for any CPT with taxonomy:
@wplit
wplit / code-block.js
Created August 20, 2019 06:58
remove IDs from repeater component in Oxygen (to remove Lighthouse Error)
jQuery(".oxy-dynamic-list").find("*").removeAttr('id');