PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 16.3-a.5
Jetpack – WP Security, Backup, Speed, & Growth v16.3-a.5
16.3-a.5 16.3-a.7 16.3-a.3 16.3-a.1 16.2 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 All 506 releases
← All changes | modules/custom-content-types.php +79 -21 13.8.3 → 16.3-a.5 View file →
@@ -1,7 +1,7 @@
1 1 <?php
2 2 /**
3 - * Module Name: Custom content types
3 + * Module Name: Custom Content Types
4 4 * Module Description: Display different types of content on your site with custom content types.
5 5 * First Introduced: 3.1
6 6 * Requires Connection: No
7 7 * Auto Activate: No
@@ -14,47 +14,105 @@
14 14 */
15 15
16 16 use Automattic\Jetpack\Redirect;
17 17
18 +if ( ! defined( 'ABSPATH' ) ) {
19 + exit( 0 );
20 +}
21 +
18 22 if ( ! function_exists( 'jetpack_load_custom_post_types' ) ) {
19 - /**
20 - * Load Portfolio CPT.
21 - */
22 - function jetpack_load_custom_post_types() {
23 + if ( class_exists( 'Automattic\Jetpack\Classic_Theme_Helper\Jetpack_Portfolio' ) ) {
24 + // Temporarily require the file here to prevent possible deprecation notices for a short period of time.
25 + // @todo: Can remove this if check after the subsequent release.
23 26 include __DIR__ . '/custom-post-types/portfolios.php';
27 + } else {
28 + /**
29 + * Load Portfolio CPT.
30 + *
31 + * @deprecated 13.9 Moved to Classic Theme Helper package.
32 + */
33 + function jetpack_load_custom_post_types() {
34 + _deprecated_function( __FUNCTION__, 'jetpack-13.9' );
35 + include __DIR__ . '/custom-post-types/portfolios.php';
36 + }
24 37 }
25 38 }
26 39
27 40 if ( ! function_exists( 'jetpack_custom_post_types_loaded' ) ) {
28 - /**
29 - * Make module configurable.
30 - */
31 - function jetpack_custom_post_types_loaded() {
32 - Jetpack::enable_module_configurable( __FILE__ );
41 +
42 + if ( class_exists( 'Automattic\Jetpack\Classic_Theme_Helper\Jetpack_Portfolio' ) ) {
43 + // Temporarily require the file here to prevent possible deprecation notices for a short period of time.
44 + // @todo: Can remove this if check after the subsequent release.
45 + add_action(
46 + 'jetpack_modules_loaded',
47 + function () {
48 + Jetpack::enable_module_configurable( __FILE__ );
49 + }
50 + );
51 + } else {
52 + /**
53 + * Make module configurable.
54 + *
55 + * @deprecated 13.9 Moved to Classic Theme Helper package.
56 + */
57 + function jetpack_custom_post_types_loaded() {
58 + _deprecated_function( __FUNCTION__, 'jetpack-13.9' );
59 + Jetpack::enable_module_configurable( __FILE__ );
60 + }
61 + add_action( 'jetpack_modules_loaded', 'jetpack_custom_post_types_loaded' );
33 62 }
34 - add_action( 'jetpack_modules_loaded', 'jetpack_custom_post_types_loaded' );
35 63 }
36 64
37 65 if ( ! function_exists( 'jetpack_cpt_settings_api_init' ) ) {
38 - /**
39 - * Add Settings Section for CPT
40 - */
41 - function jetpack_cpt_settings_api_init() {
42 - add_settings_section(
43 - 'jetpack_cpt_section',
44 - '<span id="cpt-options">' . __( 'Your Custom Content Types', 'jetpack' ) . '</span>',
45 - 'jetpack_cpt_section_callback',
46 - 'writing'
66 +
67 + if ( class_exists( 'Automattic\Jetpack\Classic_Theme_Helper\Jetpack_Portfolio' ) ) {
68 + // Temporarily require the file here to prevent possible deprecation notices for a short period of time.
69 + // @todo: Can remove this if check after the subsequent release.
70 + add_action(
71 + 'admin_init',
72 + function () {
73 + add_settings_section(
74 + 'jetpack_cpt_section',
75 + '<span id="cpt-options">' . __( 'Your Custom Content Types', 'jetpack' ) . '</span>',
76 + function () {
77 + ?>
78 + <p>
79 + <?php esc_html_e( 'Use these settings to display different types of content on your site.', 'jetpack' ); ?>
80 + <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>
81 + </p>
82 + <?php
83 + },
84 + 'writing'
85 + );
86 + }
47 87 );
88 + } else {
89 + /**
90 + * Add Settings Section for CPT
91 + *
92 + * @deprecated 13.9 Moved to Classic Theme Helper package.
93 + */
94 + function jetpack_cpt_settings_api_init() {
95 + _deprecated_function( __FUNCTION__, 'jetpack-13.9' );
96 + add_settings_section(
97 + 'jetpack_cpt_section',
98 + '<span id="cpt-options">' . __( 'Your Custom Content Types', 'jetpack' ) . '</span>',
99 + 'jetpack_cpt_section_callback',
100 + 'writing'
101 + );
102 + }
103 + add_action( 'admin_init', 'jetpack_cpt_settings_api_init' );
48 104 }
49 - add_action( 'admin_init', 'jetpack_cpt_settings_api_init' );
50 105 }
51 106
52 107 if ( ! function_exists( 'jetpack_cpt_section_callback' ) ) {
53 108 /**
54 109 * Settings Description
110 + *
111 + * @deprecated 13.9 Moved to Classic Theme Helper package.
55 112 */
56 113 function jetpack_cpt_section_callback() {
114 + _deprecated_function( __FUNCTION__, 'jetpack-13.9' );
57 115 ?>
58 116 <p>
59 117 <?php esc_html_e( 'Use these settings to display different types of content on your site.', 'jetpack' ); ?>
60 118 <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>