Skip to content

Instantly share code, notes, and snippets.

View digitalchild's full-sized avatar

Jamie Madden digitalchild

View GitHub Profile
@digitalchild
digitalchild / gist:f012dd4a733ad7cf7e9f5c098bee9505
Created November 14, 2023 07:43
German Subtitles "What kind of WordPress theme do I have: classic, block, or something else?
Github Issue: https://github.com/WordPress/Learn/issues/1873
Prompt:
I need your help with translation from english to german. I have the english translation and the german translation. Would you be able to tell me if the german translation is correct?
Response:
Absolutely, I'd be happy to help with that. Please provide both the English text and the German translation, and I'll review the German version for accuracy and correctness.
# Setup for the Automating WordPress with no code commands
# Install npm
npm install -g npm@latest
# Install n8n with npm
npm install n8n -g
# Fix Authorization 401 for n8n and localwp WooCommerce REST API
# https://www.schakko.de/2020/09/05/fixing-http-401-unauthorized-when-calling-woocommerces-rest-api/
@digitalchild
digitalchild / MchIPUtils.php
Created February 11, 2023 03:24
Updated MchIPUtils file to support PHP8.0 for Invisible recaptcha plugin https://wordpress.org/plugins/invisible-recaptcha/
<?php
/**
* Copyright (c) 2016 Ultra Community (http://www.ultracommunity.com)
*
* Replace this file in invisible-recaptcha/includes/utils/MchIPUtils.php
*/
namespace InvisibleReCaptcha\MchLib\Utils;
final class MchIPUtils
<?php
function change_billing_fields( $fields ){
$fields['billing_postcode']['label'] = '';
$fields['billing_postcode']['placeholder'] = 'Postcode monkey*';
$fields['billing_email']['label'] = '';
$fields['billing_email']['placeholder'] = 'Email*';
$fields['billing_phone']['label'] = '';
$fields['billing_phone']['placeholder'] = 'Phone*';
return $fields;
@digitalchild
digitalchild / asset.js
Created February 1, 2023 05:29
Multiple file Gist Example
var somejsfile;
@digitalchild
digitalchild / functions.php
Created March 14, 2022 03:51
Add the vendor role to an instructor when they are approved.
<?php
/**
* Required Tutor LMS v.1.6.0
*/
add_action('tutor_new_instructor_after', 'wcv_add_vendor_role');
/**
* @param $instructor_id
*
@digitalchild
digitalchild / functions.php
Created February 9, 2022 04:01
Force product type, hide tabs and show only price field on WC Vendors Product Edit Standard form.
<?php
// Disable the product type drop down.
add_filter('wcv_disable_product_type', function() { return true; } );
add_filter( 'wcv_product_meta_tabs', function() { return array(); } );
// Adjust styles of the product tabs after removing them.
add_action('wp_head', 'wcv_add_custom_styles', 10);
function wcv_add_custom_styles() {
echo "<style>.tabs-nav { display: none!important;}</style>";
@digitalchild
digitalchild / functions.php
Created January 19, 2022 07:04
Disable the orders page on the WC Vendors Pro dashboard.
<?php
/**
* Disable existing order page hook into the dashboard links filter
*
* filter: wcv_pro_dashboard_urls
*/
add_filter( 'wcv_pro_dashboard_urls', 'wcv_remove_order_page' );
function wcv_remove_order_page( $pages ){
@digitalchild
digitalchild / functions.php
Created November 9, 2021 06:43
Add inventory fields to product-simple.php template for WC Vendors Pro
add_action( 'wcv_after_product_simple_after', 'wcv_add_inventory_fields' );
function wcv_add_inventory_fields( $object_id ){
?>
<!-- Inventory -->
<div class="wcv-product-inventory inventory_product_data tabs-content" id="inventory">
<?php WCVendors_Pro_Product_Form::manage_stock( $object_id ); ?>
<?php do_action( 'wcv_product_options_stock', $object_id ); ?>
@digitalchild
digitalchild / functions.php
Last active September 28, 2021 03:22
Add custom links to the vendor dashboard in WC Vendors Pro
<?php
// Sourced from https://docs.wcvendors.com/knowledge-base/add-menu-item-to-dashboard/
// Add this to your themes functions.php.
function wcv_add_menu_item( $pages ){
$pages[] = array(
'label' => 'First Page',
'slug' => 'http://wcvendors.com/support',
'actions' => array()
);