wp プラグインから .js ファイルを読み込もうとしています。
jquery、jquery-UI、および .js ファイルをロードするコードは次のようになり、「メイン」プラグイン ファイル内に配置されます。
//Load Java and Jquery
function load_jquery() {
    // only use this method is we're not in wp-admin
    if (!is_admin()) {
        // deregister the original version of jQuery
        wp_deregister_script('jquery');
        wp_deregister_script('jquery-ui');
        wp_deregister_script('lyox-script');
        // discover the correct protocol to use
        $protocol='http:';
        if($_SERVER['HTTPS']=='on') {
            $protocol='https:';
        }
        // register the Google CDN version
        wp_register_script('jquery', $protocol.'//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js', false, '1.10.2');
        wp_register_script('jquery-ui', $protocol.'//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js', false, '1.10.3');
        wp_register_script('lyox-script', plugins_url( '/includes/script.js' , __FILE__ ), array( 'jquery', 'jquery-ui' ) );
        // add it back into the queue
        wp_enqueue_script('jquery');
        wp_enqueue_script('jquery-ui');
        wp_enqueue_script('lyox-script');
    }
}
add_action('template_redirect', 'load_jquery');
次に、.js ファイル内に次のコードがあり、post() 関数がフォーム ボタン onclick="post();" に追加されます。
$(document).ready(function() {
        function post() {
        var name = $('#name').val();
             $.post('process.php', {postname:name},
                    function(data)
                        {
                        alert(data);
                        $('#result').html(data);                        
             });
    }
});
ページで試してみても、まだ何も起こりません。何か案は?