PHP code example of pronamic / wp-pronamic-post-expiration

1. Go to this page and download the library: Download pronamic/wp-pronamic-post-expiration library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

pronamic / wp-pronamic-post-expiration example snippets


\register_post_type(
	'your_post_type',
	[
		// …
		'supports'           => [
			'title',
			'editor',
			'thumbnail',
			// …
			'pronamic-expiration',
		],
		// …
	]
);

\register_post_type(
	'your_post_type',
	[
		// …
		'supports'           => [
			'title',
			'editor',
			'thumbnail',
			// …
			'pronamic-expiration' => [
				'post_status' => 'pronamic_expired',
				'show_ui'     => true,
				'source'      => 'your-plugin-slug',
			],
		],
		// …
	]
);