HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux wordpress-ubuntu-s-2vcpu-4gb-fra1-01 5.4.0-169-generic #187-Ubuntu SMP Thu Nov 23 14:52:28 UTC 2023 x86_64
User: root (0)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/vcz/wp-content/plugins/post-duplicator/includes/functions.php
<?php

/**
 * Return a value from the options table if it exists,
 * or return a default value
 *
 * @since 2.15
 */
function get_mtphr_post_duplicator_settings() {
	
	// Get the options
	$settings = get_option('mtphr_post_duplicator_settings', array());
	
	$defaults = array(
		'post_duplication' => 'all_users',
		'post_author' => 'current_user',
		'status' => 'same',
		'type' => 'same',
		'timestamp' => 'current',
		'title' => __('Copy', 'post-duplicator'),
		'slug' => 'copy',
		'time_offset' => false,
		'time_offset_days' => 0,
		'time_offset_hours' => 0,
		'time_offset_minutes' => 0,
		'time_offset_seconds' => 0,
		'time_offset_direction' => 'newer'
	);
	
	// Filter the settings
	$settings = apply_filters( 'mtphr_post_duplicator_settings', $settings );
	
	// Return the settings
	return wp_parse_args( $settings, $defaults );
}


function mtphr_post_duplicator_submitbox( $post ) {
	if( $post->post_status == 'publish' ) {
		$settings = get_mtphr_post_duplicator_settings();
		if ( 'current_user' === $settings['post_duplication'] ) {
			if ( get_current_user_id() != $post->post_author ) {
				return false;
			}
		}
		$post_type = get_post_type_object( $post->post_type );
		$nonce = wp_create_nonce( 'm4c_ajax_file_nonce' );
		?>
		<div class="misc-pub-section misc-pub-duplicator" id="duplicator">
			<a class="m4c-duplicate-post button button-small" rel="<?php echo esc_attr( $nonce ); ?>" href="#" data-postid="<?php echo esc_attr( $post->ID ); ?>"><?php esc_html_e( sprintf( __( 'Duplicate %s', 'post-duplicator' ), $post_type->labels->singular_name ) ); ?></a><span class="spinner" style="float:none;margin-top:2px;margin-left:4px;"></span>
		</div>
		<?php
	}
}
add_action( 'post_submitbox_misc_actions', 'mtphr_post_duplicator_submitbox' );