protected function registerMessages( $cpt, ArgumentCollection $args ) {
		$method_name = "messages_for_${cpt}";

		$this->$method_name = function ( $messages ) use ( $cpt, $args ) {

			$args->prepareMessages();

			$messages[ $cpt ] = $args->get( Argument::MESSAGES );

			if ( $this->isQueryable( $cpt ) ) {

				$permalink = $this->getPermalink();

				foreach ( $this->getMessagesWithViewLink() as $key ) {
					$messages[ $cpt ][ $key ] .= $this->getViewLink( $permalink,
						$args );
				}

				foreach ( $this->getMessagesWithPreviewLink() as $key ) {
					$messages[ $cpt ][ $key ] .= $this->getPreviewLink( $permalink,
						$args );
				}
			}

			return $messages;
		};

		add_filter( 'post_updated_messages', [ $this, $method_name ] );
	}
protected function registerMessages( $cpt, ArgumentCollection $args ) {
		$method_name = "messages_for_${cpt}";

		$this->$method_name = function ( $messages ) use ( $cpt, $args ) {

			$args->prepareMessages();

			$messages[ $cpt ] = $args->get( Argument::MESSAGES );

			if ( $this->isQueryable( $cpt ) ) {

				$permalink = $this->getPermalink();

				foreach ( $this->getMessagesWithViewLink() as $key ) {
					$messages[ $cpt ][ $key ] .= $this->getViewLink( $permalink,
						$args );
				}

				foreach ( $this->getMessagesWithPreviewLink() as $key ) {
					$messages[ $cpt ][ $key ] .= $this->getPreviewLink( $permalink,
						$args );
				}
			}

			return $messages;
		};

		add_filter( 'post_updated_messages', [ $this, $method_name ] );
	}
protected function registerMessages ( $ cpt , ArgumentCollection $ args ) { $ method_name = "messages_for_${cpt}" ; $ this -> $ method_name = function ( $ messages ) use ( $ cpt , $ args ) { $ args -> prepareMessages ( ) ; $ messages [ $ cpt ] = $ args -> get ( Argument :: MESSAGES ) ; if ( $ this -> isQueryable ( $ cpt ) ) { $ permalink = $ this -> getPermalink ( ) ; foreach ( $ this -> getMessagesWithViewLink ( ) as $ key ) { $ messages [ $ cpt ] [ $ key ] .= $ this -> getViewLink ( $ permalink , $ args ) ; } foreach ( $ this -> getMessagesWithPreviewLink ( ) as $ key ) { $ messages [ $ cpt ] [ $ key ] .= $ this -> getPreviewLink ( $ permalink , $ args ) ; } } return $ messages ; } ; add_filter ( 'post_updated_messages' , [ $ this , $ method_name ] ) ; }
Register the edit form messages.

@since 0.1.0

@param string             $cpt  Identifier of the custom post type.
@param ArgumentCollection $args Collection of arguments.
Register the edit form messages .