• Resolved Pbalazs89

    (@pbalazs89)


    Hi there,

    I’m using your plugin and it’s great.
    There is but one issue. We use numerous Custom Post Types on our website, and the notification does not go out, when one is submitted.

    It works fine in the case of the normal post, but now with CPT’s. Is there a setting that can fix this, or an issue that can cause this?

    Thanks!

    Here’s my CPT code:

    <?php
    define( 'POST_TYPE_CIKKEK', 'cikkek' );
    	  $func = 'post_type_' . POST_TYPE_CIKKEK;
    if ( ! function_exists( $func ) ) {
    	function post_type_cikkek() {
    		global $CustomPostMetas;
    
    		$post_type               = POST_TYPE_CIKKEK;
    		$post_type_name          = __( 'Cikkek', THEMENAME );
    		$post_type_singular_name = __( 'Cikk', THEMENAME );
    		register_post_type(
    			$post_type,
    			// CPT Options
    			array(
    				'thumbnail',
    				'supports'        => array( 'title', 'editor', 'thumbnail', 'excerpt', 'author', 'revisions' ),
    				'labels'          => array(
    					'name'          => $post_type_name,
    					'singular_name' => $post_type_singular_name,
    
    				),
    				'menu_icon'       => 'dashicons-text-page',
    				'public'          => true,
    				'has_archive'     => true,
    				'rewrite'         => array( 'slug' => 'cikkek' ),
    				'hierarchical'    => false,
    				'capability_type' => 'post',
    				'taxonomies'      => array( 'post_tag', 'category' ),
    				'show_in_rest'    => true,
    			)
    		);
    
    		flush_rewrite_rules( false );
    
    	}
    }
    add_action( 'init', $func );
    
    /**
    * add order column to admin listing screen for colleges
    */
    if ( ! function_exists( 'add_new_cikkek_column' ) ) {
    	function add_new_cikkek_column( $header_text_columns ) {
    		$header_text_columns['kiemelt_cikk'] = 'Kiemelt';
    		return $header_text_columns;
    	}
    }
    add_action( 'manage_cikkek_posts_columns', 'add_new_cikkek_column' );
    
    /**
    * show custom order column values
    */
    if ( ! function_exists( 'show_cikkek_order_column' ) ) {
    	function show_cikkek_order_column( $name ) {
    		global $post;
    
    		switch ( $name ) {
    			case 'kiemelt_cikk':
    				$kiemelt = get_field( 'kiemelt_cikk', $post->ID );
    				if ( $kiemelt ) {
    					echo get_field( 'meddig_kiemelt_a_cikk', $post->ID );
    				}
    				break;
    		}
    	}
    }
    add_action( 'manage_cikkek_posts_custom_column', 'show_cikkek_order_column' );
    
    // Let Contributor Role to Upload Media
    if ( current_user_can( 'contributor' ) && ! current_user_can( 'upload_files' ) ) {
    	add_action( 'admin_init', 'allow_contributor_uploads' );
    }
    function allow_contributor_uploads() {
    	$contributor = get_role( 'contributor' );
    	$contributor->add_cap( 'upload_files' );
    }

    Thank you in advance!

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Notification works with post, but not custom post types’ is closed to new replies.