This file contains hidden or 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 | |
/** PB-1 | |
* Remove woo specific styles that are added by this plugin if option checked | |
* Then re-enqueue when option is not isset (default) | |
*/ | |
add_action( 'wp_enqueue_scripts', 'unitizr_products_enqueue_woospecific' ); | |
function unitizr_products_enqueue_woospecific() | |
{ |
This file contains hidden or 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
# BEGIN WordPress | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / | |
RewriteRule ^index\.php$ - [L] | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule . /index.php [L] | |
</IfModule> |
This file contains hidden or 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
$(document).ready(function(){ | |
var maxField = 10; //Input fields increment limitation | |
var addButton = $('.add_button'); //Add button selector | |
var wrapper = $('.field_wrapper'); //Input field wrapper | |
var fieldHTML = '<div><input type="text" name="field_name[]" value=""/><a href="javascript:void(0);" class="remove_button"><img src="remove-icon.png"/></a></div>'; //New input field html | |
var x = 1; //Initial field counter is 1 | |
//Once add button is clicked | |
$(addButton).click(function(){ |
This file contains hidden or 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 | |
/** | |
* Get list of all user meta | |
* @package WordPress | |
* @uses shortcode [bnsw_userprint="user_id"] Or whatever name you register | |
*/ | |
function bnswfields_user_list_meta($atts) | |
{ | |
if ( !isset( $atts['user_id'] ) ){ |
This file contains hidden or 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 | |
/** | |
* This code retrieves course data from an external API and displays it in the user's | |
* My Account area. A merchant has noticed that there's a delay when loading the page. | |
* | |
* 1) What changes would you suggest to reduce or remove that delay? | |
* 2) Is there any other code changes that you would make? | |
*/ | |
//improvements | |
/** |
This file contains hidden or 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 | |
/** | |
* Set a constant that holds the theme's minimum supported PHP version. | |
*/ | |
define( 'THEMESLUG_MIN_PHP_VERSION', '5.6' ); | |
/** | |
* Immediately after theme switch is fired we we want to check php version and | |
* revert to previously active theme if version is below our minimum. |
This file contains hidden or 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 | |
/** | |
* Add meta box to editor | |
* | |
* @strings $id, $title, $callback, $screen, $context, $priority, $args | |
* function's action_added in register cpt | |
*/ | |
function vertycal_date_time_meta_box() | |
{ | |
add_meta_box( |
This file contains hidden or 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 | |
/** | |
* Demonstration uses all cpt posts in a dropdown field to select | |
* a featured listings to callback in a function | |
* @param $wpselected_ string References a plugin option Setting. | |
*/ | |
function wpselected_featured_listing_cb() | |
{ | |
$post_type = 'wpselected_post'; |
This file contains hidden or 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 | |
/** | |
* Footer script to remove quick view button if vendor on vacation. | |
* @param script | |
* @author Larry Judd | Tradesouthwest | |
* The first one works the best across all browsers. The other two are for testing against other plugins. | |
*/ | |
/* | |
* If you use the .css combinator method add this to CSS stylesheet: | |
****************************************************************** |