carousel
1 year ago
cloudflare-analytics
2 years ago
comment-likes
5 years ago
comments
1 year ago
custom-post-types
1 year ago
external-media
1 year ago
geo-location
1 year ago
google-fonts
1 year ago
gravatar
6 years ago
infinite-scroll
1 year ago
likes
1 year ago
markdown
1 year ago
memberships
1 year ago
photon-cdn
1 year ago
plugin-search
1 year ago
post-by-email
1 year ago
related-posts
1 year ago
scan
1 year ago
seo-tools
1 year ago
sharedaddy
1 year ago
shortcodes
1 year ago
simple-payments
1 year ago
site-icon
2 years ago
sitemaps
1 year ago
stats
2 years ago
subscriptions
1 year ago
theme-tools
1 year ago
tiled-gallery
1 year ago
verification-tools
4 years ago
videopress
1 year ago
widget-visibility
1 year ago
widgets
1 year ago
woocommerce-analytics
1 year ago
wordads
1 year ago
wpcom-tos
5 years ago
blaze.php
2 years ago
blocks.php
1 year ago
carousel.php
2 years ago
comment-likes.php
2 years ago
comments.php
2 years ago
contact-form.php
1 year ago
copy-post.php
1 year ago
custom-content-types.php
1 year ago
geo-location.php
1 year ago
google-fonts.php
2 years ago
gravatar-hovercards.php
2 years ago
infinite-scroll.php
3 years ago
json-api.php
5 years ago
latex.php
4 years ago
likes.php
1 year ago
markdown.php
4 years ago
masterbar.php
1 year ago
module-extras.php
1 year ago
module-headings.php
1 year ago
module-info.php
1 year ago
monitor.php
2 years ago
notes.php
1 year ago
photon-cdn.php
1 year ago
photon.php
3 years ago
plugin-search.php
1 year ago
post-by-email.php
5 years ago
post-list.php
4 years ago
protect.php
2 years ago
publicize.php
1 year ago
related-posts.php
2 years ago
search.php
4 years ago
seo-tools.php
2 years ago
sharedaddy.php
2 years ago
shortcodes.php
1 year ago
shortlinks.php
1 year ago
sitemaps.php
1 year ago
sso.php
1 year ago
stats.php
1 year ago
subscriptions.php
1 year ago
theme-tools.php
1 year ago
tiled-gallery.php
4 years ago
vaultpress.php
2 years ago
verification-tools.php
5 years ago
videopress.php
4 years ago
waf.php
3 years ago
widget-visibility.php
4 years ago
widgets.php
1 year ago
woocommerce-analytics.php
2 years ago
wordads.php
2 years ago
wpgroho.js
1 year ago
custom-content-types.php
123 lines
| 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 |