depends if you want to write OOP or just use PHP classes 😉
wordpress hook system is procedural in nature and there is a big amount of globals being used so it takes some mental effort to translate it into actual OOP. Most (99.9%) people attempting this fail and produce something which is basically procedural code wrapped in a class.
TL;Dr You can use whatever the language lets you. Callbacks are usually a point where people fail especially when you need to have an option to remove them from a hook
Related Posts:
- Plugin Form Submission Best Practice
- PHP error with shortcode handler from a class
- Using a plugin class inside a template
- How to create a flexible abstraction for WP_Query?
- What is the correct way to build a widget using OOP
- How to make method from plugin available in theme?
- Using OOP plugin’s methods throughout the website
- Single Responsibility Principle and WP Classes
- How Can I Add a Filter to Class Instance Only?
- The ideal place for storing persistent PHP objects
- Plugin Architecture/Design Pattern – is better to use a private Observer/Mediator Pattern for plugin subclasses or WP add_action?
- Using a front controller in a WordPress plugin, any suggestions?
- set_sale_price in WooCommerce [closed]
- WordPress Ajax callback function from plugin – OOP
- How do you render_callback for register_block_type to a method in another class?
- How to Create database table when Plugin installed/activated, and delete database when Plugin deleted
- Registering and using actions which return results in a Plugin class
- Advice on plugin structure
- Applying OO patterns and principles to plugin development
- Creating a shortcode, but getting tied up with OOP and Classes?
- Plugin Architecture Question: How to avoid using transients
- What is the proper method of using global $post?
- Dynamically creating classes for Widget API
- WordPress class, using add_action to call member function does not work
- Remove an action by extending class and replacing it
- A question about add_action()
- WordPress plugin development OOP style
- OOP plugin not working
- How to call a function from a shortcode function in an oop plugin
- Bad request 400 using class based files
- functions won’t fire after I converted my code from procedural code to OOP
- Performing ajax request in wordpress
- Error when activating a custom plugin on production server
- OOP development and hooks
- How to set a public variable in someone else’s plugin class
- How to Maintain url on form submit
- How is construct function working even when variable is assigned null value?
- Object Oriented plugin, add action and variables
- How do I create Widget within plugin that uses its own class?
- How To Remove The Filter That Adds JetPack Related Content To Dom [closed]
- Method not receiving attributes from shortcode call, general OOP problems
- What do you think about custom designed plugin/theme options UIs?
- Is it necessary to bump a plug-in’s version if you’re just updating the “Tested up to” attribute?
- Adding Widget form fields dynamically
- Custom action button in Gutenberg editor (post_submitbox_misc_actions – equivalent)
- Update a Plugin while maintaining back compatibility: general
- Do I need to use WP_Filesystem when creating a downloadable file on the fly?
- Plugin development with unit tests
- Change WordPress.org hosted plugin readme.txt
- `wp_set_script_translations` with `wp.i18n` does not return translated strings in simple plugin
- Problem with `wp_mail()`
- How to add meta boxes to the ‘Add new post’ screen?
- Cannot modify header information – headers already sent by pluggable.php
- htmlentities and editing text
- Gutenberg registerFormatType with Multiple Classes
- Translate strings not recognised in plugin
- How to use WP_Term with (menu) argument in the wp_nav_menu?
- When to use add_settings_section vs just register_setting?
- How to customize login process
- Adding more text to a post, after it was published
- How to query custom db table?
- How to only load css for used blocks on frontend
- Update wordpress Core Remotely
- Proper way to use useSelect
- Access to apache logs from plugin
- Two different wordpress sites – same server and IP address. Gaining Access to database 1 of 2
- Translating plugin settings page – dropdown list
- Hide one specific woocoomerce product
- settings api – add_settings_section not working
- Remove Meta-boxes (Yoast SEO plugin) [duplicate]
- Can I use a custom post type as a custom taxonomy for a different custom post type?
- wp_schedule_single_event is set correctly but sometimes not fired
- Attaching Image-file to userId
- wp.media gallery collection sometimes undefined
- Can’t load a script in my plugin page
- ajax call return 406 not acceptable for non logged users only
- $ is not defined [duplicate]
- replacing jquery google cdn with a new version dynamically
- Dynamically getting tags in post edit screen
- How do WordPress plugins work with oAuth2 APIs?
- WordPress mails being sent from @locahost and being rejected
- How to implement pagination into a wpdb->result query?
- Slug is not shown for my custom post type
- wp_register_sidebar_widget in loop within a plugin?
- Safe XML response from wordpress plugin
- Gutenberg: – Call a function after Server Side Component is rendered
- How are themes and plugins localized using the gettext GNU framework?
- Theme, Plugin or Both?
- Accept only PDF file for upload
- WordPress upload path decalration
- Add a custom image source
- filter on get_posts efficiently
- How to get custom user meta by id in custom Gutenberg block
- How to prepend a header section to all pages related to my WordPress Plugin
- How to access Elementor-navigation-elements via jQuery
- Hook a search form anywhere on the site, using a custom plugin
- Plugin forms overwrite each other’s options
- ACF – programmatically install and activate in pipeline to automate testing for custom plugin development?
- How can I include React useState in a custom gutenberg block plugin?
- Problem with Owl Carousel, infinite loop [closed]