wpseek.com
A WordPress-centric search engine for devs and theme authors



wp_maybe_activate_template › WordPress Function

Sincen/a
Deprecatedn/a
wp_maybe_activate_template ( $post_id )
Defined at:
Codex:

No description yet.



Source

function wp_maybe_activate_template( $post_id ) {
	$post                   = get_post( $post_id );
	$is_inactive_by_default = get_post_meta( $post_id, 'is_inactive_by_default', true );
	if ( $is_inactive_by_default ) {
		return;
	}
	$active_templates                     = get_option( 'active_templates', array() );
	$active_templates[ $post->post_name ] = $post->ID;
	update_option( 'active_templates', $active_templates );
}