Referring to the discussion posted here (http://www.s2member.com/forums/topic/custom-profile-edit-form/), it pointed me in the right direction but I can’t quite get the results I need.
My goal:
Customize the table output on the “Edit Profile” page.
What I’ve done so far:
Created a “mu-plugins” folder and added a “s2-hacks.php” file. Using the steps provided in the 2nd post of the above discussion, I was able to make some edits to the output.
The problem:
My edits don’t appear after the “ob_start();” function which has a comment saying “// Start buffering. Allows Hooks to echo output like: `/?s2member_profile=1`.”
Here’s a snippet of the code in my “s2-hacks.php” file. If you look at my “test” echoes, #5 doesn’t appear on my page, only 1-4.
add_action('ws_plugin__s2member_before_sc_profile','my_profile_form');
function my_profile_form(){
c_ws_plugin__s2member_no_cache::no_cache_constants (true); // No caching.
$tabindex = apply_filters ("ws_plugin__s2member_sc_profile_tabindex", 0, get_defined_vars ());
echo 'test 01';
if (($user = (is_user_logged_in ()) ? wp_get_current_user () : false) && ($user_id = $user->ID))
{
echo 'test 02';
$attr = c_ws_plugin__s2member_utils_strings::trim_qts_deep ((array)$attr);
$attr = shortcode_atts (array (), $attr); // Possible Attributes. None.
echo 'test 03';
foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;
do_action ("ws_plugin__s2member_before_sc_profile_after_shortcode_atts", get_defined_vars ());
unset /* Unset defined __refs, __v. */ ($__refs, $__v);
echo 'test 04';
ob_start (); // Start buffering. Allows Hooks to echo output like: `/?s2member_profile=1`.
echo 'test 05';
echo '<form method="post" name="ws_plugin__s2member_profile" id="ws-plugin--s2member-profile">' . "n";
if ($GLOBALS["ws_plugin__s2member_profile_saved"]) // Respond to successful updates.
{
echo '<div id="ws-plugin--s2member-profile-saved">' . "n";
echo _x ("Profile updated successfully.", "s2member-front", "s2member") . "n";
echo '</div>' . "n";
}
foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;
do_action ("ws_plugin__s2member_during_profile_before_table", get_defined_vars ());
unset /* Unset defined __refs, __v. */ ($__refs, $__v);
echo '<table cellpadding="0" cellspacing="0" style="width:50%;float:left">' . "n";
echo '<tbody>' . "n";
...