Skip to content

Instantly share code, notes, and snippets.

@waqashassan98
Forked from Shelob9/simple-pods-plugin.php
Created November 24, 2020 14:47
Show Gist options
  • Save waqashassan98/a05f74910755929510096577e1caadf3 to your computer and use it in GitHub Desktop.
Save waqashassan98/a05f74910755929510096577e1caadf3 to your computer and use it in GitHub Desktop.
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');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment