sfwd_cpt_options

apply_filters( 'sfwd_cpt_options',  array $post_options,  string $post_type )

Filters the custom post type registration options.


Description #


Parameters #

$post_options

(array) An array of post options.

$post_type

(string) Post type slug.


Source #

File: includes/class-ld-cpt.php


Examples #

 <?php
/**
 * Example usage for sfwd_cpt_options filter.
 */
add_filter(
	'sfwd_cpt_options',
	function( $post_args = array(), $post_type = '' ) {
		if ( $post_type == 'sfwd-courses' ) {
			$post_args['has_archive'] = false;
		}

		// always return the $post_args array
		return $post_args;
	},
	10,
	2
);
 

Changelog #

Changelog
Version Description
2.1.0 Introduced.