HEX
Server: nginx/1.24.0
System: Linux DGT-WORDPRESS-VM-SERVER 6.14.0-1017-azure #17~24.04.1-Ubuntu SMP Mon Dec 1 20:10:50 UTC 2025 x86_64
User: ubuntu (1000)
PHP: 8.4.12
Disabled: NONE
Upload Files
File: /mnt/data/mentoring-wp/wp-content/plugins/mentoringcpt/mentoringcpt.php
<?php
/**
 * Plugin Name: Mentoring CPT
 * Description: creating the post types for mentoring theme.
 * Version: 1.2.9
 * Author: Dreams Technologies
 * Text Domain: mentoring_cpt
 *  * Domain Path: /languages
 *
 */
// Our custom post type function
function mentoring_posttype() {
  
    register_post_type( 'testimonials',
    // CPT Options
        array(
            'labels' => array(
                'name' => __( 'Testimonial','mentoring_cpt' ),
                'singular_name' => __( 'testimonials' ,'mentoring_cpt')
            ),
            'public' => true,
            'has_archive' => true,
            'supports' => array('title','editor','thumbnail','custom-fields','excerpt'),
            'rewrite' => array('slug' => 'testimonial'),
            'show_in_rest' => true,
  
        )
    );
    register_post_type( 'portfolio',
    // CPT Options
        array(
            'labels' => array(
                'name' => __( 'Portfolio' ,'mentoring_cpt' ),
                'singular_name' => __( 'Portfolio','mentoring_cpt' )
            ),
            'public' => true,
            'has_archive' => true,
            'supports' => array('title','editor','thumbnail'),
            'rewrite' => array('slug' => 'portfolio'),
            'show_in_rest' => true,
  
        )
    );
}
// Hooking up our function to theme setup
add_action( 'init', 'mentoring_posttype' );


/**
 * Load plugin textdomain.
 *
 * @since 1.0.0
 */
/**
 * Deactive plugin
 *
 * @throws error
 * @return 
 */
if( !function_exists('mentoring_cpt_load_textdomain') ) {
	add_action( 'init', 'mentoring_cpt_load_textdomain' );
	function mentoring_cpt_load_textdomain() {
	  load_plugin_textdomain( 'mentoring_cpt', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' ); 
	}
}