duplicate-page
Last commit date
languages
8 years ago
admin-settings.php
8 years ago
duplicatepage.php
8 years ago
readme.txt
8 years ago
admin-settings.php
93 lines
| 1 | <?php if ( ! defined( 'ABSPATH' ) ) exit; ?> |
| 2 | <div class="wrap duplicate_page_settings"> |
| 3 | <h1><?php _e('Duplicate Page Settings ', 'duplicate-page')?><a href="http://www.webdesi9.com/product/duplicate-page-pro/" target="_blank" class="button button-primary"><?php _e('Buy PRO', 'duplicate-page')?></a></h1> |
| 4 | |
| 5 | <?php $duplicatepageoptions = array(); |
| 6 | $opt = get_option('duplicate_page_options'); |
| 7 | $msg = isset($_GET['msg']) ? $_GET['msg'] : ''; |
| 8 | if(isset($_POST['submit_duplicate_page']) && wp_verify_nonce( $_POST['duplicatepage_nonce_field'], 'duplicatepage_action' )): |
| 9 | _e("<strong>Saving Please wait...</strong>", 'duplicate-page'); |
| 10 | $needToUnset = array('submit_duplicate_page');//no need to save in Database |
| 11 | foreach($needToUnset as $noneed): |
| 12 | unset($_POST[$noneed]); |
| 13 | endforeach; |
| 14 | foreach($_POST as $key => $val): |
| 15 | $duplicatepageoptions[$key] = $val; |
| 16 | endforeach; |
| 17 | $saveSettings = update_option('duplicate_page_options', $duplicatepageoptions ); |
| 18 | if($saveSettings) |
| 19 | { |
| 20 | duplicate_page::dp_redirect('options-general.php?page=duplicate_page_settings&msg=1'); |
| 21 | } |
| 22 | else |
| 23 | { |
| 24 | duplicate_page::dp_redirect('options-general.php?page=duplicate_page_settings&msg=2'); |
| 25 | } |
| 26 | endif; |
| 27 | if(!empty($msg) && $msg == 1): |
| 28 | _e( '<div class="updated settings-error notice is-dismissible" id="setting-error-settings_updated"> |
| 29 | <p><strong>Settings saved.</strong></p><button class="notice-dismiss" type="button"><span class="screen-reader-text">Dismiss this notice.</span></button></div>', 'duplicate-page'); |
| 30 | elseif(!empty($msg) && $msg == 2): |
| 31 | _e( '<div class="error settings-error notice is-dismissible" id="setting-error-settings_updated"> |
| 32 | <p><strong>Settings not saved.</strong></p><button class="notice-dismiss" type="button"><span class="screen-reader-text">Dismiss this notice.</span></button></div>', 'duplicate-page'); |
| 33 | endif; |
| 34 | ?> |
| 35 | <div id="poststuff"> |
| 36 | <div id="post-body" class="metabox-holder columns-2"> |
| 37 | <div id="post-body-content" style="position: relative;"> |
| 38 | <form action="" method="post" name="duplicate_page_form"> |
| 39 | <?php wp_nonce_field( 'duplicatepage_action', 'duplicatepage_nonce_field' ); ?> |
| 40 | <table class="form-table"> |
| 41 | <tbody> |
| 42 | <tr> |
| 43 | <th scope="row"><label for="duplicate_post_status"><?php _e('Duplicate Post Status', 'duplicate-page')?></label></th> |
| 44 | <td> |
| 45 | <select id="duplicate_post_status" name="duplicate_post_status"> |
| 46 | <option value="draft" <?php echo($opt['duplicate_post_status'] == 'draft' ) ? "selected = 'selected'" : ""; ?>><?php _e('Draft', 'duplicate-page')?></option> |
| 47 | <option value="publish" <?php echo($opt['duplicate_post_status'] == 'publish' ) ? "selected = 'selected'" : ""; ?>><?php _e('Publish', 'duplicate-page')?></option> |
| 48 | <option value="private" <?php echo($opt['duplicate_post_status'] == 'private' ) ? "selected = 'selected'" : ""; ?>><?php _e('Private', 'duplicate-page')?></option> |
| 49 | <option value="pending" <?php echo($opt['duplicate_post_status'] == 'pending' ) ? "selected = 'selected'" : ""; ?>><?php _e('Pending', 'duplicate-page')?></option> |
| 50 | </select> |
| 51 | <p><?php _e('Please select any post status you want to assign for duplicate post. <strong>Default:</strong> Draft.', 'duplicate-page')?></p> |
| 52 | </td> |
| 53 | </tr> |
| 54 | <tr> |
| 55 | <th scope="row"><label for="duplicate_post_redirect"><?php _e('Redirect to after click on <strong>Duplicate This Link</strong>', 'duplicate-page')?></label></th> |
| 56 | <td><select id="duplicate_post_redirect" name="duplicate_post_redirect"> |
| 57 | <option value="to_list" <?php echo($opt['duplicate_post_redirect'] == 'to_list' ) ? "selected = 'selected'" : ""; ?>><?php _e('To All Posts List', 'duplicate-page')?></option> |
| 58 | <option value="to_page" <?php echo($opt['duplicate_post_redirect'] == 'to_page' ) ? "selected = 'selected'" : ""; ?>><?php _e('To Duplicate Edit Screen', 'duplicate-page')?></option> |
| 59 | </select> |
| 60 | <p><?php _e('Please select any post redirection, redirect you to selected after click on duplicate this link. <strong>Default:</strong> To current list.', 'duplicate-page')?></p> |
| 61 | </td> |
| 62 | </tr> |
| 63 | <tr> |
| 64 | <th scope="row"><label for="duplicate_post_suffix"><?php _e('Duplicate Post Suffix', 'duplicate-page')?></label></th> |
| 65 | <td> |
| 66 | <input type="text" class="regular-text" value="<?php echo !empty($opt['duplicate_post_suffix']) ? $opt['duplicate_post_suffix'] : ''?>" id="duplicate_post_suffix" name="duplicate_post_suffix"> |
| 67 | <p><?php _e('Add a suffix for duplicate or clone post as Copy, Clone etc. It will show after title.', 'duplicate-page')?></p> |
| 68 | </td> |
| 69 | </tr> |
| 70 | </tbody></table> |
| 71 | <p class="submit"><input type="submit" value="Save Changes" class="button button-primary" id="submit" name="submit_duplicate_page"></p> |
| 72 | </form> |
| 73 | </div> |
| 74 | <div id="postbox-container-1" class="postbox-container"> |
| 75 | <div id="side-sortables" class="meta-box-sortables ui-sortable"> |
| 76 | <div id="submitdiv" class="postbox" style="padding: 6px;"> |
| 77 | <p><strong style="color:#F00"><?php _e('Contribute some donation, to make plugin more stable. You can pay amount of your choice.', 'duplicate-page')?></strong></p> |
| 78 | <form name="_xclick" action="https://www.paypal.com/yt/cgi-bin/webscr" method="post"> |
| 79 | <input type="hidden" name="cmd" value="_xclick"> |
| 80 | <input type="hidden" name="business" value="mndpsingh287@gmail.com"> |
| 81 | <input type="hidden" name="item_name" value="Duplicate Page Plugin - Donation"> |
| 82 | <input type="hidden" name="currency_code" value="USD"> |
| 83 | <code>$</code> <input type="text" name="amount" value="" required="required" placeholder="Enter amount"> |
| 84 | <input type="image" src="http://www.paypal.com/en_US/i/btn/x-click-butcc-donate.gif" border="0" name="submit" alt="Make Donations with Paypal"> |
| 85 | </form> |
| 86 | <hr /> |
| 87 | </div> |
| 88 | <?php echo $this->duplicate_page_adsense();?> |
| 89 | </div> |
| 90 | </div> |
| 91 | </div> |
| 92 | </div> |
| 93 | </div> |