I’ve included an number of hooks and filters in this plugin to provide you with an opportunity to easily customize it.

It’s best to include these modifications in a new plugin rather than your theme’s functions.php file. You can download a pre-made plugin template from this page named Post Planner Mods.

Download Post Planner Mods Zip File.

Unzip the file and open the post-planner-mods.php file to edit it in your IDE or text editor of choice. The program Notepad works well.
Insert your modifications below the line that says /** Add Customizations Here **/.


Examples:


Rename Topic to Title in the Dashboard Widget

add_filter( 'post_planner_dashboard_topic_heading', 'post_planner_custom_topic' );
function post_planner_custom_topic() {
	$html = '<th>'.esc_html__( 'Title', 'post-planner' ).'</th>';
	return $html;
}

(back to top)


Add More Status Options

add_action( 'post_planner_settings_statuses', 'post_planner_additional_statuses' );
add_filter( 'post_planner_setup_statuses', 'post_planner_setup_additional_statuses' );

function post_planner_additional_statuses() {
	global $PostPlannerSettings;
	add_settings_field( 'status7', esc_attr__( 'Status #7', 'post-planner' ), array( $PostPlannerSettings, 'status_option' ), $PostPlannerSettings->status_key, 'section_status', array( 'label_for' => 'status7' ) );
	add_settings_field( 'status7_color', '', array( $PostPlannerSettings, 'status_color_option' ), $PostPlannerSettings->status_key, 'section_status', array( 'label_for' => 'status7_color' ) );
	add_settings_field( 'status8', esc_attr__( 'Status #8', 'post-planner' ), array( $PostPlannerSettings, 'status_option' ), $PostPlannerSettings->status_key, 'section_status', array( 'label_for' => 'status8' ) );
	add_settings_field( 'status8_color', '', array( $PostPlannerSettings, 'status_color_option' ), $PostPlannerSettings->status_key, 'section_status', array( 'label_for' => 'status8_color' ) );
	add_settings_field( 'status9', esc_attr__( 'Status #9', 'post-planner' ), array( $PostPlannerSettings, 'status_option' ), $PostPlannerSettings->status_key, 'section_status', array( 'label_for' => 'status9' ) );
	add_settings_field( 'status9_color', '', array( $PostPlannerSettings, 'status_color_option' ), $PostPlannerSettings->status_key, 'section_status', array( 'label_for' => 'status9_color' ) );
	add_settings_field( 'status10', esc_attr__( 'Status #10', 'post-planner' ), array( $PostPlannerSettings, 'status_option' ), $PostPlannerSettings->status_key, 'section_status', array( 'label_for' => 'status10' ) );
	add_settings_field( 'status10_color', '', array( $PostPlannerSettings, 'status_color_option' ), $PostPlannerSettings->status_key, 'section_status', array( 'label_for' => 'status10_color' ) );
}

function post_planner_setup_additional_statuses( $statuses ) {
	$status_options = ( get_option( 'PostPlanner_status' ) ? get_option( 'PostPlanner_status' ) : array() );
	if ( $status_options['status7'] != '' ) $statuses[7] = array(
		'color' => $status_options['status7_color'],
		'name'  => $status_options['status7'] );
	if ( $status_options['status8'] != '' ) $statuses[8] = array(
		'color' => $status_options['status8_color'],
		'name'  => $status_options['status8'] );
	if ( $status_options['status9'] != '' ) $statuses[9] = array(
		'color' => $status_options['status9_color'],
		'name'  => $status_options['status9'] );
	if ( $status_options['status10'] != '' ) $statuses[10] = array(
		'color' => $status_options['status10_color'],
		'name'  => $status_options['status10'] );
	return $statuses;
}

(back to top)


Add Additional Checklist Items

add_action( 'post_planner_settings_checklist', 'post_planner_additional_checklist_items' );
function post_planner_additional_checklist_items() {
	global $PostPlannerSettings;
	add_settings_field( 'checklist11', esc_attr__( 'Checklist Item #11', 'post-planner' ), array( $PostPlannerSettings, 'checklist_option' ), $PostPlannerSettings->checklist_key, 'section_checklist', 
		array( 'label_for' => 'checklist11' ) );
	add_settings_field( 'checklist12', esc_attr__( 'Checklist Item #12', 'post-planner' ), array( $PostPlannerSettings, 'checklist_option' ), $PostPlannerSettings->checklist_key, 'section_checklist', 
		array( 'label_for' => 'checklist12' ) );
	add_settings_field( 'checklist13', esc_attr__( 'Checklist Item #13', 'post-planner' ), array( $PostPlannerSettings, 'checklist_option' ), $PostPlannerSettings->checklist_key, 'section_checklist', 
		array( 'label_for' => 'checklist13' ) );
	add_settings_field( 'checklist14', esc_attr__( 'Checklist Item #14', 'post-planner' ), array( $PostPlannerSettings, 'checklist_option' ), $PostPlannerSettings->checklist_key, 'section_checklist', 
		array( 'label_for' => 'checklist14' ) );
	add_settings_field( 'checklist15', esc_attr__( 'Checklist Item #15', 'post-planner' ), array( $PostPlannerSettings, 'checklist_option' ), $PostPlannerSettings->checklist_key, 'section_checklist', 
		array( 'label_for' => 'checklist15' ) );
}

(back to top)


Restrict the Posts that are listed in the Associate Content box

You can use any of the arguments usable with get_posts(). The example below only gets posts that are in the category with an ID of 1.

add_filter( 'post_planner_associated_content_args', 'post_planner_custom_content_args' );
function post_planner_custom_content_args( $args ) {
	$args['category'] = 1;
	return $args;
}

(back to top)


Show Additional Cleverness To-Do List Fields

Remove the fields you don’t need and add HTML or change the wording as needed to display the fields the way you want.

For Uncompleted Items:

add_action( 'post_planner_todo_meta', 'post_planner_additional_todo_meta', 2 );
function post_planner_additional_todo_meta( $id ) {

	// Add Added By Date
	$post_tmp = get_post( $id );
	$author = get_the_author_meta( 'nickname', $post_tmp->post_author );
	?>
	Added by: <?php echo esc_html( $author ); ?>

	<?php
	// Add Date Added
	$date_added = get_the_time( CTDL_Loader::$settings['date_format'], $id );
	?>
	Date Added: <?php echo esc_html( $date_added ); ?>

	<?php
	// Add this line for priorities, assigned user, desdline, and progress
	list( $priority_meta, $assign_meta, $deadline_meta, $completed_meta, $progress_meta ) = CTDL_Lib::get_todo_meta( $id );

	// Add Priority
	global $ClevernessToDoList;
	$priority = $ClevernessToDoList->priorities [priority_meta];
	?>
	Priority: <?php echo esc_html( $priority ); ?>

	<?php
	// Add Deadline
	if ( $deadline_meta != '' ) :
		$deadline = date( CTDL_Loader::$settings['date_format'], $deadline_meta );
		?>
		Deadline: <?php echo esc_html( $deadline ); ?>
	<?php endif; ?>

	<?php
	// Add Progress
	$progress = esc_html( $progress_meta ).'%';
	?>
	Progress: <?php echo $progress; ?>

	<?php
	// Add Assigned User
	if ( is_array( $assign_meta ) ) {
		$assign_users = '';
		foreach ( $assign_meta as $value ) {
			if ( $value != '-1' && $value != '' && $value != 0 ) {
				$user = get_userdata( $value );
				$assign_users .= esc_html( $user->display_name ).', ';
			}
		}
		if ( $assign_users != '' ) :
			$assigned_to = substr( $assign_users, 0, -2 );
			?>
			Assigned To: <?php echo esc_html( $assigned_to ); ?>
		<?php endif;
	} else {
		if ( $assign_meta != '-1' && $assign_meta != '' && $assign_meta != 0 ) {
			$assign_user = get_userdata( $assign_meta );
			$assigned_to = $assign_user->display_name;
			?>
			Assigned To: <?php echo esc_html( $assigned_to ); ?>
		<?php
		}
	}

}

For Completed Items:

add_action( 'post_planner_todo_completed_meta', 'post_planner_additional_todo_completed_meta', 2 );
function post_planner_additional_todo_completed_meta( $id ) {

	// Add Added By Date
	$post_tmp = get_post( $id );
	$author   = get_the_author_meta( 'nickname', $post_tmp->post_author );
	?>
	Added by: <?php echo esc_html( $author ); ?>

	<?php
	// Add Date Added
	$date_added = get_the_time( CTDL_Loader::$settings['date_format'], $id );
	?>
	Date Added: <?php echo esc_html( $date_added ); ?>

	<?php
	// Add this line for priorities, assigned user, desdline, completed date, and progress
	list( $priority_meta, $assign_meta, $deadline_meta, $completed_meta, $progress_meta ) = CTDL_Lib::get_todo_meta( $id );

	// Add Priority
	global $ClevernessToDoList;
	$priority = $ClevernessToDoList->priorities [$priority_meta];
	?>
	Priority: <?php echo esc_html( $priority ); ?>

	<?php
	// Add Deadline
	if ( $deadline_meta != '' ) :
		$deadline = date( CTDL_Loader::$settings['date_format'], $deadline_meta );
		?>
		Deadline: <?php echo esc_html( $deadline ); ?>
	<?php endif; ?>

	<?php
	// Add Progress
	$progress = $progress_meta.'%';
	?>
	Progress: <?php echo esc_html( $progress ); ?>

	<?php
	// Add Assigned User
	if ( is_array( $assign_meta ) ) {
		$assign_users = '';
		foreach ( $assign_meta as $value ) {
			if ( $value != '-1' && $value != '' && $value != 0 ) {
				$user = get_userdata( $value );
				$assign_users .= esc_html( $user->display_name ).', ';
			}
		}
		if ( $assign_users != '' ) :
			$assigned_to = substr( $assign_users, 0, -2 );
			?>
			Assigned To: <?php echo esc_html( $assigned_to ); ?>
		<?php endif;
	} else {
		if ( $assign_meta != '-1' && $assign_meta != '' && $assign_meta != 0 ) {
			$assign_user = get_userdata( $assign_meta );
			$assigned_to = $assign_user->display_name;
			?>
			Assigned To: <?php echo esc_html( $assigned_to ); ?>
		<?php
		}
	}

	// Add Completed Date
	$completed = date( CTDL_Loader::$settings['date_format'], strtotime( $completed_meta ) );
	?>
	Completed: <?php echo esc_html( $completed ); ?>

<?php
}

(back to top)