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?
- 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
- add_action in a function, is it possible?
- Add action hook conditionally – only when home.php in use
- 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?
- Add body class of category parent
- Change meta tags programatically
- Programmatically Add Font-Awesome Icons to Category Widget
- Remove bulk actions based on user role or capabilities
- Reuse variable in hook callback
- How to override filter in child theme?
- 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
- How to get Custom Post ID by adding filter to child theme’s function
- Manipulate Output of wp_list_something: select menu instead of li’s
- Post Pagination Showing Same Posts Every Page
- Show excerpt for only first post in query
- Defining a global array in functions.php?
- Hook specific functions if on a specific admin page
- Can’t check if a post has thumbnail adding filter to get_post_metadata()
- Don’t delete a page if it holds users
- Passing values from a widget to a function within a plugin
- Publish/Update post is changing image links from file url to post url
- Replace a menu with widget or a custom template file programmatically
- Wait a result before enqueue
- Multiple Loops Meta Data
- Run wp_kses_decode_entities on atom feed?
- Can’t filter wp_get_attachment_link
- Function added using `add_action()` not being called
- jQuery does not work
- Modify post filter to set custom number of posts per page and exclude child posts
- Override a function defined in wp-includes/comment-template.php
- Two functions with different arguments and add_actions, but identical code
- How to edit the Tags within the image file URLs?
- How to add_filter html template to middle of content
- Scripts not loading when using the wp_enqueue_scripts action
- How to edit classes in body tag?
- current_user_can comma list vs OR (||) list
- Combine embed_oembed_html and oembed_result
- 400 Bad Request – JavaScript App calling Custom wp-json endpoint
- Native gallery custom html output
- The_content and Preg_replace in loaded Iframe [closed]
- Changing where my author box is printed
- Use add_action within template
- How do I register a new settings page? [closed]
- Problem with custom function when I go back with the browser
- Replace admin header logo with an image
- template_redirect action only firing if logged in
- Any adverse effects of adding apply_filters to a function?
- How to use wp_enqueue_script properly?
- Using get_terms for custom taxonomy in functions.php
- Customizing the wp_video_shortcode output with add_filter
- Issue passing action class to nested function. Admin Columns
- Removing comment lines from all enqueued js files using a filter function
- How do you insert code into the sidebar?
- Allow user only create specific tags
- Use action, filter, or hook to append HTML to WordPress plugin function
- Child theme remove parent filter in functions
- use add_action in a shortcode (gravity form – WordPress)
- add product thumbnail to checkout page only and include variation name
- Remove External Links from WordPress posts Using add_filter() in Theme functions.php
- Hide disclaimer from summary excerpts
- Only seems to be displaying one child when there are supposed to be multiple
- Why might wptexturize have become re-enabled?
- Sending Messages Back to the Template After Processing?
- Shortcode to eliminate and replace with
- custom COOKIE on custom page
- Problem in outputting shortcode
- How to Add A Rel Filter to All Links?
- Allow tags and attributes in post and pages content
- Override parent theme function that is not hooked or in the functions.php file
- child_of not working while searching
- How to Insert A List of Posts in A Category Written by the Author into the Author Archive
- Do something when user creates post (that’s pending)
- How do I access variables outside a function [closed]
- Filter to strip unnecessary attributes
- add variable to actions/functions across different files (woocommerce)
- function to show youtube videos within excerpt – if condition and apply_filters
- HELP: Code To Check Status And Write Debug Entry