How can i preserve wordpress database encoding after using wp-cli search-replace with –export flag?
How can i preserve wordpress database encoding after using wp-cli search-replace with –export flag?
How can i preserve wordpress database encoding after using wp-cli search-replace with –export flag?
I know toscho doesn’t like this very much, but anyway: Converted the input args to an array: function utf8_truncate( $args = array( ‘string’ => null, ‘max_chars’ => 200, ‘append’ => “\xC2\xA0…” ) ) { $args[‘string’] = strip_tags( $args[‘string’] ); $args[‘string’] = html_entity_decode( $args[‘string’], ENT_QUOTES, ‘utf-8’ ); // \xC2\xA0 is the no-break space $args[‘string’] = trim( … Read more
You cannot change that value. The database schema is limited to 20 Bytes. See wp-admin/includes/schema.php: TABLE $wpdb->posts ( ID bigint(20) unsigned NOT NULL auto_increment, post_author bigint(20) unsigned NOT NULL default ‘0’, post_date datetime NOT NULL default ‘0000-00-00 00:00:00’, post_date_gmt datetime NOT NULL default ‘0000-00-00 00:00:00’, post_content longtext NOT NULL, post_title text NOT NULL, post_excerpt text … Read more
Chances are you are copy+pasting the links in, correct? Depending where you are copying from, they could be filled with hidden space characters, like <wbr> in the actual HTML (if you copy from a website) which offers a break point. You need to paste these links into TextEdit, or Notepad, or Event the browser address … Read more
If you need to add query string arguments to permalinks, use the_permalink filter: function append_query_string( $url ) { return add_query_arg( ‘id’, ‘something’, $url ); } add_filter( ‘the_permalink’, ‘append_query_string’ );
Leave .htaccess alone. You can use WordPress rewrite API for this. add_action( ‘init’, function(){ return add_rewrite_rule( ‘subdir/([^/]+)/?$’, // ([^/]+) takes alphanumeric, while ([0-9]+) accepts digits ‘index.php?pagename=subdir&website=$matches[1]’, ‘top’ ); }); add_filter(‘query_vars’, function($v){ return array_merge(array(‘website’),$v); }); First make sure subdir is a valid page slug, in this example. After you save that code to your child theme’s … Read more
I’m totally shocked. After hours of trying things and testing, I finally found the “Settings” then “Readings” option below: “Encoding for pages and feeds”. After changing from UTF-7 to UTF-8, everything looks good again. And even stranger, after changing it to UTF-8, the option disappears from the page. According to WordPress site, this option was … Read more
Exactly “where” may differ depending on your theme setup. However, there are some global-ish ways to do this if you want to tackle it that way. add_filter( ‘the_title’, ‘my_trim_words’ ); function my_trim_words( $title ) { // limit to ten words return wp_trim_words( $title, 10, ” ); } If you’d like to do this for a … Read more
When one creates a WordPress site by default, or via the Fantastico tool in cPanel, it may create a blog with the Latin1 charset in the MySQL database. This causes Chinese characters (and other Unicode characters) to be switched into one or more ? question mark symbols, instead. The fix is to connect to your … Read more
You can try commenting out the encoding type in the wp-config. Sometimes that works. //define(‘DB_CHARSET’, ‘utf8’); //define(‘DB_COLLATE’,’utf8_unicode_ci’);