Skip to content

Instantly share code, notes, and snippets.

View flabernardez's full-sized avatar

Flavia Bernárdez Rodríguez flabernardez

View GitHub Profile
@Klerith
Klerith / Instalaciones-React.md
Last active July 21, 2024 14:00
Instalaciones recomendadas para mi curso de React de cero a experto
function add_toolbar_items($wp_admin_bar) {
$wp_admin_bar->add_node( array(
'id' => 'supportlink',
'title' => 'Contact support',
'href' => 'mailto:support@domain.com',
) );
}
add_action('admin_bar_menu', 'add_toolbar_items', 999);
@panoslyrakis
panoslyrakis / ps-checkout-shortcode.php
Created August 5, 2017 16:21
Provides a shortcode to add the Pro Sites checkout form in any page
<?php
/*
Plugin Name: Pro Sites - Checkout Shortcode
Plugin URI: https://premium.wpmudev.org/
Description: Provides a shortcode to add the Pro Sites checkout form in any page
Author: Panos Lyrakis @ WPMUDEV
Author URI: https://premium.wpmudev.org/
License: GPLv2 or later
*/
@amboutwe
amboutwe / yoast_seo_canonical_change_woocom_shop.php
Last active July 12, 2024 15:17
Code snippets for the Yoast SEO canonical output
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/* Change the canonical link for the shop page
* Credit: Scott Weiss of somethumb.com
* Yoast Doc: https://developer.yoast.com/features/seo-tags/canonical-urls/api/
* Last Tested: Jan 25 2017 using Yoast SEO 6.0 on WordPress 4.9.1
*/
add_filter( 'wpseo_canonical', 'yoast_seo_canonical_change_woocom_shop', 10, 1 );
@mindctrl
mindctrl / rcp-custom-post-restriction-messages.php
Created October 1, 2016 03:00
Custom post / page restriction messages in Restrict Content Pro
/**
* This plugin adds support for custom restriction messages per post.
* If a custom message exists, it is used in place of the ones defined
* in the RCP settings under Restrict > Settings > General.
*/
/**
* Displays the custom message metabox on the post edit screen.
*/
function jp_rcp_post_level_restriction_message_metabox() {
@Jany-M
Jany-M / WP_WC_auto-confirm-bookings.php
Last active June 29, 2022 10:52
[WordPress] [WooCommerce] [Bookings] Auto-Confirm Booking upon Order Complete
<?php
add_action( 'woocommerce_order_status_completed', 'mark_confirm_bookings', 20, 1 );
function mark_confirm_bookings( $order_id ) {
global $wpdb;
$order = new WC_Order( $order_id );
$bookings = array();
foreach ( $order->get_items() as $order_item_id => $item ) {
@gka
gka / clean_pdf_import.jsx
Last active December 23, 2023 20:51
Clean PDF import. Removes all clipping masks and ungroups everything..
#target Illustrator
// script.name = RemoveClippingMasks.jsx
// script.description = deletes all PageItems being used as clipping masks.
// script.parent = Kenneth Webb // 01/07/2013
// script.elegant = true?
var docRef = app.activeDocument;
var clippingCount = 0
clipScan()