• How can a function on a plugin “see” the author id when it is called from author.php template?

    I know we can use the $author var when working directly on author.php, but that seems be neither visible nor global for a plugin.

    Sorry if it is an stupid question, but after looked for it every where still can’t get it to work. =/

Viewing 1 replies (of 1 total)
  • Thread Starter carlla

    (@carlla)

    just send the $author var to a function from author.php .

    // themes/mytheme/author.php
    my_plugin_function($author);
    
    // plugins/my_plugin.php
    function my_plugin_function( $author_id = 0 ){
      // we are on author template
      // do stuffs using the author_id
    }

    Can’t find another way to get the author id on plugin function =/

Viewing 1 replies (of 1 total)
  • The topic ‘$author id outside the loop?’ is closed to new replies.