WordPress Developer Ukraine, Kyiv
Build a Custom Admin List Table in WordPress with WP_List_Table

Build a Custom Admin List Table in WordPress with WP_List_Table

Build an admin list table with WP_List_Table The lists of posts, pages, users and comments in the admin are all built with the WP_List_Table class: columns, sorting links, bulk actions, row actions, pagination. A plugin that shows its own records (form leads, log entries, imports) can extend the same class and get a screen that…
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…