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

Custom plugin – load enqueue only for this plugin

The WordPress documentation for admin_enqueue_scripts says that you can: function load_custom_wp_admin_style($hook) { // Load only on ?page=mypluginname if($hook != ‘toplevel_page_mypluginname’) { return; } wp_enqueue_style( ‘custom_wp_admin_css’, plugins_url(‘admin-style.css’, __FILE__) ); } add_action( ‘admin_enqueue_scripts’, ‘load_custom_wp_admin_style’ ); Basically, you’re being passed $hook and it should be the value of your page name, which is the name you’ve chosen.

How to Include Fields in Query String When Making Request of WordPress.org Plugin API?

HT to otto42 on the WordPress Slack who pointed out that false might be evaluating as true and to instead try using 0…which I did and it worked: https://api.wordpress.org/plugins/info/1.1/?action=query_plugins&request[per_page]=10&request[browse]=popular&request[fields]How to Include Fields in Query String When Making Request of WordPress.org Plugin API?=0&request[page]=1