If your code requires themes changes it belongs to the theme, usually the functions.php
. In a custom child theme this is not a problem, in a plugin for everyone, it will be much harder. 🙂
The best option to get a theme more flexible: Ask the theme author to add a hook. Provide a real use case. If you don’t want t wait, add the hooks to your child theme. See also ticket #21506 Standard Theme Hooks.
Update
Your use case – changing twentytwelve_entry_meta()
– cannot be cross-theme compatible for a simple reason: Not every theme comes with a similar function. Some themes use author name and associated terms in different locations, others don’t show this data at all.
Related Posts:
- Hook in wp.media to add a new tab
- Overide get_template_part( ‘partials/post’, ‘sidebar’ ); with a plugin
- What’s the earliest point I can get the queried object ID?
- Using Primary Color in Plugin Block
- Using a Theme inside a Plugin directory
- What is the best way to provide plugin users with a way to customized the styles
- Programmatically Selecting Theme Based on URL
- How to properly use a hook to create template for custom product type in a plugin such as Woocommerce? [closed]
- Fully automated theme install and activation via a plugin
- Calling plugins API within a theme
- Hook into theme-switching later than `setup_theme`
- WordPress security issue to output data from user input from theme option form
- Which themes do you use to test compatibilities with your plugin [closed]
- How to Debug: My Plugin Interferes With My Theme
- Theme Install using a Custom Repository
- Auto-Populate Image After Media Upload
- How to create a backend for a custom theme?
- How to make “upgrade safe” theme for a plugin?
- Are there any official or unofficial guidelines for the styling of a widget?
- Get images / media attached to a page by page ID
- Create fixed static pages
- How To Protect Plugin Display From Being Affected By Theme’s CSS
- Displaying custom content from a plugin within the active theme
- Getting Post ID at “stylesheet” and “template” hooks
- WordPress admin panel not working
- Override category archive page title (not the head title)
- How to hide/remvoe unnecessary field/section in post edit section ( Dashboard )
- Redirect theme directory to plugin theme directory
- Adding and handling custom settings tab to fusion element
- Post Pagination does not working on WP-Query
- Managing Custom Designed Content
- Create and style menu
- Developing Themes on WordPress, Looking for Excellent Tutorials [closed]
- Find Any Theme’s page.php File
- What’s the difference between term_id and term_taxonomy_id
- How are bulk actions handled in custom list table classes?
- Creating Settings Page with dropdowns for Plugin
- Empty POST data on server on AJAX request using Angular $http
- Custom Nav Menu items default to ‘menu-item-type’ => ‘custom’. How to make a “page” menu item?
- How to tell if an option has been created vs an empty option?
- How to get current page name in my wordpress plugin
- WP Cron doesn’t save or in post body
- Including file or library from other plugin
- Why isn’t the Settings API designed to work for plugins using custom admin menus? [duplicate]
- Is there any reason only 1 (my) IP would be added to this table using $wpdn->insert?
- Plugin activation error due to unexpected output
- How to store data for posts/pages built with drag-n-drop builder?
- WordPress Admin Post Type Table Class Filter Hook
- Order of Operation for these three hooks
- save_post hook not triggered in WP v3.6.1
- How to get the ID of the currently logged in user?
- Using a Shortcode to Replace Themes Stylesheet?
- Where should I put “run once” plugin pages?
- Slow WP_query due to nested wp_query. Need Suggestions
- Plugin Development Output
- How to modify product page for Jigoshop
- Is @wordpress/env locked to node v14 or can I also use node v16?
- Securing/Escaping Output of file content – reading via fread() in PHP
- Intermittent database errors when accessing WordPress database
- How to create a “View” page for entry in add_menu_page wordpress admin area (CRUD operation)
- what is the standard ulr for wordpress plugin development?
- Customize WooCommerce my account dashboard through plugin
- Create a custom capability to allow an ‘Editor’ to edit only ‘Subscriber’ users
- global $current_user not current user
- What is the proper way to get logged in user id in a plugin?
- Custom WordPress Plugin will install new and not update
- get_option() will not work without access to wp-config.php
- register_activation_hook on multisite
- How can I add a simple custom field to my plugin?
- Ajax is not working in a loop
- Bind a function with its own argument to show something dynamically after every content
- unable to wp_enqueue_script(‘suggest’);
- Plugin development – loading Javascript and Flash
- Drawing the line between theme & plugin on large scale bespoke projects
- Update variable value via add_filter
- Run uninstall.php if a checkbox is checked from settings page
- How to check whether checkbox is checked in WordPress customizer
- Gravity Forms Anchor only on Front Page?
- Multiple page plugin settings
- how to get the top 10 popular blogs
- How to output CSS to the beginning of the stylesheet in a WordPress Plugin
- Set page to draft on plugin deactivation
- Can one plugin activate another plugin via script?
- Insert and read media from the WordPress library and call in the plugin
- Override woocommerce loop-start.php from theme using plugin?
- Get value of custom checkbox from Gutenberg sidebar in plugin
- Enable a role named ‘backend_user’ to access my plugin pages
- Hiding class namespace from plugin’s extensions
- Relational / Associate tables using native WordPress functionality
- Changed media upload path for plugin, but generates error & shows wrong url
- Pull commentdata for pre_comment_on_post from comment_post_ID
- Woo-commerce: Adding additional page sections using a child theme
- Plugin dev: How to multiply instances of a plugin in the same metabox?
- How to get html tag ids from template?
- How to Rewrite WordPress URL for a Plugin
- How to Prove Ownership of plugin [closed]
- Reading the inside of
- WordPress, GIT, Renamed Plugin Dir + files – Working Code now Broken [closed]
- get_term_by() returning null on plugin
- Is it smart to require_once wp-admin/includes/plugin.php when you need only one function from it