The recommended way to write that function would be:
function ce3_cleanup() {
global $wpdb;
$wpdb->query( "update $wpdb->postmeta set meta_key=replace(meta_key,'cb2_customHeader','_cb2_customHeader') where meta_key like 'cb2_customHeader'" );
$wpdb->query( "update $wpdb->postmeta set meta_key=replace(meta_key,'cb2_customTitle','_cb2_customTitle') where meta_key like 'cb2_customTitle'" );
}
register_activation_hook( __FILE__, 'ce3_cleanup' );
Related Posts:
- Update Option Stored in Multi-Dimensional Array
- check if Gutenberg is currently in use
- WordPress Plugin Development – Headers Already Sent Message
- Get page content using slug
- How to include wp-load.php from any location?
- Correct way to enqueue jquery-ui
- How to echo the_excerpt without the P tag wrapper?
- How can I update a wordpress plugin from a Git repository (github)
- $wpdb->insert_id
- Remove profile picture option (and other things) from profile.php (in admin)
- How to disable plugin update notification for a specific plugin in Multisite
- Getting old term value with edited_{$taxonomy} | Hook
- Call activation hook multiple times
- Adding custom code into header.php using a plugin
- Building a better media uploader for WordPress
- Problems with localization
- Two-step login process – Is it possible?
- Calling clean_term_cache() fails when called in the same plugin that creates terms, succeeds when called separately?
- Singular name Plugin localization
- Modifying WordPress plugins
- On plugin deactivation hide its shortcode
- Can I submit a plugin that follows the PSR-2 coding style guide?
- How to get current page id through the plugin
- Properly licensing a plugin that uses Apache 2.0 licensed code
- How to restrict plugin’s sub-menu pages to admin/subscribers?
- Saving data from block editor to the database
- Cannot search post by taxonomy
- OOP Plugin and Menu – Call to undefined function register_setting()
- Will current_theme_supports return TRUE with a nonstandard add_theme_support?
- How to untrash a post only if it was not a draft?
- Display content from custom post without modifying the single template
- How do I add custom column to woocommerce cart?
- TinyMCE 4.7.11 custom styles using styleselect – what does the ‘attributes’ argument do?
- Modifying meta tags after doing ajax call in plugin
- Modifying the default WordPress .htaccess with a plugin
- How to schedule a cron job in plugin without waiting for page load request?
- Create a free scripts and styles template within a plugin
- Is there a way to list all actions registered by a plugin or theme?
- WordPress Plugin with a shortcode that dynamically generates javascript. Can I use add_action without wrapping the javascript in a function?
- Call wp_generate_password() from within a Class
- Elementor custom Query with ACF fields to show matching woocommerce products custom fields
- How to enqueue style in WordPress plugin from theme files?
- Set different custom menu items for different user roles
- Getting List of all registered Dashboard Widgets
- Why does wp_remote_post returns an empty body response on certain endpoints?
- Bootstrap version conflict 3 with 4 for wordpress theme and plugin [closed]
- Where to write custom logs in WordPress
- How developed with version control word press site on shared host? [closed]
- pre_get_post alter current post id
- 3rd Party Plugin dependency – how to correctly load classes
- Problems with cron
- add_settings_field Data not passing to Options Page Like it should
- How do I add a favicon that only shows during viewing of my plugin’s admin panel?
- Can’t get CSS Into the Head via add_action
- Remove Default Blogroll Links via Plugin script
- Empty Pdf file generated with FPDF library in WordPress plugin [closed]
- Catching Form Submission in WordPress Admin Panel
- Filter posts in pre_get_posts order by meta value date (desc or asc)
- How to display the category id along with category name on categories list?
- Save temporary registration data
- Activate / Deactivate plugin
- My plugin won’t create table in wordpress 3.5
- Remove Permalink Meta Box not working?
- Serial Number from custom table not appear in woocommerce_email_before_order_table action
- Modify custom block plugin without losing content
- How to replace the existing metatag using the backend to insure a thumbnail image gets fetched when we share on social media?
- When setting styles to an extended block that was saved as a pattern, it doesn’t remove the style that was there
- apply_filters() and call_user_func() to define and call a function outside a class
- HTML Elements in my WP Plugin being generated in JS. Security and Translated Text Question about this method being used
- Sanitization and validation input fields – Settings API
- Always hide a page from the menu
- Author Meta in Author URL Link
- Warning: Illegal string offset ‘Andorra’ in … on line 106
- Different style for specific rows in custom list table using WP_List_Table
- wordpress4.8.2 Multilingual Plugin
- get_comment_meta() for a filter hook in a plugin
- form does not generate $_POST request
- Callback function quicktags that uses variable in start tag
- Font Awesome stopped showing icons, shows &# text instead [closed]
- WordPress Plugin Tool Tip Helpers
- How can I add the Post ID to Class Name in Jquery?
- How to show metabox just in post.php in admin?
- Stop theme displaying comments
- $wpdb how can i save my postmeta table before querying it
- Create dedicated page with custom template showing custom data
- Can’t switch theme after activation
- Plugin capabilities
- plugin will not offer update even though a new version is available
- WordPress plugin: admin-ajax.php not passing data to custom function
- How do I replace title with my plugin?
- How to filter manage categories listing
- Enqueue Script in custom plugin before other
- How to remove a class [closed]
- How can I dynamically change title and description in WordPress?
- WooCommerce adds a newline symbol (\n) between email recipients
- Upload to a specific media folder created by FileBird Lite
- Why isn’t custom sidebar panel not showing up in the Gutenberg Editor?
- Ninja Forms: Front-End Forms, Post ID?
- Allow HTML in product attributes and variation for WooCommerce
- How do I modify the error code array used by “shake_error_codes” filter?