Changeset 1286247
- Timestamp:
- 11/14/2015 03:14:26 PM (10 years ago)
- Location:
- keeping-points/trunk
- Files:
-
- 2 edited
-
keeping-points.php (modified) (14 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
keeping-points/trunk/keeping-points.php
r1281376 r1286247 52 52 // PLUGIN PREFIX: 53 53 // ------------------------------------------------------------------------ 54 // A PREFIX IS USED TO AVOID CONFLICTS WITH EXISTING PLUGIN FUNCTION NAMES.55 // WHEN CREATING A NEW PLUGIN, CHANGE THE PREFIX AND USE YOUR TEXT EDITORS56 // SEARCH/REPLACE FUNCTION TO RENAME THEM ALL QUICKLY.57 // ------------------------------------------------------------------------58 59 // 'posk_' prefix is derived from [p]plugin [o]ptions [s]tarter [k]it60 54 61 55 // ------------------------------------------------------------------------ … … 73 67 add_filter( 'plugin_action_links', 'dl_keeping_points_plugin_action_links', 10, 2 ); 74 68 75 // -------------------------------------------------------------------------------------- 76 // CALLBACK FUNCTION FOR: register_uninstall_hook(__FILE__, 'posk_delete_plugin_options') 69 77 70 // -------------------------------------------------------------------------------------- 78 71 // THIS FUNCTION RUNS WHEN THE USER DEACTIVATES AND DELETES THE PLUGIN. IT SIMPLY DELETES … … 85 78 } 86 79 87 // ------------------------------------------------------------------------------88 // CALLBACK FUNCTION FOR: register_activation_hook(__FILE__, 'posk_add_defaults')89 80 // ------------------------------------------------------------------------------ 90 81 // THIS FUNCTION RUNS WHEN THE PLUGIN IS ACTIVATED. IF THERE ARE NO THEME OPTIONS … … 100 91 if(($tmp['chk_default_options_db']=='1')||(!is_array($tmp))) { 101 92 delete_option('keeping_points_options'); // so we don't have to reset all the 'off' checkboxes too! (don't think this is needed but leave for now) 102 $arr = array( "chk_button1" => "1", 103 "chk_button3" => "1", 104 "textarea_one" => "This type of control allows a large amount of information to be entered all at once. Set the 'rows' and 'cols' attributes to set the width and height.", 105 "textarea_two" => "This text area control uses the TinyMCE editor to make it super easy to add formatted content.", 106 "textarea_three" => "Another TinyMCE editor! It is really easy now in WordPress 3.3 to add one or more instances of the built-in WP editor.", 107 "txt_one" => "Enter whatever you like here..", 108 "drp_select_box" => "four", 109 "chk_default_options_db" => "", 110 "rdo_group_one" => "one", 111 "rdo_group_two" => "two" 93 $arr = array( "chk_default_options_db" => "" 112 94 ); 113 95 update_option('keeping_points_options', $arr); … … 117 99 118 100 119 // ------------------------------------------------------------------------------120 // CALLBACK FUNCTION FOR: add_action('admin_init', 'posk_init' )121 101 // ------------------------------------------------------------------------------ 122 102 // THIS FUNCTION RUNS WHEN THE 'admin_init' HOOK FIRES, AND REGISTERS YOUR PLUGIN … … 130 110 } 131 111 132 // ------------------------------------------------------------------------------133 // CALLBACK FUNCTION FOR: add_action('admin_menu', 'posk_add_options_page');134 112 // ------------------------------------------------------------------------------ 135 113 // THIS FUNCTION RUNS WHEN THE 'admin_menu' HOOK FIRES, AND ADDS A NEW OPTIONS … … 143 121 } 144 122 123 ///LOAD AJAX TO MENU PAGE 145 124 function dl_keeping_points_load_scripts($hook) { 146 125 global $point_settings; … … 153 132 add_action('admin_enqueue_scripts', 'dl_keeping_points_load_scripts'); 154 133 134 //TEST DISPLAY FOR AJAX 155 135 function dl_keeping_points_process_ajax() { 156 136 $options = get_option('keeping_points_options'); … … 161 141 add_action ( 'wp_ajax_points_action' , 'dl_keeping_points_process_ajax' ); 162 142 163 //function to display point fields 143 //function to display point fields - ADDS BUTTONS TO ADMIN MENU DEPENDING ON 144 //HOW MANY BUTTONS ARE NEEDED BY USER // ADD AJAX FUNCTIONALITY IN NEXT VERSION 164 145 function dl_keeping_points_loop_point_choice($number) { 165 146 for($i=0;$i < $number; $i++) { … … 189 170 } 190 171 172 //FUNCTION TO DISPLAY TEXT BOXES TO ADD NAMES AND POINTS FOR PERSON IN POINT SYSTEM. 191 173 function dl_keeping_points_dlaugh_ppl_names() { 192 174 … … 278 260 </script> 279 261 */ 280 // ------------------------------------------------------------------------------ 281 // CALLBACK FUNCTION SPECIFIED IN: add_options_page() 262 282 263 // ------------------------------------------------------------------------------ 283 264 // THIS FUNCTION IS SPECIFIED IN add_options_page() AS THE CALLBACK FUNCTION THAT … … 390 371 } 391 372 392 // ------------------------------------------------------------------------------393 // SAMPLE USAGE FUNCTIONS:394 // ------------------------------------------------------------------------------395 // THE FOLLOWING FUNCTIONS SAMPLE USAGE OF THE PLUGINS OPTIONS DEFINED ABOVE. TRY396 // CHANGING THE DROPDOWN SELECT BOX VALUE AND SAVING THE CHANGES. THEN REFRESH397 // A PAGE ON YOUR SITE TO SEE THE UPDATED VALUE.398 // ------------------------------------------------------------------------------399 400 373 401 374 /* <?php $my_greet = "What is up?"; ?> … … 403 376 */ 404 377 378 ///AJAX FOR THE FRONT-END OF THE PLUGIN DISPLAY. THIS IS WHERE USER PASTES SHORTCODE TO THEIR PAGE. 405 379 function shortpoints_process_ajax() { 406 380 $options = get_option('keeping_points_options'); … … 431 405 add_action ( 'wp_ajax_nopriv_shortpoints-ajax' , 'shortpoints_process_ajax' ); 432 406 407 408 //THE FRONT-END OF THE PLUGIN DISPLAY. THIS IS WHERE USER PASTES SHORTCODE TO THEIR PAGE. 433 409 function dlaugh_keeping_points_plugin() 434 410 { -
keeping-points/trunk/readme.txt
r1281403 r1286247 8 8 Requires at least: 4.3.1 9 9 Tested up to: 4.3.1 10 Stable tag: 0.9. 511 Version: 0.9. 510 Stable tag: 0.9.6 11 Version: 0.9.6 12 12 13 13 Keeping Points is a plugin to help create a points reward or tracking system for each person within a program, church, or company.
Note: See TracChangeset
for help on using the changeset viewer.