You’re on the right track with creating the plugin. All your assumptions are correct.
To avoid errors on activation you’ll want to wrap the functions that you are redefining in function_exists
blocks, as on activation those functions will already be defined:
if ( ! function_exists( 'wp_hash_password' ) ) :
function wp_hash_password( $password ) {
return 'foo';
}
endif;
Put your code in wp-content/plugins/myfirstplugin/myplugin.php
make sure the plugin has the file headers so WordPress knows it is a plugin. There is also some helpful information for this on the Writing a plugin page under the heading Standard Plugin information
Then as you already assumed you activate your plugin on the plugins page in the WordPress admin.
Related Posts:
- function triggered by “manage_users_custom_column” filter not working
- Overwriting Core WordPress Functions with Plugins
- Problems with removing admin bar
- Override pluggable functions in a plugin?
- Do I have to override the wp_mail() pluggable function with writing a plugin?
- override pluggable.php functions
- Adding tables to dashboard pages programmatically?
- plugabble wp_authenticate function not works from wp-login.php
- What’s the difference between term_id and term_taxonomy_id
- How are bulk actions handled in custom list table classes?
- How do I programatically insert a new menu item?
- When would I use either function for plugins?
- Creating Settings Page with dropdowns for Plugin
- Test to see if jQuery or Prototype is queued by another plugin?
- Save Plugin Version Number as Option?
- Add a jQuery function to admin pages
- How to change post status in hook?
- Including file or library from other plugin
- Do uploaded plugins get updates if they came from the wordpress plugin directory?
- Why isn’t the Settings API designed to work for plugins using custom admin menus? [duplicate]
- Is there any reason only 1 (my) IP would be added to this table using $wpdn->insert?
- Plugin activation error due to unexpected output
- How to store data for posts/pages built with drag-n-drop builder?
- WP rest api v2 posts filter by ‘search’ & ‘category_name’ not working
- WordPress Admin Post Type Table Class Filter Hook
- Order of Operation for these three hooks
- How to disable “Transform to” option in Gutenberg custom blocks
- save_post hook not triggered in WP v3.6.1
- How to get the ID of the currently logged in user?
- Using a Shortcode to Replace Themes Stylesheet?
- Where should I put “run once” plugin pages?
- Initial help with official “create a block” tutorial
- Can wp_list_comments output into variable?
- Slow WP_query due to nested wp_query. Need Suggestions
- Plugin Development Output
- SMS registration and login [closed]
- How to modify product page for Jigoshop
- Adding Second Plugin Author
- Is @wordpress/env locked to node v14 or can I also use node v16?
- Securing/Escaping Output of file content – reading via fread() in PHP
- Run code once when block is created
- Intermittent database errors when accessing WordPress database
- How to create a “View” page for entry in add_menu_page wordpress admin area (CRUD operation)
- what is the standard ulr for wordpress plugin development?
- Customize WooCommerce my account dashboard through plugin
- Precaching WordPress posts with a ServiceWorker
- Shortcode returning localized HTML part
- Create a custom capability to allow an ‘Editor’ to edit only ‘Subscriber’ users
- global $current_user not current user
- What is the proper way to get logged in user id in a plugin?
- Custom WordPress Plugin will install new and not update
- get_option() will not work without access to wp-config.php
- register_activation_hook on multisite
- Use ‘get’ form action within a WordPress plugin admin page
- Template directory in plugin
- WordPress Admin Login Custom Logo
- How can I add a simple custom field to my plugin?
- Ajax is not working in a loop
- Woocommerce order empty items array
- Bind a function with its own argument to show something dynamically after every content
- Plugin development – loading Javascript and Flash
- Drawing the line between theme & plugin on large scale bespoke projects
- HowTo to add my rewrite rules at the beginning, redirect to the right page and flush the rules on plugin activation?
- Apply styles to blockquote element with the WYSIWYG editor
- Update variable value via add_filter
- Do I need to create an endpoint?
- Run uninstall.php if a checkbox is checked from settings page
- How to check whether checkbox is checked in WordPress customizer
- How to find list of all functions bind to a particular hook from my plugin?
- Multiple page plugin settings
- how to get the top 10 popular blogs
- How to output CSS to the beginning of the stylesheet in a WordPress Plugin
- Set page to draft on plugin deactivation
- Can one plugin activate another plugin via script?
- Insert and read media from the WordPress library and call in the plugin
- How to create dynamic content with get_post_meta?
- Get value of custom checkbox from Gutenberg sidebar in plugin
- Enable a role named ‘backend_user’ to access my plugin pages
- Hiding class namespace from plugin’s extensions
- How to trigger WooCommerce user profile edit change?
- Return raw image proxy for wordpress plugin
- Relational / Associate tables using native WordPress functionality
- Stop unauthorised file access
- Changed media upload path for plugin, but generates error & shows wrong url
- How to pass a more variable with page/subpage in Wordprees URL?
- Use a page as a template for a custom post type
- Dynamic sidebar areas not working on the Theme Customizer
- Woo-commerce: Adding additional page sections using a child theme
- Plugin dev: How to multiply instances of a plugin in the same metabox?
- Merge Codes using redux framework
- How to get html tag ids from template?
- Getting Plugin to read all script files
- How to Prove Ownership of plugin [closed]
- WordPress, GIT, Renamed Plugin Dir + files – Working Code now Broken [closed]
- get_term_by() returning null on plugin
- Is there a canonical way for a plugin to install a mu-plugin or drop-in?
- How can create a custom plugin to call my webapi after any registration or membership plugin functionality
- Calling get_header() with installed FSE theme
- Reinitiate Gutenburg’s blocks using javascript
- Generating Multiple Divi Pages from Database