Skip to content

Instantly share code, notes, and snippets.

@bhdd
bhdd / gulpfile.js
Last active October 5, 2023 16:33
Updated Sage 8.6.0 build files
// ## Globals
var argv = require('minimist')(process.argv.slice(2));
var autoprefixer = require('gulp-autoprefixer');
var browserSync = require('browser-sync').create();
var changed = require('gulp-changed');
var concat = require('gulp-concat');
var flatten = require('gulp-flatten');
var gulp = require('gulp');
var gulpif = require('gulp-if');
var imagemin = require('gulp-imagemin');
@Danushka181
Danushka181 / woocommerce-functions.php
Created November 30, 2021 19:05
woocommerce functions hooks
<?php
/**
* WooCommerce Template
*
* Functions for the templating system.
*
* @package WooCommerce\Functions
* @version 2.5.0
*/
@random-robbie
random-robbie / shell_exec.txt
Created March 25, 2020 14:20
wordpress plugins with shell_exec in them.
10web-manager
4k-icon-fonts-for-visual-composer
accelerated-mobile-pages
accept-payments-wp
accu-auto-backup
ace-edit
ace-editor-for-wp
aceide
acelerator
acf-code-field
@Jahid07
Jahid07 / custom-metabox.php
Last active May 1, 2020 00:02
WordPress custom metabox for custom post type
/**
* Contact meta boxex
* Custom post type name is "prefix-contact"
*/
function prefix_contact_add_meta_box()
{
add_meta_box( 'contact_email', 'User Email', 'prefix_contact_email_callback', 'prefix-contact', 'side', 'low');
}
@jsnelders
jsnelders / wordpress_export_to_json.php
Last active May 6, 2024 16:35
Export all core WordPress data (posts, pages, attachments, comments, tags, categories and users) to a JSON formatted file.
<?php
/**
* Plugin Name: WordPress Export to JSON
* Plugin URI: https://jsnelders.com/
* Description: Export all WordPress posts, pages, comments, tags, commments and users to a JSON file.
* Author: Jason Snelders
* Author URI: http://jsnelders.com
* Version: 2020-01-30.1
**/
@ozknozsrt
ozknozsrt / app.js
Last active January 16, 2024 16:48 — forked from itzikbenh/app.js
WordPress API - how to fetch and paginate posts with Vue.js
import Vue from 'vue';
import posts from './components/posts.vue';
window.axios = require('axios');
window.Vue = Vue;
Vue.component('posts', posts);
const app = new Vue({
el: '#app',
@MogulChris
MogulChris / functions.php
Last active July 31, 2022 23:37
Hooking into the native WooCommerce product import
<?php
//Since 3.x WooCommerce has had an excellent native product import/export.
//You can do a huge amount just by tweaking your CSV to load meta values into the correct meta fields for your destination site.
//It'll even import images from the source site by URL if possible, and upload them to the destination site.
//If you need to do something a little fancier for every product you import, check out the woocommerce_product_import_* hooks here https://woocommerce.github.io/code-reference/hooks/hooks.html
//You can modify the CSV data before it's used, and modify the resulting WC_Product during and after creation
//eg do something to every product after it's created
@ChobPT
ChobPT / wc-bookings-availability-search-shortcode.php
Last active February 5, 2024 12:14 — forked from apintocr/wc-bookings-availability-search.php
WooCommerce Bookings Availability Search Shortcode
<?php
/*
* This code uses the original function and
* adds a shortcode functionality to display the product loop with
* the products that are available adding also another shortcode for
* products that are unavailable
*
* Usage: [bookable_products start="2019-10-10" end="2019-10-15"]
* [unbookable_products start="2019-10-10" end="2019-10-15"]
*
@ethanclevenger91
ethanclevenger91 / functions.php
Last active September 27, 2020 08:32
Add FacetWP facets with code-based ones, with preference for code-based definitions over db ones with same name
<?php
/**
* Glob all our JSON facets and register them
* with FacetWP
*/
function my_register_facets( $facets ) {
$new_facets_raw = glob(dirname(__FILE__) . '/facets/*.json'); // Or however you want to get your facet definitions
$new_facets = [];
foreach($new_facets_raw as $facet) {
$facet = json_decode(file_get_contents($facet), true);
@DevWael
DevWael / woocommerce_hooks.txt
Created July 8, 2019 08:19
List of woocommerce hooks with description
**Archive Page**
- Before Main Content `woocommerce_before_main_content`
- Before Shop Loop `woocommerce_before_shop_loop`
- Before Shop Loop Item `woocommerce_before_shop_loop_item`
- Before Shop Loop Item Title `woocommerce_before_shop_loop_item_title`
- After Shop Loop Item Title `woocommerce_after_shop_loop_item_title`
- After Shop Loop Item `woocommerce_after_shop_loop_item`
- After Shop Loop `woocommerce_after_shop_loop`
- After Main Content `woocommerce_after_main_content`