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
| <!-- put this file in your theme folder --> | |
| <div id="googlemap<?php echo $map_id; ?>" class="googlemap" style="height:<?php echo $height; ?>px;"></div> | |
| <div class="clear"></div> | |
| <?php if ( $enlarge_button ) { ?> | |
| <div class="map_buttons"> | |
| <a href="http://maps.google.com/maps?q=<?php echo htmlspecialchars( urlencode( $address ) ); ?>" | |
| target="_blank"><?php _e( 'Enlarge Map', 'boutique' ); ?></a> | |
| </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
| function dtbaker_rtl_bracket_hack($content){ | |
| if(is_rtl()){ | |
| $content = preg_replace('#<p>([^<]+)\)\s*</p>#','<p>$1)‎</p>',$content); | |
| $content = preg_replace('#<p>\s*\(([^<]+)</p>#','<p>‎($1</p>',$content); | |
| } | |
| return $content; | |
| } | |
| add_filter('the_content','dtbaker_rtl_bracket_hack',100,1); |
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 dtbaker_rtl_bracket_js_hack() { | |
| ?> | |
| <script type="text/javascript"> | |
| (function($){ | |
| $('p:contains(")")').each(function(){ | |
| $(this).html($(this).html().replace(/\)(\s*)$/,')‎\1').replace(/^(\s*)\(/,'\1‎(')); | |
| }); | |
| })(jQuery); | |
| </script> | |
| <?php |
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
| @highdpi: ~"((-webkit-min-device-pixel-ratio: 1.5), (min--moz-device-pixel-ratio: 1.5), (-o-min-device-pixel-ratio: 3/2), (min-resolution: 1.5dppx))"; | |
| .double_background(@url){ | |
| background: ~"@{url}"; | |
| @media @highdpi { | |
| background: ~`@{url}.replace(/images\//g, 'images/2x/')`; | |
| } | |
| } | |
| #your_element{ |
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 ( 'wp_tag_cloud', 'tag_cloud_count' ); | |
| function tag_cloud_count( $return ) { | |
| return preg_replace('#(<a[^>]+\')(\d+)( topics?\'[^>]*>)([^<]*)<#imsU','$1$2$3$4 ($2)<',$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
| $key = $_SERVER['REMOTE_ADDR'] . serialize($_REQUEST); | |
| if(strlen($key) < 500){ // help prevent flooding. | |
| $key = md5($key); | |
| // global so we can find it in the shutdown function | |
| $GLOBALS['wordpress_temp_file'] = dirname(__FILE__).'/cache/wp_'.basename($key); | |
| if(is_file($GLOBALS['wordpress_temp_file']) && filemtime($GLOBALS['wordpress_temp_file']) > (time() - 3600)){ | |
| $data = unserialize(file_get_contents($GLOBALS['wordpress_temp_file'])); | |
| echo $data['content']; | |
| exit; | |
| } |
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 | |
| /** | |
| * Class dtbaker_Shortcode_Line | |
| * handles the creation of [boutique_line] shortcode | |
| * adds a button in MCE editor allowing easy creation of shortcode | |
| * creates a wordpress view representing this shortcode in the editor | |
| * edit/delete button on wp view as well makes for easy shortcode managements. | |
| * Author: dtbaker@gmail.com | |
| * Copyright 2014 |
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 | |
| class module_custom_table_hooks extends module_base{ | |
| public function init(){ | |
| hook_add('table_process_data','module_custom_table_hooks::hook_table_process_data'); | |
| } | |
| public static function hook_table_process_data($callback, $table_manager){ |
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 | |
| // upload this file to includes/plugin_custom_dashboard_widgets/custom_dashboard_widgets.php | |
| class module_custom_dashboard_widgets extends module_base{ | |
| public static function can_i($actions,$name=false,$category=false,$module=false){ | |
| if(!$module)$module=__CLASS__; | |
| return parent::can_i($actions,$name,$category,$module); | |
| } |
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 example removes the "Customer" and "Group" and "Staff" columns from the main customer page. | |
| // It also adds some new columns to the "Customer" and "Job" listing tables. | |
| // Upload this file to includes/plugin_custom_table_hooks/custom_table_hooks.php in the UCM folder | |
| class module_custom_table_hooks extends module_base{ | |
| public function init(){ |