View gist:85c258396491389fbfa836b4cbbb4bf7
function wpca_sales_feed_save_settings(){
$wpca_sales_feed_save = array(
'wpca_show_for_logged_users',
'wpca_feed_begin',
'wpca_feed_begin',
'wpca_feed_show_for',
'wpca_cards_per_user',
'sales_feed_in_animation',
'sales_feed_out_animation',
View gist:004045ff6c7ac9a1dca97bd014e624d4
<?php
$animation = array(
'none' => esc_attr__( 'None', 'wpca-sales-feed' ),
'bounce' => esc_attr__( 'bounce', 'wpca-sales-feed' ),
'flash' => esc_attr__( 'flash', 'wpca-sales-feed' ),
'pulse' => esc_attr__( 'pulse', 'wpca-sales-feed' ),
'rubberBand' => esc_attr__( 'rubberBand', 'wpca-sales-feed' ),
'shake' => esc_attr__( 'shake', 'wpca-sales-feed' ),
'headShake' => esc_attr__( 'headShake', 'wpca-sales-feed' ),
'swing' => esc_attr__( 'swing', 'wpca-sales-feed' ),
View gist:a54a352be47b54a87d9a412de6112fa7
// BLOCK WORDPRESS DASHBOARD
function block_dashboard() {
$file = basename($_SERVER['PHP_SELF']);
if (is_user_logged_in() && is_admin() && !current_user_can('edit_posts') && $file != 'admin-ajax.php'){
wp_redirect( home_url('/account') );
exit();
}
}
View gist:5d1feecb73b8179213b36db38eb7c3f9
add_action( 'wp_enqueue_scripts', 'monica_register_js' );
function monica_register_js() {
wp_register_script( 'monica-theme-js', get_template_directory_uri() . '/js/monica.js', array( 'jquery' ), '1.0.0', true );
}
add_action( 'wp_enqueue_scripts', 'monica_localize' );
View gist:8578dcd41edd9981795b19704ad485ff
function custom_text_per_shipping_class() {
global $product;
$product = wc_get_product();
$shipping_class = $product->get_shipping_class();
if ($shipping_class == 'a'){
echo "a";
} elseif ($shipping_class == 'b') {
echo "b";
} else {
View My Domain to Affiliate Link Redirect with WordPress
View HTML To Shortcode WordPress
function register_my_shortcode() {
ob_start(); ?>
<div class="my-shortcode">
<h1>Hi, I am the shortcode.</h1><hr />
<p>This is a screenshot of how I was created!</p>
<img src="https://d153h1xtzgec02.cloudfront.net/shortcode-function-blog-post.png" alt="Function Screen Shot">
<p>I was created by pasting &#x5b;shortcode_name] on this post!</p>
</div>
<?php
return ob_get_clean();
View Register Plugin
<?php
/*
Plugin Name: Name
Plugin URI: http://url.com
Description: Create amazing pluigns
Version: 1.
Author: Jerrick Hakim
Author URI: http://jhakim.com
*/
View WordPress Login URL Redirect
function jh_from_wp_login() {
$login_url = '/login';
wp_redirect( esc_url_raw( $login_url ) ); exit;
}
add_action( 'login_form_login', 'jh_from_wp_login' );
View Load Custom JS from Theme Folder
// LOAD CUSTOM JS
function load_custom_js() {
wp_enqueue_script( 'custom', get_stylesheet_directory_uri() . '/js/custom.js', array( 'jquery' ), '1.0.0', true );
}
add_action( 'wp_enqueue_scripts', 'load_custom_js' );
// LOAD CUSTOM STYLES
add_action( 'wp_enqueue_scripts', 'enqueue_load_fa' );
function enqueue_load_fa() {