Forums

[resolved] How to access plugin function from header.php (2 posts)

  1. Alexandre Vallières-Lagacé
    Member
    Posted 3 years ago #

    Hi,

    I'm writing my first plugin and I would like to know how to code a function so it's available from anywhere on my blog.

    For example, if I have a function like so :

    function get_hullo() <{
    return "hullo";
    }

    And I want its value to be written to the header of a document like this :

    <meta name="hullo" content="<?php if (function_exists('get_hullo')) get_hullo(); ?>" />

    Do I have to do something more, like delaring the function globally (if that makes sense)?

    thanks!

  2. Alexandre Vallières-Lagacé
    Member
    Posted 3 years ago #

    D'oh! Forgot to add the "echo" to print out the returned value...

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.