classic simple how-to var $ = jQuery.noConflict(); others how-to (function( $ ) { //$.... })( jQuery ); jQuery.noConflict(); (function( $ ) { $(function() { //$.... }); }); jQuery(document).ready(function($) { //$.... });
wp: redux js Error Hint - jquery version problems : browser.msie, .live()
redux.min.js jQuery.browser = {}; (function () { jQuery.browser.msie = false; jQuery.browser.version = 0; if (navigator.userAgent.match(/MSIE ([0-9]+)\./)) { jQuery.browser.msie = true; jQuery.browser.version = RegExp.$1; } })(); //a(".redux-groups-remove").live("click", function() { a(".redux-groups-remove").on("click", […]
WP : SSL Hint
.htaccess <ifModule mod_headers.c> # Header set Access-Control-Allow-Origin: * #Header add Content-Security-Policy "default-src 'self';" Header always set Content-Security-Policy "upgrade-insecure-requests;" </ifModule> <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] </IfModule> Optional wp-config.php define('FORCE_SSL_ADMIN', true); define('WP_HOME',''.$_SERVER['REQUEST_SCHEME'].'://'.$_SERVER['HTTP_HOST'].'/wordpress'); define('WP_SITEURL',''.$_SERVER['REQUEST_SCHEME'].'://'.$_SERVER['HTTP_HOST'].'/wordpress');
wp: double dash problem Hint
functions.php add_filter( 'run_wptexturize', '__return_false' );
Excel vs Unix Timestemp : excel datevalue to java dateformat Hint!
Unix Timestamp from 1970 Excel Timestamp from 1900 Gap : (1970-1900) Days = 25569 Days String rtn = ""; try{ DateFormat format = new SimpleDateFormat("yyyyMMdd"); //format.setTimeZone(TimeZone.getTimeZone("UTC")); double excelDays = Double.parseDouble((String)valv.elementAt(0)); double unixDays = (excelDays-25569); java.util.Date unixTime = new java.util.Date((long) ( 86400000l * unixDays)); rtn = format.format(unixTime); out.println(rtn); } catch(Exception e) {}
WP : theme-my-login resetpass key error Hint
theme-my-login/includes/class-theme-my-login.php -------------------------------- public static function check_password_reset_key( $key, $login ) { global $wpdb; //$key = preg_replace( '/[^a-z0-9]/i', '', $key ); ..... return $user; }
WP : wp_new_user_notification customizing Hint
wp-include/pluggable.php ------------------------------- $message = sprintf(__('Username: %s'), $user->user_login) . "\r\n\r\n"; $message .= __('To set your password, visit the following address:') . "\r\n\r\n"; $message .= network_site_url("wp-login.php?action=rp&key=$key&login=" . rawurlencode($user->user_login), 'login'); $message .= "\r\n\r\n"; $message .= wp_login_url(); $message .= "\r\n"; -------------------------------
WP : theme-my-login : profile-form.php password strangth Hint
theme-my-login.css ----------------------------- #pass1-text { display: none; } ----------------------------- profile-form.php ----------------------------- <?php $show_password_fields = apply_filters( 'show_password_fields', true, $profileuser ); if ( $show_password_fields ) : ?> <tr id="password"> <th><label for="pass1"><?php _e( 'New Password' ); ?></label></th> <td><input type="password" name="pass1" id="pass1" size="16" value="" autocomplete="off" /> <span class="description"><?php _e( 'If you would like to change the password type a […]
utf-8 available special characters test
Common: “ ” ‘ ’ – — … ‐ ‒ ° © ® ™ • ½ ¼ ¾ ⅓ ⅔ † ‡ µ ¢ £ € « » ♠ ♣ ♥ ♦ ¿ � Math: - × ÷ ± ∞ π ∅ ≤ ≥ ≠ ≈ ∧ ∨ ∩ ∪ ∈ ∀ ∃ ∄ ∑ […]
htaccess : remove .php extension to permalink
RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([^\.]+)$ $1.php [NC,L] or --------------------------------------------------- httpd.conf Options +Multiviews <Directory /> AllowOverride All Options None #Options +FollowSymLinks -Indexes # Apache 2.4 #Require all granted Require all denied # Apache 2.2 #Order allow,deny #Allow from […]