• Hi I am trying to pass a string out of a wordpress filter + function i.e.

    ‘<?php
    function check_content($content)
    {
    global $A;

    if (isset($_POST[‘key1’])
    {
    $option = “1”;
    DO THE CONTENT………..1
    }
    elseif (isset($_POST[‘key2’])
    {
    $option = “2”;
    DO THE CONTENT………..2
    }
    Etc. Etc.

    $A[SELOPT] = $option;
    return $content;
    }
    add_filter(‘the_content’,’check_content’);

    ?>’

    I have used a global variable as an array and/or string I would like to pass it by reference but I cannot do that either, does anyone know a simple way around this? None of the above works 100%, I have looked around the posts and similar situations do not cure this problem.
    All I want to do is pass one variable “other than content” out of this function, I must be missing something?

    Thanks in advance for any replies.

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

    (@paulgee)

    Hi I am assuming from the non-response that no one knows a way around this? I was trying to keep the whole thing in one place or in one function and as simple as possible but it looks like I will need to make several functions and calls to get around this, thanks for looking anyway ;~}

    Paulgee

Viewing 1 replies (of 1 total)
  • The topic ‘Passing By REF in the_content’ is closed to new replies.