PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 14.8
Jetpack – WP Security, Backup, Speed, & Growth v14.8
16.2-beta 12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 13.7.2 13.8.3 13.9.2 14.0.1 14.1.1 14.2.2 14.3.1 All 501 releases
jetpack / modules / custom-content-types.php
custom-content-types.php
123 lines 4.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Module Name: Custom content types
4 * Module Description: Display different types of content on your site with custom content types.
5 * First Introduced: 3.1
6 * Requires Connection: No
7 * Auto Activate: No
8 * Module Tags: Writing
9 * Sort Order: 34
10 * Feature: Writing
11 * Additional Search Queries: cpt, custom post types, portfolio, portfolios, testimonial, testimonials
12 *
13 * @package automattic/jetpack
14 */
15
16 use Automattic\Jetpack\Redirect;
17
18 if ( ! function_exists( 'jetpack_load_custom_post_types' ) ) {
19 if ( class_exists( 'Automattic\Jetpack\Classic_Theme_Helper\Jetpack_Portfolio' ) ) {
20 // Temporarily require the file here to prevent possible deprecation notices for a short period of time.
21 // @todo: Can remove this if check after the subsequent release.
22 include __DIR__ . '/custom-post-types/portfolios.php';
23 } else {
24 /**
25 * Load Portfolio CPT.
26 *
27 * @deprecated 13.9 Moved to Classic Theme Helper package.
28 */
29 function jetpack_load_custom_post_types() {
30 _deprecated_function( __FUNCTION__, 'jetpack-13.9' );
31 include __DIR__ . '/custom-post-types/portfolios.php';
32 }
33 }
34 }
35
36 if ( ! function_exists( 'jetpack_custom_post_types_loaded' ) ) {
37
38 if ( class_exists( 'Automattic\Jetpack\Classic_Theme_Helper\Jetpack_Portfolio' ) ) {
39 // Temporarily require the file here to prevent possible deprecation notices for a short period of time.
40 // @todo: Can remove this if check after the subsequent release.
41 add_action(
42 'jetpack_modules_loaded',
43 function () {
44 Jetpack::enable_module_configurable( __FILE__ );
45 }
46 );
47 } else {
48 /**
49 * Make module configurable.
50 *
51 * @deprecated 13.9 Moved to Classic Theme Helper package.
52 */
53 function jetpack_custom_post_types_loaded() {
54 _deprecated_function( __FUNCTION__, 'jetpack-13.9' );
55 Jetpack::enable_module_configurable( __FILE__ );
56 }
57 add_action( 'jetpack_modules_loaded', 'jetpack_custom_post_types_loaded' );
58 }
59 }
60
61 if ( ! function_exists( 'jetpack_cpt_settings_api_init' ) ) {
62
63 if ( class_exists( 'Automattic\Jetpack\Classic_Theme_Helper\Jetpack_Portfolio' ) ) {
64 // Temporarily require the file here to prevent possible deprecation notices for a short period of time.
65 // @todo: Can remove this if check after the subsequent release.
66 add_action(
67 'admin_init',
68 function () {
69 add_settings_section(
70 'jetpack_cpt_section',
71 '<span id="cpt-options">' . __( 'Your Custom Content Types', 'jetpack' ) . '</span>',
72 function () {
73 ?>
74 <p>
75 <?php esc_html_e( 'Use these settings to display different types of content on your site.', 'jetpack' ); ?>
76 <a target="_blank" rel="noopener noreferrer" href="<?php echo esc_url( Redirect::get_url( 'jetpack-support-custom-content-types' ) ); ?>"><?php esc_html_e( 'Learn More', 'jetpack' ); ?></a>
77 </p>
78 <?php
79 },
80 'writing'
81 );
82 }
83 );
84 } else {
85 /**
86 * Add Settings Section for CPT
87 *
88 * @deprecated 13.9 Moved to Classic Theme Helper package.
89 */
90 function jetpack_cpt_settings_api_init() {
91 _deprecated_function( __FUNCTION__, 'jetpack-13.9' );
92 add_settings_section(
93 'jetpack_cpt_section',
94 '<span id="cpt-options">' . __( 'Your Custom Content Types', 'jetpack' ) . '</span>',
95 'jetpack_cpt_section_callback',
96 'writing'
97 );
98 }
99 add_action( 'admin_init', 'jetpack_cpt_settings_api_init' );
100 }
101 }
102
103 if ( ! function_exists( 'jetpack_cpt_section_callback' ) ) {
104 /**
105 * Settings Description
106 *
107 * @deprecated 13.9 Moved to Classic Theme Helper package.
108 */
109 function jetpack_cpt_section_callback() {
110 _deprecated_function( __FUNCTION__, 'jetpack-13.9' );
111 ?>
112 <p>
113 <?php esc_html_e( 'Use these settings to display different types of content on your site.', 'jetpack' ); ?>
114 <a target="_blank" rel="noopener noreferrer" href="<?php echo esc_url( Redirect::get_url( 'jetpack-support-custom-content-types' ) ); ?>"><?php esc_html_e( 'Learn More', 'jetpack' ); ?></a>
115 </p>
116 <?php
117 }
118 }
119
120 if ( function_exists( 'jetpack_load_custom_post_types' ) ) {
121 jetpack_load_custom_post_types();
122 }
123