Server IP : 14.241.111.210 / Your IP : 18.119.120.229 Web Server : Apache System : Linux localhost.localdomain 3.10.0-1160.66.1.el7.x86_64 #1 SMP Wed May 18 16:02:34 UTC 2022 x86_64 User : www ( 1001) PHP Version : 7.4.33 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,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_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /www/wwwroot/toyota-ninhbinh.vn/wp-content/plugins/post-duplicator/includes/ |
Upload File : |
<?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' );