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 vaultpress_validate_ip_address( $rxs ) { | |
$remote_ips = array(); | |
if ( !empty( $_SERVER['REMOTE_ADDR'] ) ) | |
$remote_ips[] = $_SERVER['REMOTE_ADDR']; | |
if ( !empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) | |
$remote_ips[] = $_SERVER['HTTP_X_FORWARDED_FOR']; | |
$iprx = '/^([0-9]+\.[0-9]+\.[0-9]+\.)([0-9]+)$/'; |
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
// Enqueue scripts | |
wp_enqueue_script( 'jquery' ); | |
wp_enqueue_media(); | |
/* | |
* Generate the fields | |
*/ | |
function generateImageUploadFields( $inputName, $buttonName, $previewImageID = '', $buttonValue = '') |
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
add_filter('woocommerce_quantity_input_step', 'wpk_custom_quantity_input_step', 99, 1); | |
function wpk_custom_quantity_input_step(){ | |
// Return the incrementing step here | |
return 5; | |
} |
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 | |
/** | |
* Display the admin notice. This is an internal function. Do not call directly. Use uwtAdminNotice() instead. | |
* @internal | |
* @param string $type The type: error, updated | |
* @param string $message The message to display | |
* @return string | |
*/ | |
function _uwt_admin_notice($type = 'error', $message = ''){ | |
return '<div class="'.$type.'"><p>'.$message.'</p></div>'; |
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 | |
// v4.7.4 | |
$vc_params_list = array( | |
// Default | |
'textfield', | |
'dropdown', | |
'textarea_html', | |
'checkbox', | |
'posttypes', |
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 | |
/* | |
* This script will process all images from the specified directory from your server and set them as featured images | |
* for posts. | |
* | |
* 1) Upload all images to wp-content/uploads/DIR_NAME -- Only images should be in that directory! | |
* 2) Update BHWP_UPLOADS_DIR to match the name of your directory | |
*/ | |
/* |
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 | |
/** | |
* Plugin Name: WC Price | |
* Plugin URI: http://localhost | |
* Description: WC set different prices | |
* Version: 1.0 | |
* Author: kso | |
* Requires at least: 4.1 | |
* Tested up to: 4.3 | |
* |
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 | |
$options = array( | |
'has_tabs' => true, | |
'css_selector' => '.', | |
'general' => array( | |
'title' => 'General options', | |
'options' => array( | |
array( | |
'id' => 'use_custom_style', | |
'name' => 'Map custom style', |
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
/* actions fired when listing/adding/editing posts or pages */ | |
/* admin_head-(hookname) */ | |
add_action( 'admin_head-post.php', 'admin_head_post_editing' ); | |
add_action( 'admin_head-post-new.php', 'admin_head_post_new' ); | |
add_action( 'admin_head-edit.php', 'admin_head_post_listing' ); | |
function admin_head_post_editing() { | |
echo 'you are editing a post'; | |
} |