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
| (function($){ | |
| var hide_fields = function() { | |
| $( '#wpsc-checkout-field-billingcity, #wpsc-checkout-field-billingstate, #wpsc-checkout-field-billingcountry' ).addClass( 'ui-helper-hidden-accessible' ); | |
| }, | |
| show_fields = function() { | |
| $( '#wpsc-checkout-field-billingcity, #wpsc-checkout-field-billingstate, #wpsc-checkout-field-billingcountry' ).removeClass( 'ui-helper-hidden-accessible' ); | |
| }, |
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: Publish Count | |
| * Plugin URI: http://zao.is | |
| * Description: Check year-to-date published character count | |
| * Version: 1.0 | |
| * Author: Justin Sainton | |
| * Author URI: http://zao.is | |
| */ | |
| class WP_Word_Count { |
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 | |
| public function add_meta_box( $post_type ) { | |
| $post_type = 'notes'; //limit meta box to certain post types | |
| add_meta_box( | |
| 'handshaken_note_settings', | |
| __( 'Note Settings', 'handshaken' ), | |
| array( $this, 'render_meta_box_content_note' ), | |
| $post_type, | |
| 'advanced', |
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 | |
| public function admin_bar_menu() { | |
| global $wp_admin_bar; | |
| $plugin_path = ABSPATH . 'wp-content/plugins/WP-e-Commerce'; | |
| exec( 'cd ' . $plugin_path . ' && git rev-parse --abbrev-ref HEAD', $output, $return ); | |
| $wp_admin_bar->add_menu( array( |
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 | |
| if ( some_irrelevant_condition() ) { | |
| echo '(' . json_encode( $results ) . ')'; | |
| die(); | |
| } else { | |
| echo '({"error":"' . __( 'Error updating product', 'wpsc' ) . '", "id": "'. esc_js( $_POST['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
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
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
| tools: | |
| puppet_lint: | |
| flags: '' | |
| js_hint: true | |
| php_mess_detector: | |
| config: | |
| naming_rules: { boolean_method_name: true } | |
| controversial_rules: { superglobals: false } | |
| php_code_sniffer: | |
| config: |
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 | |
| if (!function_exists('json_last_error_msg')) { | |
| function json_last_error_msg() { | |
| static $errors = array( | |
| JSON_ERROR_NONE => null, | |
| JSON_ERROR_DEPTH => 'Maximum stack depth exceeded', | |
| JSON_ERROR_STATE_MISMATCH => 'Underflow or the modes mismatch', | |
| JSON_ERROR_CTRL_CHAR => 'Unexpected control character found', | |
| JSON_ERROR_SYNTAX => 'Syntax error, malformed JSON', |
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_filter( 'option_custom_gateway_options', 'js_gateway_options' ); | |
| function js_gateway_options( $gateways ) { | |
| if ( in_array( 'wpsc_merchant_testmode', $gateways ) && ! current_user_can( 'manage_options' ) ) { | |
| unset( $gateways[ array_search( 'wpsc_merchant_testmode', $gateways ) ] ); | |
| } |
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 | |
| /** Automatically append mtime to script and style versions for cache-busting action **/ | |
| add_action( 'wp_enqueue_scripts', function() { | |
| global $wp_styles, $wp_scripts; | |
| foreach( array( 'wp_styles', 'wp_scripts' ) as $resource ) { | |
| foreach( $$resource->registered as $name => $registered_resource ) { | |
| // Not hosted here |