View duplicate_posts.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Duplicate Posts and Pages | |
Description: slightly modified wpcb repo snippet | |
*/ | |
// Security | |
if ( ! defined( 'ABSPATH' ) ) : exit; endif; | |
function apuri_duplicate_post_as_draft(){ |
View cardWithModal.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"modules":{"u8488fbe2d":{"id":"u8488fbe2d","name":"HtmlElement","label":"article","settings":[{"name":"borderRadius","value":{"all":{"original":{"a1":"12","a2":"12","a3":"12","a4":"12","b1":"px","b2":"px","b3":"px","b4":"px"}}}},{"name":"border","value":{"all":{"original":{"d1":"#959595","c1":"dashed","d2":"#959595","b1":"px","c2":"dashed","d3":"#959595","b2":"px","c3":"dashed","d4":"#959595","a1":"3","b3":"px","c4":"dashed","a2":"3","b4":"px","a3":"3","a4":"3"}}}},{"name":"padding","value":{"all":{"original":{"a1":"2","a2":"2","a3":"2","a4":"2","b1":"rem","b2":"rem","b3":"rem","b4":"rem"}}}},{"name":"maxWidth","value":{"all":{"original":{"a1":"20","b1":"ch"}}}},{"name":"margin","value":{"all":{"original":{"b4":"auto","b2":"auto","a1":"2","b1":"rem","a3":"2","b3":"rem"}}}},{"name":"htmlElementTag","value":{"a1":"article"}},{"name":"isLinkWrapper","value":{"a1":false}}],"parent":""},"u75d9743bc":{"id":"u75d9743bc","name":"HtmlElement","label":"div","settings":[{"name":"gap","value":{"all":{"original":{"a1":"1 |
View googleSheetsEndpoint.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getSheetDataAsJSON() { | |
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); | |
var range = sheet.getDataRange(); | |
var values = range.getValues(); | |
var headers = values[0]; | |
var jsonData = []; | |
for (var i = 1; i < values.length; i++) { | |
var row = values[i]; | |
var rowObj = {}; |
View email-obuscation.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Security | |
if ( ! defined( 'ABSPATH' ) ) : exit; endif; | |
function publication_email_link() { | |
global $post; | |
$title = get_the_title($post->ID); | |
$link = get_the_permalink($post->ID); |
View sticky-accordions.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.gb-accordion .gb-button { | |
position: sticky; | |
top: 100px; | |
z-index: 5; | |
background-color: var(--base); | |
} | |
.admin-bar .gb-accordion .gb-button { | |
top: 132px; | |
} |
View html_cleanup_with_regexp.any
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style\b[^<]*>[\s\S]*?<\/style\b[^<]*>|<((?!(?:a|h[1-6]|p|strong|em|img|span)\b)\w+[^>]*)>|<\/?(?:div|section|link|span)\b[^>]*>|class\s*=\s*"[^"]*"|id\s*=\s*"[^"]*"|style\s*=\s*"[^"]*"|data-[^=]+="[^"]*"|\s+$|\t| |<\w+\b[^>]*><\/\w+\b[^>]*>|<\w+\b[^>]*><\/\w+\b[^>]*>\s*|<\/span> |
View remove_wpbakery_enfold_shortcodes.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function remove_shortcodes_from_post_content($content) { | |
// Define the pattern to match the shortcodes | |
$pattern = '/\[(\/)?(vc_|av_)[^\]]*\]/'; | |
// Remove the shortcodes from the content using preg_replace | |
$clean_content = preg_replace($pattern, '', $content); | |
return $clean_content; |
View gb-accordion-custom.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this file is a part of learning process so this file will be changed as I learn stuff :) | |
const iconAttributes = { | |
iconLocation: 'right', | |
columnGap: '0.5em', | |
iconSize: 0.8, | |
iconPaddingRight: '', | |
display: 'flex', | |
alignItems: 'center', | |
justifyContent: 'space-between', | |
sizing: { width: '100%' }, |
View overlay.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.overlay { | |
transform: scale(0); | |
} | |
.overlay.show { | |
transform: scale(1); | |
} | |
.overlay.show.not { | |
transform: scale(0); | |
} |
View acf_postobject_controls_gb_query.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// remove the top function it is used only to inspect the array so one can figure it out | |
function apuri_get_your_elements() { | |
$post_obs = get_field('front_posts'); | |
?> | |
<pre style="min-height: 100vh; display: flex; flex-direction: column; align-items: flex-start; text-align: left;"> | |
<h2 style="margin-top: 90px" >Check the array content</h2> | |
NewerOlder