Override Widget class in plugins with custom plugin

You’re actually quite close to answering your own question. Your plugin would have to start with checking whether the plugin is active (which you can also do with function_exists). The you indeed can use remove_action to make sure functions and classes aren’t activated. This doesn’t mean these functions become undefined. So yes, you will need … Read more

What exactly does $wp_filesystem->abspath() return?

If you check out the source of abspath(): public function abspath() { $folder = $this->find_folder(ABSPATH); // Perhaps the FTP folder is rooted at the WordPress install, Check for wp-includes folder in root, Could have some false positives, but rare. if ( ! $folder && $this->is_dir( “https://wordpress.stackexchange.com/” . WPINC ) ) $folder=”https://wordpress.stackexchange.com/”; return $folder; } .. … Read more

OEmbed from Pinterest

I found that https://wordpress.org/plugins/pinterest-widgets actually has the needed functionality but doesn’t mention it in the description. After installing and activating you can add a pinboard to a post by using the following shortcodes [pin_board url=”http://www.pinterest.com/pinterest/pin-pets/”] [pin_board url=”http://www.pinterest.com/pinterest/pin-pets/” size=”header”] [pin_board url=”http://www.pinterest.com/pinterest/pin-pets/” size=”custom” image_width=”100″ board_width=”900″ board_height=”450″] more options can be found on the plugins “settings” page after … Read more

Plugin development: how to create a form and get custom data?

The details of processing form data is specific to PHP therefore I will not go into it. The WordPress-specific part is that you want your code to be run on the ‘init’ event in order to have access to WordPress functions and globals (such as the users permissions). <?php add_action(‘init’, function(){ $reservation_capacity = sanitize_text_field( $_POST[‘reservation_capacity’] … Read more

Files being generated in multiple directories supposedly by WordPress (advanced_settings.php and common_config.php)

These files are part of a PHP malware infection. We are in the process of cleaning up an ongoing infection that has a very similar behavior. While this PHP malware also infects non WordPress as well, when it attacks a WordPress site, we are noticing some very consistent patterns: Two files (“advanced_settings.php” and “common_config.php”) which … Read more

How do I configure WordPress to talk to a Microsoft SQL Server database?

I think there is a new approach to it: https://blogs.msdn.microsoft.com/brian_swan/2010/05/12/running-wordpress-on-sql-server/ You can also use a 3rd party version of WordPress (not my cup of tea, by the way): https://code.google.com/archive/p/wordpress-mssql/ https://github.com/ProjectNami/projectnami Or follow this guide, but it might be a bit old: https://blog.building-blocks.com/installing-wordpress-on-windows-using-sql-server-2008-r2-part-1/ In the end I think the first link would be the best approach. … Read more

Syncing production with staging

If you are using Pantheon for hosting it turns out to be trivial to do this as a test (they call it dev), stage (they call it test) and production server are built into their platform along with tools to manage moving data and files around. Plus with Pantheon you get easy but optional Git … Read more

WordPress error – PHP Fatal error: Uncaught Error: Call to undefined function register_block_type_from_metadata()

What comes to my mind is that You should check Your wp-settings.php file, as it should include wp-includes/blocks.php file where “register_block_type_from_metadata” function is defined check that file for this line of code: require ABSPATH . WPINC . ‘/blocks.php’; if its not there, then Your wordpress installation could have been either hacked or interupted while updating … Read more