Use e.g. the init hook instead. For instance;:
if (isset($_GET['convert'])) add_action('init', 'yourfunction');
(Come up with a better check, though. ?convert could mean anything. And secure it by checking for user permissions, that it hasn’t already run, etc.)
Related Posts:
- login_headertitle is deprecated since version 5.2.0
- Save_post – Warning: Cannot modify header information
- Remove Actions/Filters added via Anonymous Functions
- How to restrict actions and filters “properly” by conditions
- opening links in new tab using – add_filter( ‘the_content’, ‘make_clickable’);
- Using add_filter() in Widgets
- Convert hyphen to underscore in permalinks
- Default or Preset Content for Custom Post Types
- How to get Custom Post ID by adding filter to child theme’s function
- How to update feed only 2-3 times a week (for Feedburner email)?
- Accepted arguments value in hook functions
- Which action hook to use for function?
- str_replace function in theme
- Modify a function without editing template
- How do I add Bootstrap and LESS to my migrated WordPress site?
- Insert image in WordPress with HTML5 tag and caption function
- Override the WordPress core function wp_referer_field
- The_content and Preg_replace in loaded Iframe [closed]
- Insert Content Before div#main from the functions.php File
- Problem with images URL after filter applying
- New checkbox in custom widget isn’t saving data
- Modifying a WordPress Plugin
- 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?
- How to make an If Else on Excerpt Filter
- Shortcode to eliminate and replace with
- previous_post_link inside of a function?
- Settings in functions.php used by a plugin
- child_of not working while searching
- Check if post is being published for the first time, or is an already published post being updated
- How to influence the information displayed on widget inside wp-admin
- WordPress Theme Update Action?
- Using a private method as an action callback from within a class
- Filter the query ONLY for the search results page
- Customize WordPress Media Manager – Media Window
- Remove Page Title from Static Frontpage
- Set default options for inserting media
- How to hook into the quick edit action?
- Remove tag on my RSS Feed
- Override a class function to include a custom template
- WooCommerce add_action hook results in 500 error
- How to use IF Statement in WordPress?
- Gravity Forms field entries into wp_query loop [closed]
- Post Pagination Showing Same Posts Every Page
- modify a function filter
- Generating rel=prev and rel=next only on wordpress categories
- How to make applyFilters function return false via functions.php
- How to call custom function from functions.php in site-wide template files?
- Pass parameters to function through an action
- How to use return in my custom function instead of echo
- Custom HTML in specific category single page and its descendant categories
- Right way to update widget on dynamic new input field
- How to customly read JWPlayer’s “Playlist” items by using its “playlistid”?
- Twentyten Child Theme: header images display messed up in admin panel
- Disable auto-resizing of uploaded images, but only for certain filename
- Filter out other users comments. Visualize only own comments and editor role users’ comments
- Get Current Post ID in functions php, meta query filter
- Add to cart php not working [closed]
- What did I do wrong in my functions code, that will not change the “Get New Password” text to “Send It”?
- create filter in functions.php
- How to construct function for applying filter?
- Reuse variable in hook callback
- Move Custom Fields on General Settings Page to New Location
- Skeleton Child Theme Add Icon Bar to Header Flex Grid
- Redirect to another page using contact form 7? [closed]
- Can’t properly set the_title add_filter to show short_URL
- (Woocommerce) Order by price when entering specific category
- Custom HTML markup
- Auto-Tweet if Type is ‘Status’ using OAuth
- Use a shortcode to display custom meta box contents
- Call to undefined function is_home() or any conditional tags
- Create custom function for hero image
- How to add custom li item to wordpress menu
- Is it possible to use add_filter in an included file in the child theme’s functions.php?
- Problem in using Customizer
- Linking Javascript in functions.php file
- Changing the text of Upload/Insert on Posts and Pages Screen
- Conditional custom menu?
- Get URLs for AJAX Filter Checkboxes WordPress
- How to display an image before title text in menu items
- Filter works on last selection but no others
- How to replace ACTION url from original wordpress login form?
- How do I trigger WP CLI DB export using a PHP function?
- Prevent function from triggering on current page
- Assign IDs to headings in ACF using functions.php
- How would I correctly implement a new if statement in a child functions file?
- Redirect specific author posts to another url
- True email confirmation for registration (keeping unvalidated users from user table)
- $content is empty while using DOMDocument
- How To Show Shortcodes In WordPress Custom Fields?
- Best way to add image to recent posts widget?
- Fatal error: Call to undefined function add_action() – an untouched problem
- Get Value of Custom Field
- restrict access to specific urls on a specific period of time
- How do I add functionality to images?
- How to Add Extra Text In WordPress Title Before Post Publish
- Problem with removing characters “<” – WpAllImport
- function to show youtube videos within excerpt – if condition and apply_filters
- HELP: Code To Check Status And Write Debug Entry