mstoic
4/5/2016 - 2:16 PM

Deleted Code

Deleted Code



			array(
				'id'       => 'relative_time',
				'type'     => 'switch',
				'default'  => 0,
				'on'       => esc_html__('Yes', 'mstoic'),
				'off'      => esc_html__('No', 'mstoic'),
				'title'    => esc_html__( 'Enable Relative Timing', 'mstoic' ),
				'subtitle' => esc_html__( 'If this option is enabled, the theme will show relative timings.', 'mstoic' ),
				'desc'     => esc_html__( 'Show Time as: ', 'mstoic' ) .
				              '<strong>' . esc_html__('2 Hours Ago', 'mstoic' ) . '</strong>' .
				              esc_html__(', ', 'mstoic' ) .
				              '<strong>' . esc_html__('5 Days Ago', 'mstoic' ) . '</strong>',
			),
			
			
			
			

/**
 * Returns the relative time, if enabled by the administrator
 *
 * @param $time     The time in UNIX time format.
 *
 * @return string   Human readable relative time.
 */
function mstoic_relative_time( $time ) {

	global $mstoic_options;

	if ( isset( $mstoic_options['relative_time'] ) && $mstoic_options['relative_time'] ) {

		$time_stamp = strtotime($time);

		return sprintf( _x( '%s ago', '%s = human-readable time difference', 'mstoic' ), human_time_diff( $time_stamp, current_time( 'timestamp' ) ) );

	} else {

		return $time;

	}

}



$time_string = sprintf($time_string,
				esc_attr(get_the_date('c')),
				mstoic_relative_time(esc_html(get_the_date())),
				esc_attr(get_the_modified_date('c')),
				mstoic_relative_time(esc_html(get_the_modified_date()))
			);

    /**
     * This function adds padding to the featured images if 'standard-layout' is enabled.
     * @todo: Remove this function, and all it's callers - Do this when submitting - can be useful in future - 18/03/2016
     */
    function addPaddingToExcerpt() {
        if ($('div.standard-layout').length === 1) {
            if ($(window).outerWidth() > 500) {
                $('article.post').each(function () {
                    var featuredImageWidth = parseInt($(this).find('.featured-image').outerWidth(), 10),
                        featuredImageMargin = parseInt($(this).find('.featured-image').css('margin-right'), 10);
                    $(this).find('.entry-excerpt').css({'padding-left': featuredImageWidth + featuredImageMargin + 'px'});
        
                });
            }
        }
    }
/**
 * Returns the relative time, if enabled by the administrator
 *
 * @param $time     The time in UNIX time format.
 *
 * @return string   Human readable relative time.
 */
function mstoic_relative_time( $time ) {

	global $mstoic_options;

	if ( isset( $mstoic_options['relative_time'] ) && $mstoic_options['relative_time'] ) {
		return sprintf( _x( '%s ago', '%s = human-readable time difference', 'mstoic' ), human_time_diff( $time, current_time( 'timestamp' ) ) );
	} else {
		return date_i18n(get_option( 'date_format' ), $time );
	}

}


//Options Page Code

	array(
		'id'       => 'relative_time',
		'type'     => 'switch',
		'default'  => 0,
		'on'       => __('Yes', 'redux-framework-demo'),
		'off'      => __('No', 'redux-framework-demo'),
		'title'    => __( 'Enable Relative Timing', 'redux-framework-demo' ),
		'subtitle' => __( 'If this option is enabled, the theme will show relative timings.', 'redux-framework-demo' ),
		'desc'     => __( 'Show Time as: \'<strong>2 Hours Ago</strong>\', \'<strong>5 Days Ago</strong>\'', 'redux-framework-demo' ),
	),
	

-------------------

/**
 * Get redux options in WP dashboard
 * Commenting this, causing bbp initialization error,
 * Find out what stopped after this - register nav menus accordingg to header - init hook
 */
// Redux::init('mstoic_options');