LChambers (@lchambers)

Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • In reply to: Date format in spanish

    @lchambers

    Participant

    Up!

    In reply to: Date format in spanish

    @lchambers

    Participant

    Please try this code instead:

    add_filter ( ‘bbp_get_reply_post_date’, ‘act_fecha’, 10, 6);
    add_filter ( ‘bbp_get_topic_post_date’, ‘act_fecha’, 10, 6);

    function act_fecha( $result, $reply_id, $humanize, $gmt, $date, $time ) {
    $date = get_post_time( get_option( ‘date_format’ ), $gmt, $reply_id, $translate = true );
    $result = sprintf( _x( ‘%1$s at %2$s’, ‘date at time’, ‘bbpress’ ), $date, $time );
    $return $result;
    }

    The above code would now work.

    Via ayudawordpres.com/foros

    In reply to: Date format in spanish

    @lchambers

    Participant

    Ay, bbPress make me feel so happy… šŸ˜‰

    add_filter ( ‘get_post_time’, ‘new_date’, 10, 3);

    function new_date ($time, $d = ā€˜Uā€™, $gmt = false) {
    $translate = true;
    $time = mysql2date($d, $time, $translate);
    remove_filter (‘get_post_time’, ‘new_date’, 10, 3);
    return $time;
    }

    Un saludo

    In reply to: Date format in spanish

    @lchambers

    Participant

    OK, file functions.php in your theme’s folder.

    By the way, WordPress 3.5.1 and bbPress 2.2.4

    De nada… šŸ˜‰

    In reply to: Date format in spanish

    @lchambers

    Participant

    The function get_post_time is disable for translation. You can use a filter, example

    add_filter ( ‘get_post_time’, ‘new_date’, 10, 3);

    function new_date ($time, $d = ‘U’, $gmt = false) {
    $translate = true;
    $time = mysql2date($d, $time, $translate);
    return $time;
    }

    Un saludo šŸ˜‰

Viewing 5 replies - 1 through 5 (of 5 total)