Skip to content

Instantly share code, notes, and snippets.

View larbous's full-sized avatar

Luiz Sobral larbous

View GitHub Profile
@ImonAwesome
ImonAwesome / woocommerce-display-order-count.php
Created August 18, 2022 14:48
WooCommerce Display Total Order Count
<?php
/**
* Plugin Name: WooCommerce Display Order Count
* Plugin URI: http://www.skyverge.com/product/woocommerce-display-order-count/
* Description: Adds the [wc_order_count] shortcode to display the total number of orders placed on your site.
* Author: SkyVerge
* Author URI: http://www.skyverge.com/
* Version: 1.1.0
*
* GitHub Plugin URI: bekarice/woocommerce-display-order-count
@bobbydank
bobbydank / elementor-schema-fix.php
Created April 24, 2022 22:50
Elementor - Fix deprecated schema errors
<?php
/**
* Plugin Name: Elementor Scheme Class Issue
*
* 1) Create wp-content/mu-plugins folder
* 2) Create php file (name doesn't matter)
* 3) Copy/Paste
**/
namespace Elementor;
@crazyyy
crazyyy / _readme.md
Last active September 21, 2024 21:03
#wordpress #php || Snipets

Other Snippets

If / Else load Pages

  if ( is_front_page() && is_home() ){
      // Default homepage
  } elseif ( is_front_page()){
      //Static homepage
  } elseif ( is_home()){
@gabcarvalhogama
gabcarvalhogama / commands.php
Last active July 5, 2024 01:28 — forked from escopecz/commands.php
Script to run Mautic (https://mautic.org) commands from a URL. - Mautic 3
<?php
if (!isset($_GET['ILoveMauticReallyIDo'])) {
echo 'The secret phrase is wrong.';
die;
}
$link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
$allowedTasks = array(
'cache:clear',
@petermann
petermann / .Masks Form Fields
Last active October 29, 2024 21:09
Masks Form Fields - WordPress Plugin
Masks Form Fields - WordPress Plugin
Link: https://wordpress.org/plugins/masks-form-fields/
@ibndawood
ibndawood / functions.php
Created May 24, 2020 16:53
MAS Videos - Declare Support for MAS Videos plugin
function mytheme_add_masvideos_support() {
add_theme_support( 'masvideos' );
}
add_action( 'after_setup_theme', 'mytheme_add_masvideos_support' );
@kidino
kidino / toggle-button.css
Last active October 5, 2022 12:22
Creating a Toggle Button with Elementor Pro - The CSS & Javascript Code
/*
This is the CSS code for creating your own Toggle Button Widget using
Elementor Pro.
You still need the Javascript code for this to work.
The Youtube tutorial is here. Make sure you watch this to understand
how this works.
https://youtu.be/ZhBGPIU1bq0
@stevedrobinson
stevedrobinson / mautic-form-preload.js
Last active June 15, 2023 20:45 — forked from shawncarr/mautic-form-preload.js
Pre-populate Mautic Form Data from Query String Parameters
(function(document){
function populateForms(){
if (document.readyState == 'interactive') {
if (document.forms.length !== 0 && location.search) {
var query = location.search.substr(1);
query.split('&').forEach(function (part) {
if (part.indexOf('=') !== -1) {
var item = part.split('=');
var key = item[0];
var value = decodeURIComponent(item[1]);
@Preciousomonze
Preciousomonze / woo-create-product.php
Last active June 27, 2024 09:07
A snippet code for creating Products, use at your discretion
<?php
/**
* Creates a woocommerce product from a loystar product
*
* @param int $product_id(optional
* @param array $product_list(optional) | the loystar product list, this saves resources incase this function is called in the loop, the
* endpoint shouldn't be called everything
* @param bool $link_product(optional) | if set to true, the created woocommerce product will be linked to the loystar product
* @param bool $update(optional) | if set to true, it updates an existing product
* @param bool $only_import(optional) | if set to true, it updates only products that were imported from loystar direct.relevant when $update is true
@MjHead
MjHead / options-values-in-code.php
Last active December 21, 2024 14:42
Get option values for JetEngine options pages inside the PHP code
<?php
/**
* Method 1
* Can be used for: Any storage type
*
* page-slug - replace this with your Option Page slug
* option-name - replace this with your option Name/ID
*/
$value = jet_engine()->listings->data->get_option( 'page-slug::option-name' );