Skip to content

Instantly share code, notes, and snippets.

View jessijean's full-sized avatar

Jessica Jean Bujazia jessijean

View GitHub Profile
global $paged;
$temp = $wp_query;
$wp_query = null;
$wp_query = new WP_Query( array( 'meta_key' => 'wpcf-gender', 'meta_value' => '1', 'meta_compare' => '==', 'post_type' => 'profile','posts_per_page' => 2, 'paged' => $paged ) );
function get_attachment_id_from_src ($image_src) {
global $wpdb;
$query = "SELECT ID FROM {$wpdb->posts} WHERE guid='$image_src'";
$id = $wpdb->get_var($query);
return $id;
}
<?php
// hacks and mods will go here
/**
* Disables BuddyPress' registration process and fallsback to WordPress' one.
*/
function my_disable_bp_registration() {
remove_action( 'bp_init', 'bp_core_wpsignup_redirect' );
remove_action( 'bp_screens', 'bp_core_screen_signup' );
}
add_action( 'bp_loaded', 'my_disable_bp_registration' );
@jessijean
jessijean / ajax-action.php
Created September 21, 2016 21:03 — forked from danielpataki/ajax-action.php
Twenty Fifteen AJAX
add_action( 'wp_ajax_nopriv_ajax_pagination', 'my_ajax_pagination' );
add_action( 'wp_ajax_ajax_pagination', 'my_ajax_pagination' );
function my_ajax_pagination() {
echo get_bloginfo( 'title' );
die();
}
@jessijean
jessijean / pmpro-customizations.php
Created October 1, 2017 18:59 — forked from strangerstudios/pmpro-customizations.php
A blank plugin file for customizations to your Paid Memberships Pro setup.
<?php
/*
Plugin Name: PMPro Customizations
Plugin URI: https://www.paidmembershipspro.com/wp/pmpro-customizations/
Description: Customizations for my Paid Memberships Pro Setup
Version: .1
Author: Paid Memberships Pro
Author URI: https://www.paidmembershipspro.com
*/
@jessijean
jessijean / my_pmprorh_depends_fields_init.php
Created October 2, 2017 00:27 — forked from strangerstudios/my_pmprorh_depends_fields_init.php
Demonstration of the Register Helper "depends" field option.
<?php
function my_pmprorh_depends_fields_init()
{
//don't break if Register Helper is not loaded
if(!function_exists("pmprorh_add_registration_field"))
{
return false;
}
//add a new "About Your Pets" box on checkout form

Font Face

A mixin for writing @font-face rules in SASS.

Usage

Create a font face rule. Embedded OpenType, WOFF2, WOFF, TrueType, and SVG files are automatically sourced.

@include font-face(Samplino, fonts/Samplino);
@jessijean
jessijean / gist:665f0eca7757d7c3b84e6e46939bcf4f
Created March 1, 2019 18:08
Tell server SSH Preferred Password
ssh -o PreferredAuthentications=password -o PubkeyAuthentication=no account@your-ip
@jessijean
jessijean / functions.php
Created October 1, 2019 06:57 — forked from corsonr/functions.php
WooCommerce Stripe: force customer creation in Stripe
<?php // Do not include this if already open! Code goes in theme functions.php.
/*
* Force customer creation process in Stripe.
*/
add_filter( 'wc_stripe_force_save_source', '__return_true' );
@jessijean
jessijean / gist:c59e9d06bebe206d4a69b65f9f825d74
Created November 8, 2019 06:26
Vue.js Check Data Array Length for V-if
<!DOCTYPE html>
<html>
<head>
<title>Check Data Object Array Length & Hide When Empty</title>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
<ul id="app">
<li v-if="!items.length">No item found</li>