*
* @since 2.1.0
*
- * @param unknown_type $old_value
- * @param unknown_type $value
+ * @param string $old_value
+ * @param string $value
*/
function update_home_siteurl( $old_value, $value ) {
- global $wp_rewrite;
-
if ( defined( "WP_INSTALLING" ) )
return;
// If home changed, write rewrite rules to new location.
- $wp_rewrite->flush_rules();
+ flush_rewrite_rules();
}
add_action( 'update_option_home', 'update_home_siteurl', 10, 2 );
function url_shorten( $url ) {
$short_url = str_replace( 'http://', '', stripslashes( $url ));
$short_url = str_replace( 'www.', '', $short_url );
- if ('/' == substr( $short_url, -1 ))
- $short_url = substr( $short_url, 0, -1 );
+ $short_url = untrailingslashit( $short_url );
if ( strlen( $short_url ) > 35 )
- $short_url = substr( $short_url, 0, 32 ).'...';
+ $short_url = substr( $short_url, 0, 32 ) . '...';
return $short_url;
}
if ( in_array( $type, get_taxonomies()) )
$map_option = 'edit_tags_per_page';
-
switch ( $map_option ) {
case 'edit_per_page':
case 'users_per_page':
}
update_user_meta($user->ID, $option, $value);
- wp_redirect( remove_query_arg( array('pagenum', 'apage', 'paged'), wp_get_referer() ) );
+ wp_safe_redirect( remove_query_arg( array('pagenum', 'apage', 'paged'), wp_get_referer() ) );
exit;
}
}
</fieldset>
<?php
}
-?>
+
+function _ipad_meta() {
+ if ( wp_is_mobile() ) {
+ ?>
+ <meta name="viewport" id="viewport-meta" content="width=device-width, initial-scale=1">
+ <?php
+ }
+}
+add_action('admin_head', '_ipad_meta');