content_save_pre
would be a much better hook for stripping the images, and as for setting post thumbnail as post Meta you can use save_post
since the first hook gets fired before post Id is set and you need that for update_post_meta
.
Related Posts:
- Extract image from content and set it as the featured image
- Edit the_content function
- How to auto-update child posts whenever the parent post is updated?
- Make WordPress size and name images for Retina.js
- WordPress function/template tag to get first n words of the content
- Pinterest Integration Using functions.php
- How to run a function once on every post in database?
- Allowing SVG uploads in media uploader without plug-in
- Unable to get_the_content(); of a post in WordPress via AJAX
- Execute function after a post has been published
- Automatically wrap multiple images in div
- How can I add text to all posts/pages/categories/homepage etc
- Publish/Update post is changing image links from file url to post url
- Display post shortcode content in the sidebar?
- Events: Check for other event with same start date and category [closed]
- WordPress function saves a post twice and updates all posts
- Remove a category from a post when saving a new post
- If user is logged-in display/hide something
- Tags break custom Excerpt function
- Can’t add_action to ‘save_post’ and get it to fire
- Perform function on publish AND save (not just save)
- the_excerpt function not showing image
- save_post function keeps triggering: Warning: array_map(): Argument #2 should be an array… when restoring from trash
- save_post doesn’t correctly process function call with php class
- What is best practices to move the following code into a function?
- Regex works in regexr, but not if I filter content [closed]
- Problem in outputting shortcode
- Problem in shortcode outputting content
- does acf_save_post cause endless loop?
- Integrating custom API for post content into Admin interface & Public Website [closed]
- Trying to get this function to show below the content
- Get category of post inside save_post hook
- How to add a data attribute to a WordPress menu item
- Functions.php code that only runs on localhost?
- hook a functions to change wp-config from functions.php
- Relative URLs and hide /wp-content/themes/
- Slugs as breadcrumbs for Pages
- Removing Unnecessary Text from Admin Menu without CSS
- Display WordPress Search
- My function doesn’t work into WordPress but outside, it works – what am I missing?
- Pages should have priority when using add_rewrite_rule
- Setting cookies in WordPress
- How to add iOS & fav icons to the theme?
- Defer all js except certain ones in functions.php file
- Getting RID of thickbox!
- Automatically insert php function into post $the_content
- Multisite, either change the name of sample-page or create new page
- What is the “icon” parameter in wp_get_attachment_image_src used for?
- How to use thumbnails in gallery?
- Hide Author.php template from specific user role
- How to display a default image for post thumbnail using functions.php?
- How can I load a javascript file that is type=”module” the WordPress way?
- How to manage arrays from custom functions stored in functions.php?
- Product Tags in Add New product as checkbox list [closed]
- Running a script before absolutely everything
- Run function when WordPress new multisite is created or ACF field is updated
- using `require` in my functions.php breaks the site
- Frontend tag edit/submit form
- Sections and tabs DRY – WordPress settings API
- How to fetch the name of the active menu?
- Custom function causes a 503 error after a couple of hours
- How can I show my latest tweet in my wordpress blog?
- How to retrieve the current post’s generated featured image size?
- Why There Is No “get content by ID” Function
- Function shortcode – Set Parameter
- Is there a way to prevent a function/method from being called outside a specific hook?
- get_next_posts_link() returns no result despite available posts
- Randomizing wp_tag_cloud() in child theme
- Nav menus all outputting the same links
- Secondary Menu and Logged In Users
- Modify gform_other_choice_value for specific form and specific field in Gravity Forms
- Adding code before post title with the_title produces weird results
- Add Link to Users List (Backend) to open each users front-end profile
- Editing the formatting.php file vs functions.php file?
- wp_usermeta – Read from database, but save function broken
- remove/hide wp-editor
- Function not saving unchecked checkbox
- Entirely Different Functions.php per Page?
- Problem with shortcode inside a shortcode
- Hide Author By-Line if After Certain Date
- wp_title() return random number
- How to offset main query without affecting other queries and backend
- ACF Date Form in Custom Admin Field
- How to add link rel tags on paginated posts?
- How to pass data from a plugin to functions.php
- Function to disable “href” anchor tags that contain “a data-name” on mobile only
- Execute jQuery with custom event listener after successfully add an item to the cart
- WordPress hooks to call a function inside a construct
- Translation Function missing text-domain [closed]
- disable WP_error: authentication_failed
- Load a Child Theme’s style.css just before the closing tag
- Can’t wrap my head around this function – any help would be appreciated
- Figure inlined width trigger distorted layout
- Exclude javascript in certain page url and all following url’s after forward slash
- Shortcode Variations?
- How to test for a class (from a plugin) in functions.php
- Child Theme not working – CSS gone
- Which template file to edit to edit homepage in Mystile [closed]
- comment_post function with js not running
- Problem with removing characters “<” – WpAllImport