On top of my head scheme like this should work:
// functions.php
function prefix_get_settings() {
return array('haha' => 'hehe');
}
add_filter( 'prefix_default_settings', 'prefix_get_settings', 9 );
// plugin
$default_settings = apply_filters( 'prefix_default_settings', array() );
Related Posts:
- Remove Actions/Filters added via Anonymous Functions
- How to restrict actions and filters “properly” by conditions
- Using add_filter() in Widgets
- Convert hyphen to underscore in permalinks
- How to update feed only 2-3 times a week (for Feedburner email)?
- How would go about if I just want a temporary function?
- Accepted arguments value in hook functions
- Which action hook to use for function?
- Modify a function without editing template
- How do I add Bootstrap and LESS to my migrated WordPress site?
- Override the WordPress core function wp_referer_field
- login_headertitle is deprecated since version 5.2.0
- Insert Content Before div#main from the functions.php File
- Save_post – Warning: Cannot modify header information
- post value to function with Ajax and jQuery
- How Do I Unhook This Parent Theme Function?
- Which method is more correct for removing WooCommerce Extensions menu item?
- previous_post_link inside of a function?
- disable a specefic sidebar when user is log out
- Remove Actions/Filters added via Anonymous Functions
- remove empty paragraphs from the_content?
- Add multiple custom fields to the general settings page
- remove_action on after_setup_theme not working from child theme
- Issues with title-tag and document_title_parts
- Trying to use add_action and do_action with parameters
- Set JPEG compression for specific custom image sizes
- Check if post is being published for the first time, or is an already published post being updated
- Define custom Page Template without its own .php file
- How to use the do_action () with parameter
- Add class to menu items of one specific menu (nav_menu_css_class)
- Perform an action when post is updated/published
- How to influence the information displayed on widget inside wp-admin
- WordPress Theme Update Action?
- Extract image from content and set it as the featured image
- Do WordPress’ cron’s clean up expired transients?
- Removing default image size list in Media Box
- add_action in a function, is it possible?
- Using a private method as an action callback from within a class
- How to publish a post with empty title and empty content?
- Refresh page after form action
- How to count number of functions attached to an action hook?
- Add action hook conditionally – only when home.php in use
- Filter the query ONLY for the search results page
- bloginfo() vs get_option?
- opening links in new tab using – add_filter( ‘the_content’, ‘make_clickable’);
- Customize WordPress Media Manager – Media Window
- Passing variables to templates (alternatives to globalizing variables)
- How can I tell if I’m on a login page? [duplicate]
- How to reduce original image quality on upload?
- Is it possible to use a forgot password url filter?
- syntax for remove_filter in parent theme with class
- Add body class of category parent
- what is the meaning of settings_fields()
- How do you permanently remove default rewrite rules from the wp_options table?
- Wrap gutenberg block ‘div’ in other elements/extra HTML
- Change meta tags programatically
- Override parent theme function that is not hooked or in the functions.php file
- Remove Page Title from Static Frontpage
- Using get_terms for custom taxonomy in functions.php
- Programmatically Add Font-Awesome Icons to Category Widget
- Fatal error: Call to undefined function add_action() – an untouched problem
- Set default options for inserting media
- Remove bulk actions based on user role or capabilities
- How to hook into the quick edit action?
- Default or Preset Content for Custom Post Types
- Reuse variable in hook callback
- Override a class function to include a custom template
- How to override filter in child theme?
- Call to undefined add_action() in theme’s functions.php
- Removing title from page
- Hide some items from Screen options in dashboard for products
- How to change a certain text or term of WordPress into a custom into the whole site?
- Adding body class when post contains a specific shortcode
- WooCommerce add_action hook results in 500 error
- Theme options WP Editor
- Why do filters/actions require an argument count?
- Replace Archive Widget Link Text
- Exclude Empty Child Categories in Menu
- How to make unique add_filter to the_content of specific page template files – so each template gets its own addition
- Automatically Add Specified Value to Attachment Metadata upon Upload
- Updating users_can_register option?
- Best way to programatically add “rel” attributes to page and post images
- Can’t Update function.php after writing short code
- How to get Custom Post ID by adding filter to child theme’s function
- add_filter priority problem
- Limit filter upgrader_post_install to a single plugin
- Manipulate Output of wp_list_something: select menu instead of li’s
- Clean-up script tags
- How to use IF Statement in WordPress?
- Gravity Forms field entries into wp_query loop [closed]
- Fatal error when trying to get admin email on contact form
- Post Pagination Showing Same Posts Every Page
- Show excerpt for only first post in query
- Remove function or filter
- options.php problem – data not saved
- modify a function filter
- Global functions on WPMU
- Super simple shortcode not working
- Generating rel=prev and rel=next only on wordpress categories
- How to make applyFilters function return false via functions.php