Skip to content

Instantly share code, notes, and snippets.

View tnchuntic's full-sized avatar

Thomas N. Chuntic tnchuntic

View GitHub Profile
/* * *************************************************************************** */
/* Remove Version Query ************************** */
/* * *************************************************************************** */
function remove_cssjs_ver( $src ) {
if( strpos( $src, '?ver=' ) )
$src = remove_query_arg( 'ver', $src );
return $src;
}
@tnchuntic
tnchuntic / gist:128be4858d3c51f0428e7cc2994647a5
Created May 13, 2016 08:32
Visual Composer - Adding Tab Options
<?php
$attributes = array(
array(
'group' => 'Column Padding',
'type' => 'textfield',
'heading' => "Row Wrapper ID",
'param_name' => 'mf_row_id',
'value' =>'',
'description' => 'ID for row wrapper'
@tnchuntic
tnchuntic / gist:5917eae3238860a740c6e3a223920a41
Last active May 17, 2016 08:42
Visual Composer - Custom Page Title Element with overrides
<?php
add_action('vc_before_init', 'custom_page_title_element');
function custom_page_title_element() {
$arr_percent = array('100%'=>'100','90%'=>'90','80%'=>'80','70%'=>'70','60%'=>'60','50%'=>'50','40%'=>'40','30%'=>'30','20%'=>'20','10%'=>'10');
vc_map(array(
"name" => __("Insert Title", "tnc"),
"base" => "custom_page_title",
"class" => "",
<?php
/*
* Creating a function to create our CPT
*/
function cpt_widget_block() {
// Set UI labels for Custom Post Type
$labels = array(
/*
* -----------------------------------------------------------------------------
*
* google map acf fixes
*
* -----------------------------------------------------------------------------
*/
add_filter('script_loader_tag', 'add_async_defer_attribute', 10, 2);
function add_async_defer_attribute($tag, $handle) {
# Get around shallow update restriction
if [ -f ${HOME}/clone/.git/shallow ]; then git fetch --unshallow; fi
# Add User Data
git config --global user.name "wpengine-git-push-user-name"
git config --global user.email "my-wpengine-account-email-address"
# Add servers
git remote add servers $WPENGINE_GIT_PUSH_REMOTE
git remote set-url --add --push servers $WPENGINE_GIT_PUSH_REMOTE
git remote set-url --add --push servers $WPENGINE_GIT_PUSH_REMOTE_2
git remote set-url --add --push servers $WPENGINE_GIT_PUSH_REMOTE_3
@tnchuntic
tnchuntic / header.scss
Created May 28, 2019 02:13 — forked from ahaywood/header.scss
WordPress: Mega Menu
/*------------------------------------*\
#PRIMARY-MENU
\*------------------------------------*/
.primary-menu {
@include grid;
@include sans-serif;
font-weight: $bold;
height: $nav-bar-height;
&__wrapper {
@tnchuntic
tnchuntic / functions.php
Created November 23, 2021 03:50 — forked from stracker-phil/forminator-via-ajax-script.js
Load Forminator Form via Ajax
<?php
// The following Ajax handler is inside a loaded PHP file,
// such as a plugin, or in this sample, the functions.php file.
add_action('wp_ajax_my_get_support', 'ajax_my_get_support');
/**
* Ajax handler that gernates the form with all
* required JS files and CSS rules.
*/
/* partially complete conditional logic functions, submitted to Gravity Forms for help, as once the new select element is switched to, it cannot be switched away from */
function set_conditional( $form ) {
?>
<script type="text/javascript">
gform.addFilter( 'gform_conditional_logic_fields', 'set_conditional_field' );
function set_conditional_field( options, form, selectedFieldId ){
options.push({
label: 'User Role',
value: 'user-role'