If each plugin/theme functions on its own, then you should probably drop the the library in every theme/plugin.
Then just check to see if it a class or function from the third-party library exists before requiring it.
<?php
if( class_exists( 'SomeClass' ) )
{
// require/include here
}
or
<?php
if( function_exists( 'some_function' ) )
{
// Require/include stuff here
}
Alternatively, you could wrap every function/class/variable/constant from the third party library in a check to see if it exists, like pluggable functions.
If all of the plugins and the theme are dependent on one another, then it doesn’t really make much sense to divide them up and you should probably rethink that.
Related Posts:
- Objective Best Practices for Plugin Development? [closed]
- How do i best handle custom plugin page actions?
- How to create an API for my plugin?
- Is it ever okay to include inline CSS in plugins?
- Plugins in symlinked directories?
- In Which Contexts are Plugins Responsible for Data Validation/Sanitization?
- Plugin Form Submission Best Practice
- Best way to abort plugin in case of insufficient PHP version?
- How can I configure Docker for developing and deploying a custom theme?
- What do you think about custom designed plugin/theme options UIs?
- No Error Log File, no debug info
- Is the new WordPress 3.1 admin bar pluggable and how can I extend it?
- How to use PanelColorSettings in custom Gutenberg block?
- Getting a peer review for my new plugin?
- Optimize shortcode callbacks
- How to integrate a PHP webmail script into the backend of WordPress?
- Using filters and actions for plugin API?
- Is There A Hook To Process The Content Of The Text Widget?
- How to Change the Entire WordPress Admin panel Look and Feel?
- When wp_schedule_event action has two possible directions, how to avoid an infinite loop?
- How to log plugin errors to plugin error_log file
- Which to use to execute code during the saving of a plugin settings page?
- Custom theme sufficient or custom plugin neccessary for this feature set?
- When to check if a function exists
- How to create custom home page via plugin?
- Adding callback function for wp_ajax_ has no effect
- Sessions not creating correctly in custom function
- Featured Image not showing in admin
- How to use wp_set_password in a plugin?
- How Can I setup WP CLI on Windows development machine running AMPPS?
- WP_LOCALIZE_SCRIPT doesn’t work
- Nuance in adding CPT and TAX to a submenu
- Can I differentiate between “Delete Post Permanently” and “Empty Trash” and do something for each accordingly?
- Are we allowed to use the Allman (BSD) indent style when coding WordPress plugins and themes?
- Get the password key when using the wp_new_user_notification_email filter
- How to deal with equal & similar arguments for a function?
- Customizer: widget-synced triggers twice
- WordPress not working on localhost
- Adding functions to hooks from within a class
- Disable The Events Calendar plugin from loading its scripts
- Applying OO patterns and principles to plugin development
- Is it possible to change a term slug before being saved to the database?
- Maximum lifetime for nonce
- Add code inside specific wordpress standard function
- Custom Taxonomy to dropdown box on adminside wordpress
- Create a free scripts and styles template within a plugin
- How to modify the comments to be displayed in a post?
- How can I turn a custom wordpress page into a product page?
- How can we display product price $104 on the cart while the credit card payment method is checked?
- Incorporate small angular feature in my wordpress site
- How to Bind one post object Type with other postobject Type in Advanced Custom field [closed]
- Search: how to extend the existing search to include a custom table
- Is there documentation reference for forms in menu and setting pages?
- Enqueue script globally
- How should I go about registering JavaScript that isn’t a file? [duplicate]
- Custom entity search and display
- Plugin: database creation
- Loading Modernizr (or other JavaScript libraries) for use in a plugin
- Show message from backend
- Why in this archive page that call query_posts() function show only the last 10 posts?
- Logout after clicking URL link results in “headers already sent” error
- how to save wp_editor html content in options table
- Converting core modification to a plugin
- How to replace settings in WordPress plugin from a theme
- How to remove/replace current page template?
- Setting a post’s category
- Extract Information from post content (using regex?)
- How to determine which capability to use?
- Serial Number from custom table not appear in woocommerce_email_before_order_table action
- Customise Grouped Product display in Woocommerce with custom column
- How to create a custom post-new.php page for plugin , no wp menu
- Want to know how to reveal a WordPress theme, considering the theme name is hidden?
- WP Refused to display ‘URL’ in a frame because it set ‘X-Frame-Options’ to ‘sameorigin’
- Save meta box data from selected dropdown list in bbpress reply form
- Metabox types list
- Where to save Gutenberg plugin data?
- WordPress how do I echo SUM from a column of a MySQL table by user id AND type_operation
- Rate limiting ajax requests in WordPress
- How to prevent users from deleting their accounts?
- Hiding class namespace from plugin’s extensions
- Set widget icon in Customizer?
- Create Customization panel for Plugins not for theme
- external Integration with wordpress timeout error
- Add function to Dokan ajax class
- PHP includes with AJAX actions
- Making adding info to an overlay bio easy for average user?
- Implementing Select2 plugin into WordPress
- Custom Post Type and Functions
- Managing Custom Designed Content
- Can I access WordPress API’s from within plugin scripts?
- Best practice: What belongs in theme and what in plugin for large eCommerce website
- Link to a admin submenu item using a custom link
- Change the search results header from plugin
- Adding Meta box to thrid-party plugin
- Client Profiles
- Developing Themes on WordPress, Looking for Excellent Tutorials [closed]
- How to Implement SAM Broadcaster with WordPress? [closed]
- Is Explicit Versioning a better alternative to Semantic Versioning for wordpress?
- Extend WP_List_Table class – Edit wp_usermeta – WPPB.me Boilerplate – Action error
- Developing an IP lookup function using an API