Simple plugin for safely adding code for extending Pods. Instructions: 1) Create a folder in your plugins file. 2) Add this file and a second file, called 'custom-code.php' to it. 3) Add custom code to custom-code.php. 4) Activate plugin. For a complete Pods plugin starter plugin, see: https://github.com/pods-framework/pods-extend
<?php | |
/* | |
Plugin Name: Pods Starter Plugin | |
Version: 0.0.1 | |
License: GPL v2 or later | |
*/ | |
//note: change 'slug' to your own custom prefix. | |
add_action( 'plugins_loaded', 'slug_extend_safe_activate'); | |
function slug_extend_safe_activate() { | |
if ( defined( 'PODS_VERSION' ) ) { | |
include_once( 'custom-code.php'); | |
} | |
} |
This comment has been minimized.
This comment has been minimized.
Yes - a basic bit of documentation (e.g. how to call the plugin and how to use it with pods) would be very helpful. |
This comment has been minimized.
This comment has been minimized.
To add code that will work with Pods, instead of trying to find a .php file to place the code in the Pods folder; Create a new folder in your plugins directory. Call it Simple-pods-plugin, inside that folder place 2 php files: Simple-pods-plugin.php and custom-code.php. Simple-pods-plugin.php when active will call custom-code.php and make use of any code inserted in there. Go in WP>Plugins and activate "Pods Starter Plugin" to get the code active. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
Excuse me. Could you better explain the instructions. I do not understand what exactly I must do with the Gist I just downloaded. Thank you so much.