public/wordpress/wp-content/plugins/wp-courseware/includes/legacy/admin/functions.php
/**
 * Add a duplicate post link.
 *
 * @since 1.0.0
 */
Add a duplicate post link.
Add a duplicate post link .
function WPCW_units_admin_addActionRows( $actions, $post ) {
	if ( 'course_unit' == $post->post_type ) {
		$actions['duplicate_post'] = sprintf( '<a class="wpcw_units_admin_duplicate" data-nonce="%s" data-postid="%d" href="#">%s</a>',
			wp_create_nonce( 'wpcw_ajax_unit_change' ),
			$post->ID,
			__( 'Duplicate Unit', 'wp-courseware' )
		);
	}
	return $actions;
}
function WPCW_units_admin_addActionRows ( $ actions , $ post ) { if ( 'course_unit' == $ post -> post_type ) { $ actions [ 'duplicate_post' ] = sprintf ( '<a class="wpcw_units_admin_duplicate" data-nonce="%s" data-postid="%d" href="#">%s</a>' , wp_create_nonce ( 'wpcw_ajax_unit_change' ) , $ post -> ID , __ ( 'Duplicate Unit' , 'wp-courseware' ) ) ; } return $ actions ; }
Add a duplicate post link.
Add a duplicate post link .
// Only add duplicate for units. // Create a nonce & add an action to duplicate this unit.