Skip to content

Instantly share code, notes, and snippets.

View ioniacob's full-sized avatar
🐌
Exploring the code is like life itself.

Ion Iacob ioniacob

🐌
Exploring the code is like life itself.
View GitHub Profile
@ioniacob
ioniacob / custom-my-account-endpoint.php
Created October 20, 2016 00:27 — forked from claudiosanches/custom-my-account-endpoint.php
Example of custom My Account endpoint.
<?php
class My_Custom_My_Account_Endpoint {
/**
* Custom endpoint name.
*
* @var string
*/
public static $endpoint = 'my-custom-endpoint';
@ioniacob
ioniacob / gist:9d767cff4553767948d15cfda9da6189
Created October 22, 2016 15:04 — forked from growdev/gist:4074021
WooCommerce - Remove the "Related Products" section from a template by removing the related posts query arguments.
<?php
/*
* wc_remove_related_products
*
* Clear the query arguments for related products so none show.
* Add this code to your theme functions.php file.
*/
function wc_remove_related_products( $args ) {
return array();
}
@ioniacob
ioniacob / gist:c7dd4254292c18506aee05704419d6d8
Created November 11, 2016 23:45 — forked from corsonr/gist:7839908
Automatically add product to cart on visit - WooCommerce
/*
* Add item to cart on visit
*/
function add_product_to_cart() {
if ( ! is_admin() ) {
global $woocommerce;
$product_id = 64;
$found = false;
//check if product already in cart
if ( sizeof( $woocommerce->cart->get_cart() ) > 0 ) {
@ioniacob
ioniacob / woocommerce-optimize-scripts.php
Created February 4, 2018 21:28 — forked from DevinWalker/woocommerce-optimize-scripts.php
Only load WooCommerce scripts on shop pages and checkout + cart
/**
* Optimize WooCommerce Scripts
* Remove WooCommerce Generator tag, styles, and scripts from non WooCommerce pages.
*/
add_action( 'wp_enqueue_scripts', 'child_manage_woocommerce_styles', 99 );
function child_manage_woocommerce_styles() {
//remove generator meta tag
remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) );
@ioniacob
ioniacob / ViewController.swift
Created February 7, 2018 00:16 — forked from nicktesla2011/ViewController.swift
WKWebView View Controller for Xcode 9.0/Swift 4/iOS11
//
// ViewController.swift
// Honk
//
// Created by Nick Gressle on 9/23/17.
// Copyright © 2017 nick gressle illustrations llc. All rights reserved.
//
import UIKit
import WebKit
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Simple Backbone WordPress Example</title>
<link rel="stylesheet" href="base.css">
</head>
<body>
<ul id="post-list"></ul>
@ioniacob
ioniacob / functions.php
Last active May 21, 2022 19:08 — forked from orfeomorello/functions.php
Customize Wordpress Profile
function remove_personal_options(){
echo '<script type="text/javascript">jQuery(document).ready(function($) {
$(\'form#your-profile > h2:first\').remove(); // remove the "Personal Options" title
$(\'form#your-profile tr.user-rich-editing-wrap\').remove(); // remove the "Visual Editor" field
$(\'form#your-profile tr.user-syntax-highlighting-wrap\').remove(); // remove the "resaltado de sintaxis al editar código" field
$(\'form#your-profile tr.user-admin-color-wrap\').remove(); // remove the "Admin Color Scheme" field