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
/* Rankmath's breadcrumb style customization */ | |
.layout-1c .rank-math-breadcrumb .wrap { | |
margin-left: auto; | |
margin-right: auto; | |
max-width: 1260px; | |
} | |
.rank-math-breadcrumb { | |
text-align: center; | |
font-size: 0.75em; |
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 | |
/** | |
* Plugin Name: Auto Complete Virtual Orders | |
* Description: Conclui automaticamente pedidos de produtos virtuais quando o pagamento é confirmado. | |
* Version: 1.1 | |
* Author: Seu Nome | |
* License: GPL2 | |
*/ | |
// Evita o acesso direto ao arquivo |
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
// Auto-complete virtual orders if payment is completed by u/acephaliax | |
function auto_complete_virtual_orders($order_id) { | |
if (!$order_id) { | |
return; | |
} | |
// Get the order object | |
$order = wc_get_order($order_id); | |
// Check if the order contains virtual products |
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
# Script to convert a list of CSS custom properties to the JSON format required by Advanced Themer to make them appear on the Bricks Builder fields (via the “V” symbol). | |
# 1. Add a file in a folder with all CSS variables from Core Framework called core-framework-css-variables.css, one per line. Group each section using CSS comments. | |
# 2. Run the python script to generate the JSON file for Advanced Themer: python3 convert-css-variables-to-json.py | |
# 3. Add the file to the “Import Framework” option of the Advanced Themer on Bricks → AT - Theme settints → Global CSS Variables → Import Framework. | |
import re | |
import json | |
# Read the CSS file | |
with open('core-framework-css-variables.css', 'r') as f: | |
css = f.readlines() |
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
var recursivelyRecoverInvalidBlockList = blocks => { | |
const _blocks = [ ...blocks ] | |
let recoveryCalled = false | |
const recursivelyRecoverBlocks = willRecoverBlocks => { | |
willRecoverBlocks.forEach( _block => { | |
if ( isInvalid( _block ) ) { | |
recoveryCalled = true | |
const newBlock = recoverBlock( _block ) | |
for ( const key in newBlock ) { | |
_block[ key ] = newBlock[ key ] |
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
<!-- wp:group {"style":{"color":{"background":"#ffae0017"},"spacing":{"padding":{"top":"0","right":"0","bottom":"0","left":"0"}},"border":{"left":{"color":"#fcb90033","width":"8px"}}},"layout":{"type":"constrained"}} --> | |
<div class="wp-block-group has-background" style="border-left-color:#fcb90033;border-left-width:8px;background-color:#ffae0017;padding-top:0;padding-right:0;padding-bottom:0;padding-left:0"> | |
<!-- wp:columns {"isStackedOnMobile":false,"style":{"spacing":{"padding":{"top":"0px","right":"0px","bottom":"0px","left":"0px"},"blockGap":{"top":"0px","left":"0px"},"margin":{"top":"0px","bottom":"0px"}}}} --> | |
<div class="wp-block-columns is-not-stacked-on-mobile" style="margin-top:0px;margin-bottom:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px"> | |
<!-- wp:column {"width":"40px","layout":{"type":"default"}} --> | |
<div class="wp-block-column" style="flex-basis:40px"> | |
<!-- wp:image {"sizeSlug":"large","linkDestination":"none","className":"is-styl |
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 | |
namespace MyPlugin; | |
add_filter( 'render_block_core/heading', __NAMESPACE__ . '\\add_anchor_icon', 10, 2 ); | |
/** | |
* Add clickable anchor icons to all core/paragragh blocks. | |
* | |
* @param string $block_content The block content about to be appended. |
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 | |
namespace MyPlugin; | |
// Adds a class to external links in content blocks. | |
add_filter( 'render_block', __NAMESPACE__ . '\\add_class_external_links', 10, 2 ); | |
/** | |
* Adds a CSS class to external links in content blocks. | |
* |
NewerOlder