Skip to content

Instantly share code, notes, and snippets.

View cristianstan's full-sized avatar
🎯
Focusing

Cristian Stan cristianstan

🎯
Focusing
View GitHub Profile
<?php
/**
* @snippet WooCommerce How To Add New Tab @ My Account
* @how-to Watch tutorial @ https://techiesandesh.com
* @author Sandesh Jangam
* @compatible WooCommerce 3.6.2
* @donate $7 https://www.paypal.me/SandeshJangam/7
*/
/**
@cristianstan
cristianstan / class-tgm-plugin-activation.php
Last active October 10, 2019 08:59 — forked from al5dy/class-tgm-plugin-activation.php
TGM 'Warning: sprintf(): Too few arguments...' bugfix
/**
* Sets install skin strings for each individual plugin.
*
* Checks to see if the automatic activation flag is set and uses the
* the proper strings accordingly.
*
* @since 2.2.0
*/
public function add_strings() {
if ( 'update' === $this->options['install_type'] ) {
@cristianstan
cristianstan / comments-example.php
Created December 5, 2018 15:02 — forked from chrisguitarguy/comments-example.php
How to add custom fields to WordPress comments
<?php
/*
Plugin Name: Add Extra Comment Fields
Plugin URI: http://pmg.co/category/wordpress
Description: An example of how to add, save and edit extra comment fields in WordPress
Version: n/a
Author: Christopher Davis
Author URI: http://pmg.co/people/chris
License: MIT
*/
<?php
$cmb->add_field( array(
'name' => __( 'Postive numbers', 'theme-domain' ),
'desc' => __( 'Numbers only', 'msft-newscenter' ),
'id' => $prefix . 'number',
'type' => 'text',
'attributes' => array(
'type' => 'number',
'pattern' => '\d*',
@cristianstan
cristianstan / Visual comoposer with param_group
Created September 26, 2018 19:43 — forked from hasanm95/Visual comoposer with param_group
Create visual composer with param_group
//Backend visual composer add-on code
vc_map(array(
'name' => 'Accordions',
'base' => 'maxima_accordion',
'category' => 'Maxima',
'params' => array(
array(
'type' => 'textfield',
'name' => __('Title', 'rrf-maxima'),
@cristianstan
cristianstan / wordpress_while_loop.php
Created August 21, 2018 11:32 — forked from joedajigalo/wordpress_while_loop.php
Create a WordPress While Loop
<?php
/* Create a WordPress While Loop
-------------------------------------------------- */
$wordpress_loop_argument = array(
'post_type' => 'custom_post_type',
'posts_per_page' => -1,
'orderby' => 'date',
'order' => 'ASC'
);
@cristianstan
cristianstan / visual-composer-rtl-fix.js
Created December 5, 2017 13:21 — forked from aliaghdam/visual-composer-rtl-fix.js
WordPress Visual Composer full width row ( stretche row ) fix for RTL
jQuery(document).ready(function() {
function bs_fix_vc_full_width_row(){
var $elements = jQuery('[data-vc-full-width="true"]');
jQuery.each($elements, function () {
var $el = jQuery(this);
$el.css('right', $el.css('left')).css('left', '');
});
}
@cristianstan
cristianstan / repeatable-fields-metabox.php
Created November 27, 2017 16:32 — forked from helen/repeatable-fields-metabox.php
Repeating Custom Fields in a Metabox
<?
/**
* Repeatable Custom Fields in a Metabox
* Author: Helen Hou-Sandi
*
* From a bespoke system, so currently not modular - will fix soon
* Note that this particular metadata is saved as one multidimensional array (serialized)
*/
function hhs_get_sample_options() {
<?php
/*
Register Fonts
*/
function studio_fonts_url() {
$font_url = '';
/*
Translators: If there are characters in your language that are not supported
by chosen font(s), translate this to 'off'. Do not translate into your own language.
@cristianstan
cristianstan / Pixi.js Smoke Shader
Created May 30, 2016 11:58 — forked from OmarShehata/Pixi.js Smoke Shader
Example of smoke shader in Pixi.js
<!DOCTYPE html>
<html>
<head>
<title>PixiJS Shaders</title>
<style type="text/css">
body {
margin: 0;
overflow: hidden;
}
</style>