forked from Automattic/WP-Job-Manager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwp-job-manager-deprecated.php
86 lines (75 loc) · 1.81 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
<?php
/**
* Deprecated functions. Do not use these.
*/
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 '';
}
if ( $job_type = get_the_job_type( $post ) ) {
echo $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 ( $post->post_type !== 'job_listing' ) {
return;
}
$types = wp_get_post_terms( $post->ID, 'job_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;