【发布时间】:2018-09-05 04:18:12
【问题描述】:
我正在使用带有附加 WP Jobs Application Deadline 的 WP Jobs 插件,并且有一个功能需要更改:
public function display_the_deadline() {
global $post;
$deadline = get_post_meta( $post->ID, '_application_deadline', true );
$expiring = false;
$expired = false;
$date_str = null;
if ( $deadline ) {
$expiring_days = apply_filters( 'job_manager_application_deadline_expiring_days', 2 );
$expiring = ( floor( ( current_time( 'timestamp' ) - strtotime( $deadline ) ) / ( 60 * 60 * 24 ) ) >= -$expiring_days );
$expired = ( floor( ( current_time( 'timestamp' ) - strtotime( $deadline ) ) / ( 60 * 60 * 24 ) ) >= 0 );
$date_str = date_i18n( $this->get_date_format(), strtotime( $deadline ) );
}
// Do not display anything if listing is already expired.
if ( is_singular( 'job_listing' ) && $expired ) {
return;
}
$timestamp = strtotime( $deadline );
/**
* Filters the display string for the application closing date.
*
* @since 1.2.1
*
* @param string $date_str The default date string to be displayed.
* @param string $timestamp The timestamp of the closing date.
*/
$date_str = apply_filters( 'job_manager_application_deadline_closing_date_display', $date_str, $timestamp );
if ( $date_str ) {
echo '<li class="application-deadline ' . ( $expiring ? 'expiring' : '' ) . ' ' . ( $expired ? 'expired' : '' ) . '"><label>' . ( $expired ? __( 'Closed', 'wp-job-manager-application-deadline' ) : __( 'Closes', 'wp-job-manager-application-deadline' ) ) . ':</label> ' . $date_str . '</li>';
}
}
在回显“li class="application-deadline...”的部分中,我需要将 Closes: 更改为 Deadline: 并且想知道是否可以在我的 functions.php 文件中覆盖此函数。我试过了使用 Jquery 替换它,但这不起作用。
【问题讨论】:
标签: wordpress function plugins