From 82a1386c837359d0d14f0d84bc5798f40c2f0109 Mon Sep 17 00:00:00 2001 From: Douglas Kesi-Ayeba Kendyson Date: Sat, 17 Sep 2016 03:49:59 +0100 Subject: [PATCH] newly renamed functions. --- .DS_Store | Bin 6148 -> 6148 bytes admin/class-paystack-forms-admin.php | 156 ++++++++++++--------------- 2 files changed, 66 insertions(+), 90 deletions(-) diff --git a/.DS_Store b/.DS_Store index 8ab2cc54dc4d3a46188d65dcfc396b6e7c546780..39da371f26e08b24523bca224240f4623d02e1ac 100644 GIT binary patch delta 47 zcmZoMXffDuhD}z8p@1Qgp^~APp#(@LGh{R9GNdu&GZZo8G8Auq$|lFSnVsV=KL95S B3|RmG delta 46 xcmZoMXffDuhD}m{p@1O`2z7yUB10uZF+&NEPG-p7{E|(Mabg3@W_FIh`~V%e41oXu diff --git a/admin/class-paystack-forms-admin.php b/admin/class-paystack-forms-admin.php index 6783f11..e88ee6b 100755 --- a/admin/class-paystack-forms-admin.php +++ b/admin/class-paystack-forms-admin.php @@ -8,20 +8,20 @@ public function __construct( $plugin_name, $version ) { $this->plugin_name = $plugin_name; $this->version = $version; - add_action('admin_menu' , 'add_settings_page'); - add_action( 'admin_init', 'register_paystack_setting_page' ); + add_action('admin_menu' , 'kkd_pff_paystack_add_settings_page'); + add_action( 'admin_init', 'kkd_pff_paystack_register_setting_page' ); - function add_settings_page() { - add_submenu_page('edit.php?post_type=paystack_form', 'Api Keys Settings', 'Api Keys Settings', 'edit_posts', basename(__FILE__), 'paystack_setting_page'); + function kkd_pff_paystack_add_settings_page() { + add_submenu_page('edit.php?post_type=paystack_form', 'Api Keys Settings', 'Api Keys Settings', 'edit_posts', basename(__FILE__), 'kkd_pff_paystack_setting_page'); } - function register_paystack_setting_page() { - register_setting( 'paystack-form-settings-group', 'mode' ); - register_setting( 'paystack-form-settings-group', 'tsk' ); - register_setting( 'paystack-form-settings-group', 'tpk' ); - register_setting( 'paystack-form-settings-group', 'lsk' ); - register_setting( 'paystack-form-settings-group', 'lpk' ); + function kkd_pff_paystack_register_setting_page() { + register_setting( 'kkd-pff-paystack-settings-group', 'mode' ); + register_setting( 'kkd-pff-paystack-settings-group', 'tsk' ); + register_setting( 'kkd-pff-paystack-settings-group', 'tpk' ); + register_setting( 'kkd-pff-paystack-settings-group', 'lsk' ); + register_setting( 'kkd-pff-paystack-settings-group', 'lpk' ); } - function txncheck($name,$txncharge){ + function kkd_pff_paystack_txncheck($name,$txncharge){ if ($name == $txncharge) { $result = "selected"; }else{ @@ -29,19 +29,19 @@ function txncheck($name,$txncharge){ } return $result; } - function paystack_setting_page() { + function kkd_pff_paystack_setting_page() { ?>

Paystack Forms API KEYS Settings!

- + @@ -71,8 +71,8 @@ function paystack_setting_page() { _x( 'Paystack Forms', 'paystack_form' ), @@ -111,9 +111,9 @@ function register_cpt_paystack_form() { ); register_post_type( 'paystack_form', $args ); } - add_filter('user_can_richedit', 'disable_wyswyg_for_custom_post_type'); + add_filter('user_can_richedit', 'kkd_pff_paystack_disable_wyswyg'); - function pform_add_action_button($actions, $post){ + function kkd_pff_paystack_add_view_payments($actions, $post){ if(get_post_type() === 'paystack_form'){ unset($actions['view']); @@ -128,14 +128,14 @@ function pform_add_action_button($actions, $post){ } return $actions; } - add_filter( 'page_row_actions', 'pform_add_action_button', 10, 2 ); + add_filter( 'page_row_actions', 'kkd_pff_paystack_add_view_payments', 10, 2 ); - function wpa_47010( $qtInit ) { + function kkd_pff_paystack_remove_fullscreen( $qtInit ) { $qtInit['buttons'] = 'fullscreen'; return $qtInit; } - function disable_wyswyg_for_custom_post_type( $default ){ + function kkd_pff_paystack_disable_wyswyg( $default ){ global $post_type, $_wp_theme_features;; @@ -143,15 +143,15 @@ function disable_wyswyg_for_custom_post_type( $default ){ echo ""; add_action("admin_print_footer_scripts", "kkd_pff_paystack_shortcode_button_script"); add_filter( 'user_can_richedit' , '__return_false', 50 ); - add_action( 'wp_dashboard_setup', 'remove_dashboard_widgets' ); + add_action( 'wp_dashboard_setup', 'kkd_pff_paystack_remove_dashboard_widgets' ); remove_action( 'media_buttons', 'media_buttons' ); remove_meta_box( 'postimagediv','post','side' ); - add_filter('quicktags_settings', 'wpa_47010'); + add_filter('quicktags_settings', 'kkd_pff_paystack_remove_fullscreen'); } return $default; } - function remove_dashboard_widgets() { + function kkd_pff_paystack_remove_dashboard_widgets() { remove_meta_box( 'dashboard_right_now', 'dashboard', 'normal' ); // Right Now remove_meta_box( 'dashboard_recent_comments', 'dashboard', 'normal' ); // Recent Comments remove_meta_box( 'dashboard_incoming_links', 'dashboard', 'normal' ); // Incoming Links @@ -162,9 +162,9 @@ function remove_dashboard_widgets() { remove_meta_box( 'dashboard_secondary', 'dashboard', 'side' ); // Other WordPress News // use 'dashboard-network' as the second parameter to remove widgets from a network dashboard. } - add_filter( 'manage_edit-paystack_form_columns', 'my_edit_paystack_form_columns' ) ; + add_filter( 'manage_edit-paystack_form_columns', 'kkd_pff_paystack_edit_dashboard_header_columns' ) ; - function my_edit_paystack_form_columns( $columns ) { + function kkd_pff_paystack_edit_dashboard_header_columns( $columns ) { $columns = array( 'cb' => '', @@ -176,16 +176,16 @@ function my_edit_paystack_form_columns( $columns ) { return $columns; } - add_action( 'manage_paystack_form_posts_custom_column', 'my_paystack_form_columns', 10, 2 ); + add_action( 'manage_paystack_form_posts_custom_column', 'kkd_pff_paystack_dashboard_table_data', 10, 2 ); - function my_paystack_form_columns( $column, $post_id ) { + function kkd_pff_paystack_dashboard_table_data( $column, $post_id ) { global $post,$wpdb; $table = $wpdb->prefix . 'paystack_forms_payments'; switch( $column ) { case 'shortcode' : echo ' - '; break; @@ -200,9 +200,9 @@ function my_paystack_form_columns( $column, $post_id ) { break; } } - add_filter( 'default_content', 'my_editor_content', 10, 2 ); + add_filter( 'default_content', 'kkd_pff_paystack_editor_content', 10, 2 ); - function my_editor_content( $content, $post ) { + function kkd_pff_paystack_editor_content( $content, $post ) { switch( $post->post_type ) { case 'paystack_form': @@ -216,25 +216,25 @@ function my_editor_content( $content, $post ) { return $content; } ///// - function help_metabox( $post ) { + function kkd_pff_paystack_editor_help_metabox( $post ) { do_meta_boxes( null, 'custom-metabox-holder', $post ); } - add_action( 'edit_form_after_title', 'help_metabox' ); - function add_help_metabox() { + add_action( 'edit_form_after_title', 'kkd_pff_paystack_editor_help_metabox' ); + function kkd_pff_paystack_editor_add_help_metabox() { add_meta_box( 'awesome_metabox_id', 'Help Section', - 'help_metabox_details', + 'kkd_pff_paystack_editor_help_metabox_details', 'paystack_form', 'custom-metabox-holder' //Look what we have here, a new context ); } - add_action( 'add_meta_boxes', 'add_help_metabox' ); + add_action( 'add_meta_boxes', 'kkd_pff_paystack_editor_add_help_metabox' ); - function help_metabox_details( $post ) { + function kkd_pff_paystack_editor_help_metabox_details( $post ) { echo ''; @@ -252,17 +252,17 @@ function help_metabox_details( $post ) { Pay button Description:

'; echo ''; echo '

Transaction Charges:

'; - echo ''; + // echo ''; echo '

User logged In:

'; echo ''; echo '

Success Message after Payment

'; echo ''; @@ -307,7 +307,7 @@ function wpt_form_data() { echo ''; } - function wpt_email_data() { + function kkd_pff_paystack_editor_add_email_data() { global $post; // Noncename needed to verify where the data originated @@ -327,8 +327,8 @@ function wpt_email_data() { // Echo out the field echo '

Send Email Receipt:

'; echo ''; echo '

Email Subject:

'; echo ''; @@ -338,7 +338,7 @@ function wpt_email_data() { echo ''; } - function wpt_recur_data() { + function kkd_pff_paystack_editor_add_recur_data() { global $post; // Noncename needed to verify where the data originated @@ -354,16 +354,16 @@ function wpt_recur_data() { // Echo out the field echo '

Reccuring Payment:

'; echo ''; echo '

Paystack Recur Plan code:

'; echo 'Plan amount must match amount on extra form description.'; } - function wpt_form_data_meta($post_id, $post) { + function kkd_pff_paystack_save_data($post_id, $post) { if ( !wp_verify_nonce( @$_POST['eventmeta_noncename'], plugin_basename(__FILE__) )) { return $post->ID; @@ -404,7 +404,7 @@ function wpt_form_data_meta($post_id, $post) { } } - add_action('save_post', 'wpt_form_data_meta', 1, 2); + add_action('save_post', 'kkd_pff_paystack_save_data', 1, 2); @@ -413,47 +413,23 @@ function wpt_form_data_meta($post_id, $post) { public function enqueue_styles() { - /** - * This function is provided for demonstration purposes only. - * - * An instance of this class should be passed to the run() function - * defined in Paystack_Forms_Loader as all of the hooks are defined - * in that particular class. - * - * The Paystack_Forms_Loader will then create the relationship - * between the defined hooks and the functions defined in this - * class. - */ - wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/paystack-forms-admin.css', array(), $this->version, 'all' ); } public function enqueue_scripts() { - /** - * This function is provided for demonstration purposes only. - * - * An instance of this class should be passed to the run() function - * defined in Paystack_Forms_Loader as all of the hooks are defined - * in that particular class. - * - * The Paystack_Forms_Loader will then create the relationship - * between the defined hooks and the functions defined in this - * class. - */ - wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/paystack-forms-admin.js', array( 'jquery' ), $this->version, false ); } } -add_action( 'admin_menu', 'register_newpage' ); -function register_newpage(){ - add_menu_page('paystack', 'paystack', 'administrator','submissions', 'payment_submissions'); +add_action( 'admin_menu', 'kkd_pff_paystack_register_newpage' ); +function kkd_pff_paystack_register_newpage(){ + add_menu_page('paystack', 'paystack', 'administrator','submissions', 'kkd_pff_paystack_payment_submissions'); remove_menu_page('submissions'); } -function payment_submissions(){ +function kkd_pff_paystack_payment_submissions(){ $id = $_GET['form']; $obj = get_post($id); if ($obj->post_type == 'paystack_form') { @@ -464,7 +440,7 @@ function payment_submissions(){ $txncharge = get_post_meta($id,'_txncharge',true); echo "

".$obj->post_title." Payments

"; - $exampleListTable = new Payments_List_Table(); + $exampleListTable = new Kkd_Pff_Paystack_Payments_List_Table(); $exampleListTable->prepare_items(); ?>
@@ -475,7 +451,7 @@ function payment_submissions(){ } } -class Paystack_Wp_List_Table{ +class Kkd_Pff_Paystack_Wp_List_Table{ public function __construct(){ add_action( 'admin_menu', array($this, 'add_menu_example_list_table_page' )); } @@ -522,7 +498,7 @@ function format_data($data){ return $text; } -class Payments_List_Table extends WP_List_Table{ +class Kkd_Pff_Paystack_Payments_List_Table extends WP_List_Table{ public function prepare_items(){ $post_id = $_GET['form']; $currency = get_post_meta($post_id,'_currency',true);
Mode