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
add_filter('login_head', create_function('$a', "wp_enqueue_script('jquery');")); | |
add_filter('login_errors', 'login_error_message'); | |
add_action('login_footer', 'login_error_message_hide_empty_error_container'); | |
/** | |
* Removes an error message shown by Limit Login Attempts plugin. | |
* NN attempts remaining. We don't need to give info to the attacker. | |
* Making error null solves half of the problem. There is a wrapper with | |
* a red border which we will remove with : login_error_message_hide_empty_error_container | |
* |
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 | |
/* | |
Plugin Name: Orbisius Sample Code | |
Plugin URI: http://club.orbisius.com/products/ | |
Description: Sample plugin to return JSON | |
Version: 1.0.0 | |
Author: Svetoslav Marinov (Slavi) | |
Author URI: http://orbisius.com | |
License: GPL v2 | |
*/ |
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 | |
/* | |
Make sure that the function name matches the function name in the parent theme's functions.php file. | |
Also in the parent theme there must be a block e.g. !function_exists('function_name_that_you_want_to_override') | |
that will tell you that it is safe to override that function. | |
*/ | |
function function_name_that_you_want_to_override() { | |
} |
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 function schedules an email by passing -odd paramaters to sendmail. | |
* Those emails will be processed depending on: /etc/sysconfig/sendmail (using 1h) | |
* if sendmail is running all the time. | |
* | |
* @param string $email recipient | |
* @param string $subject - subject | |
* @param string $message - the message |
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 file will send you alerts when your clients install/uninstall plugins | |
* Usage: Save this as wp-content/mu-plugins/my-spy.php | |
* | |
* License: GPL | |
* @author orbisius.com | |
* Use it at your own risk. You may have to disclose this in your terms of service. | |
* Check with a laywer first. |
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
// This function accepts lat latitude from a string | |
// e.g. 123,-234 | |
function getLatLngFromString(ll) { | |
var lat = ll.replace(/\s*\,.*/, ''); // first 123 | |
var lng = ll.replace(/.*,\s*/, ''); // second ,456 | |
var latLng = new google.maps.LatLng(parseFloat(lat), parseFloat(lng)); | |
return latLng; | |
}; |
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
wp_enqueue_script( 'jquery' ); | |
wp_enqueue_script( 'jquery-ui-core ' ); | |
wp_enqueue_script( 'jquery-ui-slider' ); | |
wp_register_style('my_jq_ui', '//ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/themes/base/jquery.ui.all.css', __FILE__, false); | |
wp_enqueue_style('my_jq_ui'); | |
<div id="slider-range"></div> |
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 | |
// install it in mu-plugins | |
add_action('activated_plugin', 'dbg_log_error', 0, 2); | |
function dbg_log_error($plugin, $network_wide) { | |
if (ob_get_length() == 0) { | |
return ; | |
} | |
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 class is used in Orbisius Price Changer for WooCommerce | |
* This premium WooCommerce extension allows you to change product prices (up/down) for all products or for a selected category and its subcategories. | |
* You can review them before actually making the changes. | |
* | |
* @see http://club.orbisius.com/products/wordpress-plugins/woocommerce-extensions/orbisius-woocommerce-ext-price-changer/ | |
* @author jaywilliams | myd3.com | https://gist.github.com/jaywilliams | |
* @author Svetoslav Marinov (SLAVI) | http://orbisius.com |
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
Class HTML_Util { | |
/** | |
* Usage: HTML_Util::array2attribs(); | |
* @param array $attributes | |
* @param bool $make_them_data will prefix each key with 'data-' prefix so it's acessible via $('#elem').data(); | |
* @return string | |
* @see http://stackoverflow.com/questions/18081625/how-do-i-map-an-associative-array-to-html-element-attributes | |
*/ | |
public static function array2attribs($attributes = array(), $make_them_data = 0) { | |
$pairs = array(); |
OlderNewer