-
Notifications
You must be signed in to change notification settings - Fork 368
/
Copy pathwp-job-manager-deprecated.php
107 lines (93 loc) · 2.52 KB
/
wp-job-manager-deprecated.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<?php
/**
* Deprecated functions. Do not use these.
*
* @package wp-job-manager
*/
if ( ! function_exists( 'order_featured_job_listing' ) ) :
/**
* Was used for sorting.
*
* @deprecated 1.22.4
*
* @param array $args
* @return array
*/
function order_featured_job_listing( $args ) {
global $wpdb;
$args['orderby'] = "$wpdb->posts.menu_order ASC, $wpdb->posts.post_date DESC";
return $args;
}
endif;
if ( ! function_exists( 'the_job_type' ) ) :
/**
* Displays the job type for the listing.
*
* @since 1.0.0
* @deprecated 1.27.0 Use `wpjm_the_job_types()` instead.
*
* @param int|WP_Post $post
* @return string
*/
function the_job_type( $post = null ) {
_deprecated_function( __FUNCTION__, '1.27.0', 'wpjm_the_job_types' );
if ( ! get_option( 'job_manager_enable_types' ) ) {
return '';
}
$job_type = get_the_job_type( $post );
if ( $job_type ) {
echo esc_html( $job_type->name );
}
}
endif;
if ( ! function_exists( 'get_the_job_type' ) ) :
/**
* Gets the job type for the listing.
*
* @since 1.0.0
* @deprecated 1.27.0 Use `wpjm_get_the_job_types()` instead.
*
* @param int|WP_Post $post (default: null).
* @return string|bool|null
*/
function get_the_job_type( $post = null ) {
_deprecated_function( __FUNCTION__, '1.27.0', 'wpjm_get_the_job_types' );
$post = get_post( $post );
if ( \WP_Job_Manager_Post_Types::PT_LISTING !== $post->post_type ) {
return;
}
$types = wp_get_post_terms( $post->ID, \WP_Job_Manager_Post_Types::TAX_LISTING_TYPE );
if ( $types ) {
$type = current( $types );
} else {
$type = false;
}
return apply_filters( 'the_job_type', $type, $post );
}
endif;
if ( ! function_exists( 'wpjm_get_permalink_structure' ) ) :
/**
* Retrieves permalink settings. Moved to `WP_Job_Manager_Post_Types` class in 1.28.0.
*
* @since 1.27.0
* @deprecated 1.28.0
* @return array
*/
function wpjm_get_permalink_structure() {
return WP_Job_Manager_Post_Types::get_permalink_structure();
}
endif;
if ( ! function_exists( 'job_manager_add_post_types' ) ) :
/**
* Adds job listing post types to list of types to be removed with user. Moved to `WP_Job_Manager_Post_Types` class in 1.33.0.
*
* @deprecated 1.33.0
*
* @param array $types
* @return array
*/
function job_manager_add_post_types( $types ) {
_deprecated_function( __FUNCTION__, '1.33.0', 'WP_Job_Manager_Post_Types::delete_user_add_job_listings_post_type' );
return WP_Job_Manager_Post_Types::instance()->delete_user_add_job_listings_post_type( $types );
}
endif;