Skip to content

Instantly share code, notes, and snippets.

View apsolut's full-sized avatar
🎯
Focusing

Aleksandar Perisic apsolut

🎯
Focusing
View GitHub Profile
@apsolut
apsolut / loop-acf-tax-term-list-loop.php
Last active September 1, 2021 09:28
ACF taxonomy terms to LIST - WordPress Loop
<?php
/**
WordPress loop
Taxonomy and Terms
*/
$faq_object = get_sub_field('section_faq_category');
if( $faq_object ):
foreach ( $faq_object as $faq_object_single ) {
$tax_id_convert = $faq_object_single->term_id;
$tax_id_all[] = $tax_id_convert;
@apsolut
apsolut / wp-get-page-link-url-slug.php
Created June 24, 2021 08:35
WP Get page url by slug name child
@apsolut
apsolut / gulp-zip-files.js
Created May 4, 2021 13:36
gulp zip files and ignore node_modules
const { src, dest, series, parallel } = require('gulp');
const plumber = require('gulp-plumber');
const zip = require('gulp-zip');
/*--- Extras ----------*/
function ziptheme(cb) {
const timestamps = Date.now();
console.log(timestamps)
return src(['./*/**/**', '!node_modules/**/**'])
.pipe(plumber())
@apsolut
apsolut / editor-allow-gf.php
Created April 23, 2021 19:29
Editor allow GravityForms
<?php
function add_gf_cap()
{
$role = get_role( 'editor' );
$role->add_cap( 'gform_full_access' );
}
add_action( 'admin_init', 'add_gf_cap' );
@apsolut
apsolut / change_link.php
Created March 12, 2021 15:50 — forked from igorbenic/change_link.php
Custom WordPress Rewrite Rule to Combine Taxonomy and Post Type | www.ibenic.com/custom-wordpress-rewrite-rule-combine-taxonomy-post-type
@apsolut
apsolut / adblock-blocking-divs.css
Last active February 10, 2021 17:19
adblock blocking divs
.rngtAd,
.rockmelt-ad,
.rockmeltAdWrapper,
.rolloverad,
.rot_ads,
.rotating-ad,
.rotating-ads,
.rotatingAdvertisement,
.rotatingBannerWidget,
.rotatingadsection,
<?php
if(isset($_POST['login'])) {
if(!isset($_POST['g-recaptcha-response']) || empty($_POST['g-recaptcha-response'])) {
echo 'reCAPTHCA verification failed, please try again.';
} else {
$secret = 'google_secret_key';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://www.google.com/recaptcha/api/siteverify?secret='.$secret.'&response='.$_POST['g-recaptcha-response']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
@apsolut
apsolut / wp-query-ref.php
Created December 30, 2020 14:59 — forked from luetkemj/wp-query-ref.php
WP: Query $args
// This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.github.io
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php
*/
@apsolut
apsolut / criticalcss-bookmarklet-devtool-snippet.js
Created December 30, 2020 14:52 — forked from PaulKinlan/criticalcss-bookmarklet-devtool-snippet.js
CriticalCSS Bookmarklet and Devtool Snippet.js
(function() {
var CSSCriticalPath = function(w, d, opts) {
var opt = opts || {};
var css = {};
var pushCSS = function(r) {
if(!!css[r.selectorText] === false) css[r.selectorText] = {};
var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/);
for(var i = 0; i < styles.length; i++) {
if(!!styles[i] === false) continue;
var pair = styles[i].split(": ");