Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Allow a theme to call a plugin's functions
#3
n00dles101 Wrote:once the plugin is activated and the common_functions.php file has been included as part of the plugin, all the functions are available to your theme.

I believe that is the case but it is not working. Do I need to do anything other than just putting the common_functions.php in the folder? Link it in NAME.php?

-NAME.php
-NAME/common_functions.php

UPDATE: Actually the problem may lie in the layout of common_functions.php, this is the skeleton of what I have:

Code:
<?php
/*
Plugin Name:
Description:
Version:
Author:
Author URI:
*/

/**
* FunctionName
*/

function function_name() { return true; }

/**
* Another Function
*
*
* @return int
*/
function another_function($value) {

return $value * 1000;
}
?>
Reply


Messages In This Thread
Allow a theme to call a plugin's functions - by michaellindahl - 2012-10-01, 23:49:09



Users browsing this thread: 1 Guest(s)