This week, the security team released WordPress 4.9.7 to fix a security issue.
Continue reading "WordPress weekly recap #27: WordPress 4.9.7 and more"Blog
Create different color palettes with Gutenberg
In this post I show how to create different color palettes in Gutenberg, to – for example – allow other colors for the text than for the background.
Continue reading "Create different color palettes with Gutenberg"WordPress weekly recap #26: Tide 1.0.0 beta and more
The Tide team released the first beta version this week. Tide will be integrated on WordPress.org to display, for example, results of Coding Standard tests for plugins and themes.
Continue reading "WordPress weekly recap #26: Tide 1.0.0 beta and more"Use ElasticPress’ related posts feature with Elasticsearch 6
A while back I updated to Elasticsearch 6, and with that, the related posts feature of ElasticPress stopped working. First I thought it has to do with an ElasticPress issue, but the reason was a parameter used by ElasticPress that is not supported by Elasticsearch 6 that needs to be modified.
Continue reading "Use ElasticPress’ related posts feature with Elasticsearch 6"WordPress weekly recap #25: Gutenberg 3.1 and more
Gutenberg 3.1 brings – among other things – an interface for tips to guide users through the new editor.
Continue reading "WordPress weekly recap #25: Gutenberg 3.1 and more"WordPress weekly recap #24: Blocking plugin installs when requirements are not met and more
The PHP team finished work on design and wording of the notice that a plugin cannot be installed because the WordPress and/or PHP version is too low. Now they are working on committing it to the core.
Continue reading "WordPress weekly recap #24: Blocking plugin installs when requirements are not met and more"Check for compatibility with specific PHP version using Travis CI
My Lazy Loader plugin needs PHP 5.3 or higher. If users count on that, it is annoying if this minimum version is raised through a inadvertency (like using the []
array syntax) in a patch or minor release.
WordPress weekly recap #23: Gutenberg 3.0 and more
This week, Gutenberg 3.0 was released. With that, it is possible to specify blocks as child blocks of other blocks, so they only will be visible in the block inserter when the parent block is selected.
Continue reading "WordPress weekly recap #23: Gutenberg 3.0 and more"Search and replace in MySQL
Currently, I want to wrap all acronyms – »PHP«, for example – in a span
element to display them as small capitals. So I searched for a way to search and replace in MySQL, and there it is: REGEXP_REPLACE
.
For example, the following command wraps WOFF
in the post titles in the wanted markup (it is a good idea to create a backup before):
UPDATE `wp_posts` SET `post_title` = REGEXP_REPLACE(post_title COLLATE utf8mb4_bin, 'WOFF', '<span class="smcp">WOFF</span>' ) WHERE `ID` = 4691
Code language: SQL (Structured Query Language) (sql)
The first param of REGEXP_REPLACE
is the string to search in – we set the column’s name we want to search in. The second parameter is the searched string and the third the string to replace the searched string with. Setting COLLATE utf8mb4_bin
(you may need to adjust the collation if you use another one) is important because otherwise, the search would be case insensitive.
Like written in the MariaDB documentation (and as the name suggests) you can also use regular expressions with REGEXP_REPLACE
. For my German version of the weekly recap, I used the following:
UPDATE `wp_posts` SET `post_title` = REGEXP_REPLACE(post_title COLLATE utf8mb4_bin, 'KW([0-9]+)', '<span class="smcp">KW</span>\\1' ) WHERE `ID` = 4691
Code language: SQL (Structured Query Language) (sql)
\\1
inserts the part inside the brackets from the searched string into the replace string: the week number.
WordPress weekly recap #22: no auto updates for 4.9.6 and more
Because of the larger amount of new code in 4.9.6, the team decided to disable the automatic updates for a day to wait for incoming issues. There were some issues with plugins that use the wrong hook for the new privacy features that caused a white screen, so the team kept the feature disabled.
Continue reading "WordPress weekly recap #22: no auto updates for 4.9.6 and more"