calypsoify
2 years ago
carousel
2 years ago
cloudflare-analytics
2 years ago
comment-likes
5 years ago
comments
2 years ago
custom-css
2 years ago
custom-post-types
2 years ago
geo-location
4 years ago
google-analytics
2 years ago
google-fonts
2 years ago
gravatar
6 years ago
infinite-scroll
2 years ago
likes
2 years ago
markdown
2 years ago
masterbar
2 years ago
memberships
2 years ago
photon-cdn
2 years ago
plugin-search
4 years ago
post-by-email
3 years ago
related-posts
2 years ago
scan
2 years ago
seo-tools
2 years ago
sharedaddy
2 years ago
shortcodes
2 years ago
simple-payments
3 years ago
site-icon
2 years ago
sitemaps
2 years ago
sso
2 years ago
stats
2 years ago
subscriptions
2 years ago
theme-tools
2 years ago
tiled-gallery
2 years ago
verification-tools
4 years ago
videopress
2 years ago
widget-visibility
2 years ago
widgets
2 years ago
woocommerce-analytics
2 years ago
wordads
2 years ago
wpcom-block-editor
2 years ago
wpcom-tos
5 years ago
blaze.php
2 years ago
carousel.php
2 years ago
comment-likes.php
2 years ago
comments.php
2 years ago
contact-form.php
2 years ago
copy-post.php
2 years ago
custom-content-types.php
4 years ago
custom-css.php
2 years ago
geo-location.php
4 years ago
google-analytics.php
2 years 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
2 years ago
markdown.php
4 years ago
masterbar.php
2 years ago
module-extras.php
2 years ago
module-headings.php
2 years ago
module-info.php
2 years ago
monitor.php
2 years ago
notes.php
2 years ago
photon-cdn.php
2 years ago
photon.php
3 years ago
plugin-search.php
2 years ago
post-by-email.php
5 years ago
post-list.php
4 years ago
protect.php
3 years ago
publicize.php
2 years 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
2 years ago
shortlinks.php
2 years ago
sitemaps.php
4 years ago
sso.php
2 years ago
stats.php
2 years ago
subscriptions.php
2 years ago
theme-tools.php
3 years 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
3 years ago
woocommerce-analytics.php
2 years ago
wordads.php
2 years ago
wpgroho.js
6 years ago
custom-content-types.php
59 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 | /** |
| 19 | * Load Portfolio CPT. |
| 20 | */ |
| 21 | function jetpack_load_custom_post_types() { |
| 22 | include __DIR__ . '/custom-post-types/portfolios.php'; |
| 23 | } |
| 24 | |
| 25 | /** |
| 26 | * Make module configurable. |
| 27 | */ |
| 28 | function jetpack_custom_post_types_loaded() { |
| 29 | Jetpack::enable_module_configurable( __FILE__ ); |
| 30 | } |
| 31 | add_action( 'jetpack_modules_loaded', 'jetpack_custom_post_types_loaded' ); |
| 32 | |
| 33 | /** |
| 34 | * Add Settings Section for CPT |
| 35 | */ |
| 36 | function jetpack_cpt_settings_api_init() { |
| 37 | add_settings_section( |
| 38 | 'jetpack_cpt_section', |
| 39 | '<span id="cpt-options">' . __( 'Your Custom Content Types', 'jetpack' ) . '</span>', |
| 40 | 'jetpack_cpt_section_callback', |
| 41 | 'writing' |
| 42 | ); |
| 43 | } |
| 44 | add_action( 'admin_init', 'jetpack_cpt_settings_api_init' ); |
| 45 | |
| 46 | /** |
| 47 | * Settings Description |
| 48 | */ |
| 49 | function jetpack_cpt_section_callback() { |
| 50 | ?> |
| 51 | <p> |
| 52 | <?php esc_html_e( 'Use these settings to display different types of content on your site.', 'jetpack' ); ?> |
| 53 | <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> |
| 54 | </p> |
| 55 | <?php |
| 56 | } |
| 57 | |
| 58 | jetpack_load_custom_post_types(); |
| 59 |