【发布时间】:2018-04-23 03:13:17
【问题描述】:
如果管理员帐户已登录,我如何设置条件以绕过提交作业步骤?有没有可能做到这一点?
public static function submit_job_steps( $steps ) {
if ( self::get_packages() && apply_filters( 'wcpl_enable_paid_job_listing_submission', true ) ) {
// We need to hijack the preview submission to redirect to WooCommerce and add a step to select a package.
// Add a step to allow the user to choose a package. Comes after preview.
$steps['wc-choose-package'] = array(
'name' => __( 'Choose a package', 'wp-job-manager-wc-paid-listings' ),
'view' => array( __CLASS__, 'choose_package' ),
'handler' => array( __CLASS__, 'choose_package_handler' ),
'priority' => 25,
);
// If we instead want to show the package selection FIRST, change the priority and add a new handler.
if ( 'before' === get_option( 'job_manager_paid_listings_flow' ) ) {
$steps['wc-choose-package']['priority'] = 5;
$steps['wc-process-package'] = array(
'name' => '',
'view' => false,
'handler' => array( __CLASS__, 'choose_package_handler' ),
'priority' => 25,
);
// If showing the package step after preview, the preview button text should be changed to show this.
} elseif ( 'before' !== get_option( 'job_manager_paid_listings_flow' ) ) {
add_filter( 'submit_job_step_preview_submit_text', array( __CLASS__, 'submit_button_text' ), 10 );
}
// We should make sure new jobs are pending payment and not published or pending.
add_filter( 'submit_job_post_status', array( __CLASS__, 'submit_job_post_status' ), 10, 2 );
}
return $steps;
}
【问题讨论】:
标签: php wordpress woocommerce conditional administrator