Oviously, you’ll have to edit something if you want to modify it. So, your best course of action is to create a child theme, with its own function file.
A filter, as you tried, won’t work, because there is no filter hook in the function that you are trying to modify. What you can do, is remove the action that is printing the footer and then add a new action on the same hook. Like this:
add_action ('wp_head','wpse252108_remove_add_action');
function wpse252108_remove_add_action() {
remove_action ('book_landing_page_footer', 'book_landing_page_footer_credit', 40);
add_action ('book_landing_page_footer', 'new_credit', 40)
}
Because it’s unclear where in the flow template-hooks.php
, the place where the original action is added, is loaded, it is possible that wp_head
is too early to do the add/remove action. Perhaps wp_footer
is better, though that in turn might be too late.
Related Posts:
- Accepted arguments value in hook functions
- Which action hook to use for function?
- Override the WordPress core function wp_referer_field
- Insert Content Before div#main from the functions.php File
- Save_post – Warning: Cannot modify header information
- How Do I Unhook This Parent Theme Function?
- Issues with title-tag and document_title_parts
- Remove Actions/Filters added via Anonymous Functions
- Define custom Page Template without its own .php file
- How to influence the information displayed on widget inside wp-admin
- Extract image from content and set it as the featured image
- How to restrict actions and filters “properly” by conditions
- Add action hook conditionally – only when home.php in use
- Using add_filter() in Widgets
- How can I tell if I’m on a login page? [duplicate]
- Convert hyphen to underscore in permalinks
- Remove Page Title from Static Frontpage
- How to hook into the quick edit action?
- WooCommerce add_action hook results in 500 error
- How to update feed only 2-3 times a week (for Feedburner email)?
- Gravity Forms field entries into wp_query loop [closed]
- How would go about if I just want a temporary function?
- Get current page_id before loop, in functions.php
- Don’t delete a page if it holds users
- How do I add Bootstrap and LESS to my migrated WordPress site?
- Passing values from a widget to a function within a plugin
- Which action does wp_update_user triggers?
- How can I get my Script to work on the Login page?
- Trigger a custom function when option are saved in admin area
- What did I do wrong in my functions code, that will not change the “Get New Password” text to “Send It”?
- Replace a menu with widget or a custom template file programmatically
- jQuery does not work
- Add Element as a Filter to the_content
- How to edit the Tags within the image file URLs?
- Can’t properly set the_title add_filter to show short_URL
- How to add_filter html template to middle of content
- (Woocommerce) Order by price when entering specific category
- Is there a way to prevent a function/method from being called outside a specific hook?
- Call to undefined function is_home() or any conditional tags
- Possible to hook into Media Library preview File column and use a custom image?
- Adding code before post title with the_title produces weird results
- Add back in child theme what the parent theme removed with remove_action
- login_headertitle is deprecated since version 5.2.0
- Changing where my author box is printed
- Is it possible to use add_filter in an included file in the child theme’s functions.php?
- Add Adsense code between job listings – wp job manager plugin
- Replace admin header logo with an image
- What filter or action hook to use in order to load some code before the template begins printing in BuddyPress? [closed]
- Changing the text of Upload/Insert on Posts and Pages Screen
- Does hook have an effect on increasing the page load?
- What is the earliest Hook a Script can use?
- custom error message for empty username and password using authenticate filter not working
- post value to function with Ajax and jQuery
- Use action, filter, or hook to append HTML to WordPress plugin function
- Which method is more correct for removing WooCommerce Extensions menu item?
- WordPress hooks to call a function inside a construct
- previous_post_link inside of a function?
- Retrieve a custom form field modified by a filter
- Function the_content
- Settings in functions.php used by a plugin
- Force resize for all video content
- add query string to all pages after user logged in
- delete_term is not working properly with add_action()
- Is there a hook that I can use when a fatal error occurs?
- Does hooking into the same action multiple times drain memory?
- Valid characters for actions, hooks and filters
- How do I Make a Theme “plugin-ready”?
- How to use filter hook ‘post_updated_messages’ in coherence with action hook ‘save_post’
- Is it possible to create an action hook using do_action() within add_action()?
- Call to undefined add_action() in theme’s functions.php
- Is it possible to be more page/post specific with admin_enqueue_script?
- Too many actions/filters!
- Can I use require() function in a template file?
- Exclude Empty Child Categories in Menu
- add_filter priority problem
- How do I pass arguments for multiple functions hooked to a single action?
- Only let plugin add actions to wp_head & wp_footer on single posts
- Get Time Taken By Each Action Hook in WordPress
- How to use wp_trash_post (or wp_delete_post) for deleting a (or all) post(s) from custom post type?
- How do I hook into the container of wp_nav_menu?
- Remove links from the_content when using filters wp_trim_excerpt
- remove_action not removing add_action from constructor
- Function not working inside of a function in functions.php
- Set “woocommerce_is_purchasable” to false for specific “$product->is_stock_status”
- This code works, but the way I integrated it is breaking the media uploader. How can I integrate it properly?
- Use has_filter on comment_post
- Display taxonomy with a maximum number of letters
- Changing the HTML of notices in WooCommerce [closed]
- How to use WP conditional tag in a functions.php with OCEANWP Theme?
- Modifying a WordPress Plugin
- Get post_author email for Zapier Integration
- Newest comments first not working
- Pass arguments to function class with do_action()
- What add_action reference should I be using or should I use do_action?
- Allow the access over wp-login.php
- Add custom fields after post/page title
- Way of getting queried loop before the query with a filter hook?
- Trying to get this function to show below the content
- Creating mixture of shortcodes to use in the visual/text editor
- How to Add Extra Text In WordPress Title Before Post Publish