PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 12.7
Jetpack – WP Security, Backup, Speed, & Growth v12.7
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 in Jetpack – WP Security, Backup, Speed, & Growth 12.7, at modules/custom-content-types.php

59 lines 1.5 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 /**
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