Sub Plugin deactivation when Parent Plugin deactivate

You can use detect_plugin_deactivation, function detect_plugin_deactivation( $plugin, $network_activation ) { if ($plugin==”parentplugin/parentplugin.php”) { deactivate_plugins(plugin_basename(__FILE__)); } } add_action( ‘deactivated_plugin’, ‘detect_plugin_deactivation’, 10, 2 ); Add this snippet in your plugin’s main file.

unable to remove malware from wp website [closed]

Over the years, I have developed a process/procedure to recover a hacked site. While backups are good, it’s not always clear that a backup is ‘clean’ and not hacked. My process includes reinstalling all code (WP, plugins, themes) manually (themes/plugins via FTP from known good source, WP via the ‘update again’ on the Update page), … Read more

Error When Trying To Login [closed]

Yes, the error is caused by the MyFont’s plugin (or whatever it is called). You should go to their support forum for help, after making sure that you have the latest version (download/ftp transfer manually, or reinstall via Add Plugin).

Add “Featured Image” box in my plugin post page

You can add that featured image metabox you’ve circled to your custom post type by doing: register_post_type( ‘yourCPTslug’, [ //… ‘supports’ => [‘title’, ‘editor’, ‘thumbnail’] // note: thumbnail ] ); add_action( ‘after_setup_theme’, function () { add_theme_support( ‘post-thumbnails’ , [‘yourCPTslug’] ); }); As for a single function calling it in a position where you want it … Read more

Customizing a blog page layout

Copied from the WordPress developer documentation on ‘Template Hierachy’, the blog template is displayed using the following template file rules: If your blog is at http://example.com/blog/ and a visitor clicks on a link to a category page such as http://example.com/blog/category/your-cat/, WordPress looks for a template file in the current theme’s directory that matches the category’s … Read more

Which filter/action should I use to serve content for “virtual” files

I think the earliest actions you can hook are muplugins_loaded and plugins_loaded. muplugins_loaded will only fire for Must Use Plugins. Some plugins_loaded pseudo-code: add_action( ‘plugins_loaded’, ‘wpd_plugin_routes’ ); function wpd_plugin_routes() { if( is_a_virtual_file() ){ serve_file(); exit; } } If you want the full WordPress environment, plugins, theme, and authenticated user, right before WordPress parses the request, … Read more

Export postmeta (custom fields)

For plugin “All Export”: Create the necessary functions and give it to save and then in each created field add the name of the function corresponding to the necessary field and the variable containing the data is $value, example: function address($value){ $data = maybe_unserialize($value); $data = $data[address]; return $data; } function latitud($value){ $data = maybe_unserialize($value); … Read more