WordPress hooks only work with global functions ( or public function inside a class ) – private or protected methods are not available due to their visibility level, so not available to the way WP calls actions or filters.
What you are trying to do is tidy up your code using a class to contain all the functions (
called methods inside a class ), this seems like a good idea, until you review it – and then you notice the bad code smell – you’re writing proxy OOP – not real OOP – and this offers little justifiable benefit.
WordPress is partly responsible, but your plugin design is also responsible – you need to understand the patterns and refactor your plan – OR NOT.. because maybe it works better as procedural code than OOP…
Related Posts:
- How to add a button to custom post type’s posts-page
- How often do you need to register_post_type?
- How to register custom post types in a plugin?
- Row actions not showing? Why?
- How to append element after thumbnail
- Adding Meta Boxes while Registering a Post Type in a Class
- Dynamic Custom Post Type Plugin
- Get rewrite slug of custom post type in template
- Admin notice not displaying
- Insert Multiple Post with Same Publish Button
- Why is conditionally loading a custom plugin’s code only on a specific custom post type causing the site content to disappear?
- How to customize a permalink (URL) structure?
- Use custom metabox to update automatically a post after a given date
- Problems wp_insert_post and save_posts filter
- Show current custom taxonomy
- How exclude or skip post type with get_next_post_link
- WordPress: Custom User Role cannot access Custom Post Type | “Sorry, you are not allowed to access this page”
- How do I add custom HTML to the content of an archive page’s posts?
- Validate Custom Post Type fields
- Creating alternate meta box context locations
- Accessing a protected property of a post
- Custom post type page with parameter
- Change Dropdown jQuery to show/hide but with default place holder that shows all
- How to show the post which checkbox is not selected
- Is it possible to get the specific content on the search page?
- Title and URL Error in Breadcrumb Navigation for Custom Post Types
- Changing CPT permalink
- Dynamic page for nav items used as filters
- Having issue on Loading Meta Data From CSV to CPT
- Correct way to register custom post type from external php file?
- call a function when insert and update a custom post type
- Execute code only after user clicks ‘update’ button for CPT being edited
- Meta Box not being added in plugin
- How to string lines from the_content() hook in WordPress?
- How to dynamically register custom post type
- Custom post type template not loading from plugin
- Remove H1 title in admin post edit screen
- How do you output custom code between posts in the loop?
- Show ACF field from custom taxonomy and display on the single template
- How to allow “Add New” capability of CPT when links to its UI are placed as a submenu?
- Change message given when deleting post from custom post type
- How to add notification in the sidebar of the administration panel when a Custom post type is created? [duplicate]
- Hierarchical or Non-hierarchical Custom Post Type in Real World Example
- Display children and grandchildren of a custom post type
- how to set default value for checkbox in wordpress
- How do I include drag-and-drop in a plugin?
- Remove “Get Shortlink” button in admin of custom post type
- wordpress custom post type remove duplicate menu item
- How could I create a ‘private comments’ section on a custom post type?
- Using WPAlchemy metabox values in another metabox
- Is it a good practice to include custom options when registering a post type?
- is_page_template not working as expected
- List terms from Custom Taxonomy
- Custom Post Type get_post_type_archive_link( $post_type ) returns false
- How do I set the link in the Custom Post Type admin menu?
- How to List Thumbnails based on Custom Categories
- WP_Query search posts by custom post type and custom taxonomy
- How to have the right design for a custom post type without accessing themes
- Order WordPress Custom Taxonomy Pages & Pagination Not Working
- I am having a problem with form updating/editing WordPress post on the frontend
- How to filter out post type meta?
- How to rename image at uploading on specific plugin or post-type in WordPress
- How to make in WordPress admin panel sortable column for the custom field, that count the number of page impressions?
- How to set a custom path, for ajax image upload folder in admin?
- Custom Blog Post Listing in Genesis Sample Child Theme
- handling csv data with a custom post type
- Display custom field of specific post where post title matches variable
- WordPress Ajax callback function from plugin – OOP
- Conditional to modify query results
- How do I alter the position of a Custom Post Type menu item within my plugin admin menu?
- Creating a custom post type using a object oriented approach?
- Customize permalink when creating a post
- Loop through posts of a custom-post-type (event) and create .ics (iCal) file?
- Custom Taxonomy Not Showing in Menu
- Custom Post Type | Fatal Error on register_post_type()
- Output custom post shortcode. Help spot the error.
- How to count custom post types with conditional operators
- Set a default category – if the user didn’t select one- before creating a post
- Set object terms not working on plugin activation
- Using custom page templates with plugin [duplicate]
- need advice on how to do a lists using custom post types – taxonomy vs postmeta
- Can’t unregister parent theme’s CPT from my child theme
- WP_Query is printing out only one post when posts_per_page is set to multiple
- WP Query to displaying date and posts for that date?
- GravityForm: Populate Dropdown with custom post type [closed]
- Return array of categories to php function for current post
- Link users to a custom post type
- action hook wp_head higher priority as all other plugins/hooks
- Create a random unique 6 digit number as custom field for custom post type
- How to output wordpress custom tags separated by comma?
- Get all of user’s custom post types in WP Admin for plugin
- Modifying date filter on admin page for custom post type to link to custom field
- Loading all files within a directory
- Issue with pre_get_posts on custom post type archive pages
- Blog page showing same content as homepage
- Custom Post Type Navigation on Custom Field
- Custom Post Type Taxonomies -Posts not showing in Category or Tag pages
- Using several custom fields as custom post title
- Custom Post Type without an archive page
- Plugin translation not working apart from name and description