WordPress Developer Ukraine, Kyiv
Add a Custom Panel to the Gutenberg Document Sidebar with PluginDocumentSettingPanel

Add a Custom Panel to the Gutenberg Document Sidebar with PluginDocument ...

Add a custom panel to the Document sidebar with PluginDocumentSettingPanel The Document tab of the block editor holds the post settings: status, permalink, categories, featured image. Since WordPress 5.3, plugins can add their own collapsible panel there with PluginDocumentSettingPanel. For a field that belongs to the whole post, like a release year or a “featured”…
Control WordPress Plugin and Theme Auto-Updates with auto_update_plugin Filter (WP 5.5)

Control WordPress Plugin and Theme Auto-Updates with auto_update_plugin ...

Control plugin and theme auto-updates with auto_update_plugin WordPress 5.5 added “Enable auto-updates” links to the Plugins and Themes screens: an administrator can switch automatic updates on per plugin or theme, and WordPress installs new versions in the background twice a day. The filters behind it, auto_update_plugin and auto_update_theme, have existed since WordPress 3.7, and they…
WordPress wp_add_inline_script vs wp_localize_script: When to Use Each

WordPress wp_add_inline_script vs wp_localize_script: When to Use Each

wp_localize_script() or wp_add_inline_script(): passing data to JavaScript Scripts often need values from PHP: the AJAX URL, a nonce, translated messages, settings of the current page. WordPress has two functions for printing such data next to an enqueued script. wp_localize_script() turns a PHP array into a global JavaScript object. wp_add_inline_script() (WordPress 4.5+) adds any JavaScript code…
Register Custom WordPress Rewrite Rules with add_rewrite_rule and add_rewrite_tag

Register Custom WordPress Rewrite Rules with add_rewrite_rule and add_re ...

Custom URL structures with add_rewrite_rule() and query variables Post types, taxonomies and endpoints produce their URLs automatically. When you need a structure that none of them gives, for example /docs/installation/requirements/ where the first part is a section and the second a document, you write the rule yourself: a regular expression for the path and the…