MainWP Code Snippets Extension
The MainWP Code Snippets Extension is a simple way to add code snippets to your child sites from a centralized location. There’s no need to edit your theme’s functions.php or wp-config file anymore!
Code snippet: A small piece of PHP code that can be inserted directly into your child sites. Sometimes they contain complete functions; other times, they modify an existing feature.
This tool is for advanced users only. We recommend it to experienced PHP developers.
Create and run your PHP code snippets on your sites
With the MainWP Code Snippets Extension, you can execute tasks like syncing a plugin’s settings, changing the content of any post, updating widgets, or getting post counts across your network, and you can do all of this from your Dashboard.
The MainWP Code Snippets Extension allows you to run code in three ways:
1. Have a code snippet run a function on the secondary site.
You would use this option to make actual changes to your child sites. For example, if you wanted to customize the admin footer on different websites in your network, you would use this option.
2. Have a code snippet return information from a secondary site.
This option queries the child and returns the information. An example would be if you want to know the count of published posts from all your sites.
3. Have a code snippet edit the wp-config.php file on a secondary site.
One of the most critical files in your WordPress installation is the wp-config.php file. A code snippet in this section allows you to do things like increase WordPress memory, block external requests, disable WP Cron, and much more.
Reviews
There are no reviews yet.