Use composer to load custom classes [closed]

Without more context from you, I can only assume and show you what I have done that works for me using PSR4 Autoloading. Example: Assuming that all my custom class directories and files is in ./inc folder In your composer.json, add this “autoload”: { “psr-4”: { “Inc\\”: “./inc” } } Inc is the vendor name … Read more

Build dynamic page from cURL (HTML page) response with plugin

To make this work with WordPress use the AJAX API. While that technically refers to Javascript it will handle any request if the appropriate values are sent. You would create a callback like this one form the Codex: add_action(‘wp_ajax_my_action’, ‘my_action_callback’); function my_action_callback() { global $wpdb; // this is how you get access to the database … Read more

prevent showing posts of an specific category in admin posts section

You can use the pre_get_posts action to affect any queries, both in frontend and admin. In your case you should make sure you affect only admin queries and you can even use get_current_screen to narrow it down further. Here’s an example that would modify the query only on the regular posts page: add_action (‘pre_get_posts’, ‘wpse311946_restrict_cats’); … Read more