Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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');
}
}
@palvestegui

This comment has been minimized.

Copy link

@palvestegui palvestegui commented May 12, 2015

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.

@tiptronic

This comment has been minimized.

Copy link

@tiptronic tiptronic commented Jun 15, 2015

Yes - a basic bit of documentation (e.g. how to call the plugin and how to use it with pods) would be very helpful.

@Udog8

This comment has been minimized.

Copy link

@Udog8 Udog8 commented Jan 22, 2016

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