Skip to content

Instantly share code, notes, and snippets.

View JohnTendik's full-sized avatar
🔍
Googling solutions to problems

John Tendik JohnTendik

🔍
Googling solutions to problems
View GitHub Profile
{
"Connected stateless component": {
"prefix": "cscomp",
"body": [
"import React from 'react';",
"import PropTypes from 'prop-types';",
"import { connect } from 'react-redux';",
"",
"const MyComponent = () => {",
"\treturn ();",
@JohnTendik
JohnTendik / buddypress Recapcha
Created November 15, 2018 01:34
Buddypress "I am not a robot" Recapche for registeration form
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! function_exists( 'jt_add_recaptcha_on_registeration' ) ) {
add_action( 'bp_signup_profile_fields', 'jt_add_recaptcha_on_registeration' );
function jt_add_recaptcha_on_registeration() {
<?php
if (!function_exists('hide_custom_widgets')) {
add_filter( 'yz_get_widgets_content', 'hide_custom_widgets', 10, 2);
function hide_custom_widgets($widgets) {
// Check if the current user is viewing their own profile
if (get_current_user_id() !== bp_displayed_user_id()) {
@JohnTendik
JohnTendik / Youzer Hide Tabs From Visitors
Last active October 16, 2019 04:26
Quick snippet to hide certain tabs from the youzer community profile section
<?php
if (!function_exists('hide_youzer_tabs')) {
// Filter
add_filter('yz_profile_primary_nav', 'hide_youzer_tabs', 10, 2);
function hide_youzer_tabs($tabs) {
// Make sure we dont remove the tabs in the admin back end pages
if (is_admin()) {
return $tabs;
@JohnTendik
JohnTendik / functions.php
Created April 8, 2018 18:20
Woocommerce Linked Products Custom Product Search/:ink Field
// Hook for adding html to the product edit page under linked products
add_action( 'woocommerce_product_options_related', 'add_linked_custom_product_field' );
function add_linked_custom_product_field() {
global $product_object; // UGH globals.
?>
<div class="options_group show_if_variable">
<p class="form-field">
<label for="customLinkedProdField"><?php esc_html_e( 'Custom Linked Field Products', 'woocommerce' ); ?></label>
<select class="wc-product-search" multiple="multiple" style="width: 50%;" id="customLinkedProdField" name="customLinkedProdField[]" data-sortable="true" data-placeholder="<?php esc_attr_e( 'Search for a product&hellip;', 'woocommerce' ); ?>" data-action="woocommerce_json_search_products" data-exclude="<?php echo intval( $post->ID ); ?>">
<?php
@JohnTendik
JohnTendik / jtrt-adminClass-shortcode.php
Created April 22, 2017 20:12
sample shortcode update
<?php
function jtrt_shortcode_table( $atts ){
global $wpdb;
$jtrt_settings = shortcode_atts( array(
'id' => '',
'filterrows' => '',
'filtercols' => ''
), $atts );
$table_post_meta = get_post_meta( $jtrt_settings['id'], 'jtrt_data_settings', false ); // get the table meta options
var JTrtEditor = function (tableContainer) {
// Initialize a var Iam to equal the main container just in case we need it
Iam = this;
// Grab the container element from the initializing callback
this.container = tableContainer;
// Grab the textarea box that stores all our table data
this.dataBox = jQuery('textarea#jtrt-table-data');
this.handsOnTab;
(function( $ ) {
'use strict';
/**
* All of the code for your public-facing JavaScript source
* should reside in this file.
*
* Note: It has been assumed you will write jQuery code here, so the
* $ function reference has been prepared for usage within the scope
* of this function.
@JohnTendik
JohnTendik / jtrt-responsive-tables-public.js
Last active March 9, 2017 19:04
Added url search feature
(function( $ ) {
'use strict';
/**
* All of the code for your public-facing JavaScript source
* should reside in this file.
*
* Note: It has been assumed you will write jQuery code here, so the
* $ function reference has been prepared for usage within the scope
* of this function.
@JohnTendik
JohnTendik / designer.html
Last active August 29, 2015 14:11
designer
<link rel="import" href="../topeka-elements/category-images.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../core-icons/av-icons.html">
<link rel="import" href="../paper-fab/paper-fab.html">
<polymer-element name="my-element">
<template>
<style>