Pass info from functions.php to plugin

Plugins are loaded before the theme which means that your apply_filters won’t have any actual callbacks registered to it. Instead, you need to call your apply_filters sometime after the theme has been loaded. Something like this:

/* Your plugin's file: */

add_action( 'init', 'my_lovely_funky_filters' );

function my_lovely_funky_filters() {
    /* Fire our callbacks */
    $value = 0;
    $value = apply_filters( 'get_value_from_function', $value );

    /* Check your $value now */
    /* echo "<pre>{$value}</pre>"; */
}

/* Your functions.php file */

add_filter( 'get_value_from_function', 'my_special_value_treatment', 10, 1 );
function my_special_value_treatment( $value ) {
    /* A little more interesting */
    return (int)$value + 1;
}

error code: 523